本文整理汇总了PHP中Varien_Data_Form::setMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form::setMethod方法的具体用法?PHP Varien_Data_Form::setMethod怎么用?PHP Varien_Data_Form::setMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form
的用法示例。
在下文中一共展示了Varien_Data_Form::setMethod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* Prepare form before rendering HTML
*
* @return BlueVisionTec_GoogleShoppingApi_Block_Adminhtml_Types_Edit_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$itemType = $this->getItemType();
$fieldset = $form->addFieldset('content_fieldset', array('legend' => $this->__('Attribute set mapping')));
if (!($targetCountry = $itemType->getTargetCountry())) {
$isoKeys = array_keys($this->_getCountriesArray());
$targetCountry = isset($isoKeys[0]) ? $isoKeys[0] : null;
}
$countrySelect = $fieldset->addField('select_target_country', 'select', array('label' => $this->__('Target Country'), 'title' => $this->__('Target Country'), 'name' => 'target_country', 'required' => true, 'options' => $this->_getCountriesArray(), 'value' => $targetCountry));
if ($itemType->getTargetCountry()) {
$countrySelect->setDisabled(true);
}
$attributeSetsSelect = $this->getAttributeSetsSelectElement($targetCountry)->setValue($itemType->getAttributeSetId());
if ($itemType->getAttributeSetId()) {
$attributeSetsSelect->setDisabled(true);
}
$fieldset->addField('attribute_set', 'note', array('label' => $this->__('Attribute Set'), 'title' => $this->__('Attribute Set'), 'required' => true, 'text' => '<div id="attribute_set_select">' . $attributeSetsSelect->toHtml() . '</div>'));
$attributesBlock = $this->getLayout()->createBlock('googleshoppingapi/adminhtml_types_edit_attributes')->setTargetCountry($targetCountry);
if ($itemType->getId()) {
$attributesBlock->setAttributeSetId($itemType->getAttributeSetId())->setAttributeSetSelected(true);
}
$attributes = Mage::registry('attributes');
if (is_array($attributes) && count($attributes) > 0) {
$attributesBlock->setAttributesData($attributes);
}
$fieldset->addField('attributes_box', 'note', array('label' => $this->__('Attributes Mapping'), 'text' => '<div id="attributes_details">' . $attributesBlock->toHtml() . '</div>'));
$form->addValues($itemType->getData());
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setMethod('post');
$form->setAction($this->getSaveUrl());
$this->setForm($form);
return parent::_prepareForm();
}
示例2: _prepareForm
protected function _prepareForm()
{
$faq = Mage::registry('current_origins');
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('edit_origins', array('legend' => Mage::helper('shiphawk_shipping')->__('Origins Details')));
if ($faq->getId()) {
$fieldset->addField('id', 'hidden', array('name' => 'id', 'required' => true));
}
$fieldset->addField('shiphawk_origin_title', 'text', array('name' => 'shiphawk_origin_title', 'title' => Mage::helper('shiphawk_shipping')->__('Title'), 'label' => Mage::helper('shiphawk_shipping')->__('Title'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_firstname', 'text', array('name' => 'shiphawk_origin_firstname', 'title' => Mage::helper('shiphawk_shipping')->__('First Name'), 'label' => Mage::helper('shiphawk_shipping')->__('First Name'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_lastname', 'text', array('name' => 'shiphawk_origin_lastname', 'title' => Mage::helper('shiphawk_shipping')->__('Last Name'), 'label' => Mage::helper('shiphawk_shipping')->__('Last Name'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_addressline1', 'text', array('name' => 'shiphawk_origin_addressline1', 'title' => Mage::helper('shiphawk_shipping')->__('Address'), 'label' => Mage::helper('shiphawk_shipping')->__('Address'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_addressline2', 'text', array('name' => 'shiphawk_origin_addressline2', 'title' => Mage::helper('shiphawk_shipping')->__('Address'), 'label' => Mage::helper('shiphawk_shipping')->__('Address Line 2'), 'required' => false, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_city', 'text', array('name' => 'shiphawk_origin_city', 'title' => Mage::helper('shiphawk_shipping')->__('City'), 'label' => Mage::helper('shiphawk_shipping')->__('City'), 'required' => true, 'width' => '400px'));
$regions = $this->getRegions();
$fieldset->addField('shiphawk_origin_state', 'select', array('name' => 'shiphawk_origin_state', 'title' => Mage::helper('shiphawk_shipping')->__('State'), 'label' => Mage::helper('shiphawk_shipping')->__('State'), 'required' => true, 'values' => $regions, 'width' => '100%'));
$fieldset->addField('shiphawk_origin_zipcode', 'text', array('name' => 'shiphawk_origin_zipcode', 'title' => Mage::helper('shiphawk_shipping')->__('Zip Code'), 'label' => Mage::helper('shiphawk_shipping')->__('Zip Code'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_phonenum', 'text', array('name' => 'shiphawk_origin_phonenum', 'title' => Mage::helper('shiphawk_shipping')->__('Phone number'), 'label' => Mage::helper('shiphawk_shipping')->__('Phone number'), 'required' => true, 'width' => '400px'));
$fieldset->addField('shiphawk_origin_location', 'select', array('name' => 'shiphawk_origin_location', 'title' => Mage::helper('shiphawk_shipping')->__('Location'), 'label' => Mage::helper('shiphawk_shipping')->__('Location'), 'required' => true, 'values' => array(array('value' => 'commercial', 'label' => 'commercial'), array('value' => 'residential', 'label' => 'residential')), 'width' => '400px'));
$fieldset->addField('shiphawk_origin_email', 'text', array('name' => 'shiphawk_origin_email', 'title' => Mage::helper('shiphawk_shipping')->__('Email'), 'label' => Mage::helper('shiphawk_shipping')->__('Email'), 'required' => false, 'width' => '400px'));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/save'));
$form->setValues($faq->getData());
$this->setForm($form);
}
示例3: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/saveNew'));
$this->setForm($form);
$fieldset = $form->addFieldset('productquestions_form', array('legend' => $this->__('Question details')));
$fieldset->addField('question_product_link', 'note', array('label' => $this->__('Product')));
$fieldset->addField('question_product_name', 'hidden', array('name' => 'question_product_name'));
$fieldset->addField('question_product_id', 'hidden', array('name' => 'question_product_id'));
if (Mage::app()->isSingleStoreMode()) {
$fieldset->addField('question_store_id', 'hidden', array('name' => 'question_store_id', 'value' => Mage::app()->getStore()->getId()));
} else {
$fieldset->addField('question_store_id', 'select', array('name' => 'question_store_id', 'label' => $this->__('Asked from'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, false)));
}
$fieldset->addField('question_datetime', 'hidden', array('name' => 'question_datetime', 'value' => Mage::getModel('core/date')->gmtDate()));
$fieldset->addField('question_date', 'date', array('name' => 'question_date', 'label' => $this->__('Asked on'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'value' => Mage::getModel('core/date')->gmtDate()));
if (Mage::app()->isSingleStoreMode()) {
$fieldset->addField('question_store_ids', 'hidden', array('name' => 'question_store_ids[]', 'value' => Mage::app()->getStore()->getId()));
} else {
$fieldset->addField('question_store_ids', 'multiselect', array('name' => 'question_store_ids[]', 'label' => $this->__('Show in stores'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)));
}
$fieldset->addField('question_author_name', 'text', array('name' => 'question_author_name', 'label' => $this->__('Author name'), 'required' => true, 'style' => 'width:700px;', 'value' => Mage::getSingleton('admin/session')->getUser()->getName()));
$fieldset->addField('question_author_email', 'text', array('name' => 'question_author_email', 'label' => $this->__('Author email'), 'required' => true, 'class' => 'validate-email', 'style' => 'width:700px;', 'value' => Mage::getSingleton('admin/session')->getUser()->getEmail()));
$fieldset->addField('question_text', 'editor', array('name' => 'question_text', 'label' => $this->__('Question'), 'required' => true, 'style' => 'width:700px; height:200px;'));
$fieldset->addField('question_reply_text', 'editor', array('name' => 'question_reply_text', 'label' => $this->__('Your reply'), 'title' => $this->__('Your reply'), 'style' => 'width:700px; height:500px;', 'wysiwyg' => false, 'required' => true));
return parent::_prepareForm();
}
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:30,代码来源:AW_Productquestions_Block_Adminhtml_Productquestions_Add_Form.php
示例4: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$model = Mage::getModel('salesrule/rule');
$templates = $model->getCollection();
// $templates->addFieldToFilter('uses_per_coupon', array('gt' => 0));
$templates->addFieldToFilter('name', array('like' => '_TEMPLATE:%'));
$ruleKV = array();
foreach ($templates as $t) {
$ruleKV[$t['rule_id']] = substr($t['name'], 10);
}
$fieldset = $form->addFieldset('new_bulkcoupon', array('legend' => Mage::helper('coupongenerator')->__('Coupon Details')));
$fieldset->addField('rule_id', 'select', array('name' => 'rule_id', 'title' => Mage::helper('coupongenerator')->__('Template Rule'), 'label' => Mage::helper('coupongenerator')->__('Template Rule'), 'maxlength' => '250', 'required' => true, 'values' => $ruleKV));
$fieldset->addField('prefix', 'text', array('name' => 'prefix', 'title' => Mage::helper('coupongenerator')->__('Coupon Prefix'), 'label' => Mage::helper('coupongenerator')->__('Coupon Prefix'), 'maxlength' => '50', 'required' => true));
$fieldset->addField('name_prefix', 'text', array('name' => 'name_prefix', 'title' => Mage::helper('coupongenerator')->__('Rule Name Prefix'), 'label' => Mage::helper('coupongenerator')->__('Rule Name Prefix'), 'maxlength' => '50', 'required' => true));
$fieldset->addField('quantity', 'text', array('name' => 'quantity', 'title' => Mage::helper('coupongenerator')->__('Quantity'), 'label' => Mage::helper('coupongenerator')->__('Quantity'), 'maxlength' => '50', 'class' => 'input-text required-entry validate-quantity', 'required' => true));
$fieldset->addField('rand_len', 'text', array('name' => 'rand_len', 'title' => Mage::helper('coupongenerator')->__('Random String Length'), 'label' => Mage::helper('coupongenerator')->__('Random String Length'), 'maxlength' => '2', 'class' => 'input-text required-entry validate-rand_len', 'required' => true));
$dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$fieldset->addField('expires', 'date', array('name' => 'expires', 'title' => Mage::helper('coupongenerator')->__('Expires'), 'label' => Mage::helper('coupongenerator')->__('Expires'), 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT, 'format' => $dateFormatIso, 'image' => $this->getSkinUrl('images/grid-cal.gif')));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/post'));
$this->setForm($form);
}
示例5: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('review_fieldset', array('legend' => Mage::helper('adminhtml')->__('Review your payment and pay')));
$data = $this->getRequest()->getPost();
$paymentMethod = Mage::getModel('affiliateplus/payment');
if ($paymentId = $this->getRequest()->getParam('id')) {
$paymentMethod->load($paymentId);
}
$paymentMethod = $paymentMethod->addData($data)->getPayment();
foreach ($data as $key => $value) {
if ($key == 'form_key') {
continue;
}
if (strpos($key, $paymentMethod->getPaymentCode()) === 0) {
$paymentMethod->setData(str_replace($paymentMethod->getPaymentCode() . '_', '', $key), $value);
}
$fieldset->addField($key, 'hidden', array('name' => $key));
}
$fieldset->addField('show_account_email', 'note', array('label' => Mage::helper('affiliateplus')->__('To Account'), 'text' => $data['account_email']));
$fieldset->addField('show_amount', 'note', array('label' => Mage::helper('affiliateplus')->__('Amount To Transfer'), 'text' => Mage::app()->getStore()->getBaseCurrency()->format($data['amount'])));
if ($this->getRequest()->getParam('masspayout') == 'true') {
$data['fee'] = $paymentMethod->getEstimateFee($data['amount'], Mage::getStoreConfig('affiliateplus/payment/who_pay_fees', $this->getRequest()->getParam('store')));
}
$fieldset->addField('show_fee', 'note', array('label' => Mage::helper('affiliateplus')->__('Estimated Fee'), 'text' => Mage::app()->getStore()->getBaseCurrency()->format($data['fee'])));
$fieldset->addField('payment_info', 'note', array('label' => Mage::helper('affiliateplus')->__('Payment Info'), 'text' => $paymentMethod->getInfoHtml()));
$form->setValues($data);
$form->setAction($this->getUrl('*/*/savePayment', array('id' => $this->getRequest()->getParam('id'), 'masspayout' => $this->getRequest()->getParam('masspayout'), 'store' => $this->getRequest()->getParam('store'))));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$this->setForm($form);
return parent::_prepareForm();
}
示例6: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('add_review_form', array('legend' => Mage::helper('review')->__('Review Details')));
$fieldset->addField('product_name', 'note', array('label' => Mage::helper('review')->__('Product'), 'text' => 'product_name'));
$fieldset->addField('detailed_rating', 'note', array('label' => Mage::helper('review')->__('Product Rating'), 'required' => true, 'text' => '<div id="rating_detail">' . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '</div>'));
$fieldset->addField('status_id', 'select', array('label' => Mage::helper('review')->__('Status'), 'required' => true, 'name' => 'status_id', 'values' => Mage::helper('review')->getReviewStatusesOptionArray()));
/**
* Check is single store mode
*/
if (!Mage::app()->isSingleStoreMode()) {
$field = $fieldset->addField('select_stores', 'multiselect', array('label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()));
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$field->setRenderer($renderer);
}
$fieldset->addField('nickname', 'text', array('name' => 'nickname', 'title' => Mage::helper('review')->__('Nickname'), 'label' => Mage::helper('review')->__('Nickname'), 'maxlength' => '50', 'required' => true));
$fieldset->addField('title', 'text', array('name' => 'title', 'title' => Mage::helper('review')->__('Summary of Review'), 'label' => Mage::helper('review')->__('Summary of Review'), 'maxlength' => '255', 'required' => true));
$fieldset->addField('detail', 'textarea', array('name' => 'detail', 'title' => Mage::helper('review')->__('Review'), 'label' => Mage::helper('review')->__('Review'), 'style' => 'height: 600px;', 'required' => true));
$fieldset->addField('product_id', 'hidden', array('name' => 'product_id'));
/*$gridFieldset = $form->addFieldset('add_review_grid', array('legend' => Mage::helper('review')->__('Please select a product')));
$gridFieldset->addField('products_grid', 'note', array(
'text' => $this->getLayout()->createBlock('adminhtml/review_product_grid')->toHtml(),
));*/
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/post'));
$this->setForm($form);
}
示例7: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$collection = Mage::getModel('eav/entity_attribute_set')->getResourceCollection()->load()->toOptionArray();
$form->addField('set_switcher', 'select', array('name' => 'set_switcher', 'required' => true, 'class' => 'left-col-block', 'no_span' => true, 'values' => $collection, 'onchange' => 'this.form.submit()'));
$form->setUseContainer(true);
$form->setMethod('post');
$this->setForm($form);
}
示例8: _prepareForm
protected function _prepareForm()
{
$rateObject = new Varien_Object(Mage::getSingleton('tax/calculation_rate')->getData());
$form = new Varien_Data_Form();
$countries = Mage::getModel('adminhtml/system_config_source_country')->toOptionArray();
unset($countries[0]);
if (!$rateObject->hasTaxCountryId()) {
$rateObject->setTaxCountryId(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_COUNTRY));
}
if (!$rateObject->hasTaxRegionId()) {
$rateObject->setTaxRegionId(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_REGION));
}
$regionCollection = Mage::getModel('directory/region')->getCollection()->addCountryFilter($rateObject->getTaxCountryId());
$regions = $regionCollection->toOptionArray();
if ($regions) {
$regions[0]['label'] = '*';
} else {
$regions = array(array('value' => '', 'label' => '*'));
}
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('tax')->__('Tax Rate Information')));
if ($rateObject->getTaxCalculationRateId() > 0) {
$fieldset->addField('tax_calculation_rate_id', 'hidden', array('name' => 'tax_calculation_rate_id', 'value' => $rateObject->getTaxCalculationRateId()));
}
$fieldset->addField('code', 'text', array('name' => 'code', 'label' => Mage::helper('tax')->__('Tax Identifier'), 'title' => Mage::helper('tax')->__('Tax Identifier'), 'class' => 'required-entry', 'required' => true));
$fieldset->addField('tax_country_id', 'select', array('name' => 'tax_country_id', 'label' => Mage::helper('tax')->__('Country'), 'required' => true, 'values' => $countries));
$fieldset->addField('tax_region_id', 'select', array('name' => 'tax_region_id', 'label' => Mage::helper('tax')->__('State'), 'values' => $regions));
$fieldset->addField('zip_is_range', 'select', array('name' => 'zip_is_range', 'label' => Mage::helper('tax')->__('Zip/Post is Range'), 'options' => array('0' => Mage::helper('tax')->__('No'), '1' => Mage::helper('tax')->__('Yes'))));
if (!$rateObject->hasTaxPostcode()) {
$rateObject->setTaxPostcode(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_DEFAULT_POSTCODE));
}
$allwarehouse[] = 0;
$warehouses = Mage::getModel('awa_inventory/warehouse')->getCollection()->addFieldToFilter('status', 1);
foreach ($warehouses as $warehouse) {
$allwarehouse[] = $warehouse->getEntityId();
}
$fieldset->addField('tax_postcode', 'text', array('name' => 'tax_postcode', 'label' => Mage::helper('tax')->__('Zip/Post Code'), 'note' => Mage::helper('tax')->__("'*' - matches any; 'xyz*' - matches any that begins on 'xyz' and not longer than %d.", Mage::helper('tax')->getPostCodeSubStringLength())));
$fieldset->addField('zip_from', 'text', array('name' => 'zip_from', 'label' => Mage::helper('tax')->__('Range From'), 'required' => true, 'maxlength' => 9, 'class' => 'validate-digits'));
$fieldset->addField('zip_to', 'text', array('name' => 'zip_to', 'label' => Mage::helper('tax')->__('Range To'), 'required' => true, 'maxlength' => 9, 'class' => 'validate-digits'));
$fieldset->addField('warehouse_id', 'select', array('name' => 'warehouse_id', 'label' => Mage::helper('tax')->__('Choose Warehose'), 'required' => true, 'maxlength' => 9, 'class' => 'validate-digits', 'values' => Mage::getModel('awa_inventory/warehouse_attribute_source_inputtype')->getAllOptions(true)));
$fieldset->addField('rate', 'text', array('name' => 'rate', 'label' => Mage::helper('tax')->__('Rate Percent'), 'title' => Mage::helper('tax')->__('Rate Percent'), 'required' => true, 'class' => 'validate-not-negative-number'));
$form->setAction($this->getUrl('*/tax_rate/save'));
$form->setUseContainer(true);
$form->setId('rate_form');
$form->setMethod('post');
if (!Mage::app()->isSingleStoreMode()) {
$form->addElement(Mage::getBlockSingleton('adminhtml/tax_rate_title_fieldset')->setLegend(Mage::helper('tax')->__('Tax Titles')));
}
$rateData = $rateObject->getData();
if ($rateObject->getZipIsRange()) {
list($rateData['zip_from'], $rateData['zip_to']) = explode('-', $rateData['tax_postcode']);
}
$form->setValues($rateData);
$this->setForm($form);
$this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap('zip_is_range', 'zip_is_range')->addFieldMap('tax_postcode', 'tax_postcode')->addFieldMap('zip_from', 'zip_from')->addFieldMap('zip_to', 'zip_to')->addFieldDependence('zip_from', 'zip_is_range', '1')->addFieldDependence('zip_to', 'zip_is_range', '1')->addFieldDependence('tax_postcode', 'zip_is_range', '0'));
return parent::_prepareForm();
}
示例9: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('set_fieldset', array('legend' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add New Attribute')));
$fieldset->addField('new_attribute', 'text', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Name'), 'name' => 'new_attribute', 'required' => true));
$fieldset->addField('submit', 'note', array('text' => $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData(array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Attribute'), 'onclick' => 'this.form.submit();', 'class' => 'add'))->toHtml()));
$form->setUseContainer(true);
$form->setMethod('post');
$this->setForm($form);
}
示例10: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->addField('filter_value', 'select', array('name' => 'filter_value', 'onchange' => 'this.form.submit()', 'values' => array(array('label' => Mage::helper('customer')->__('All'), 'value' => ''), array('label' => Mage::helper('customer')->__('Customers Only'), 'value' => 'filterCustomers'), array('label' => Mage::helper('customer')->__('Visitors Only'), 'value' => 'filterGuests')), 'no_span' => true));
$form->setUseContainer(true);
$form->setId('filter_form');
$form->setMethod('post');
$this->setForm($form);
return parent::_prepareForm();
}
示例11: _prepareForm
/**
* Prepare Form.
*
* @return Mage_Webapi_Block_Adminhtml_User_Edit_Form
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$form->setId('edit_form');
$form->setAction($this->getUrl('*/*/save'));
$form->setMethod('post');
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
示例12: _prepareForm
protected function _prepareForm()
{
$userId = Mage::getSingleton('admin/session')->getUser()->getId();
$user = Mage::getModel('admin/user')->load($userId);
$user->unsetData('password');
//$form = new Varien_Data_Form();
$form = new Varien_Data_Form(array('id' => 'edit_form', 'enctype' => 'multipart/form-data'));
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('adminhtml')->__('Account Information')));
$fieldset->addField('username', 'text', array('name' => 'username', 'label' => Mage::helper('adminhtml')->__('User Name'), 'title' => Mage::helper('adminhtml')->__('User Name'), 'required' => true));
$fieldset->addField('firstname', 'text', array('name' => 'firstname', 'label' => Mage::helper('adminhtml')->__('First Name'), 'title' => Mage::helper('adminhtml')->__('First Name'), 'required' => true));
$fieldset->addField('lastname', 'text', array('name' => 'lastname', 'label' => Mage::helper('adminhtml')->__('Last Name'), 'title' => Mage::helper('adminhtml')->__('Last Name'), 'required' => true));
$fieldset->addField('user_id', 'hidden', array('name' => 'user_id'));
$fieldset->addField('email', 'text', array('name' => 'email', 'label' => Mage::helper('adminhtml')->__('Email'), 'title' => Mage::helper('adminhtml')->__('User Email'), 'required' => true));
$fieldset->addField('password', 'password', array('name' => 'new_password', 'label' => Mage::helper('adminhtml')->__('New Password'), 'title' => Mage::helper('adminhtml')->__('New Password'), 'class' => 'input-text validate-admin-password'));
$fieldset->addField('confirmation', 'password', array('name' => 'password_confirmation', 'label' => Mage::helper('adminhtml')->__('Password Confirmation'), 'class' => 'input-text validate-cpassword'));
$form->setValues($user->getData());
$roleId = Mage::helper('marketplace')->getConfig('general', 'vendor_role');
// $role = Mage::getModel('admin/roles')->load($roleId);
$current_user = Mage::getSingleton('admin/session')->getUser();
if ($current_user->getRole()->getRoleId() == $roleId) {
$profileCollection = Mage::getModel('marketplace/profile')->getCollection()->addFieldToFilter('user_id', $userId);
$profile = Mage::getModel('marketplace/profile');
if ($profileCollection->count() > 0) {
$profile->load($profileCollection->getFirstItem()->getId());
}
$fieldset = $form->addFieldset('profile_fieldset', array('legend' => Mage::helper('adminhtml')->__('Profile Information')));
$fieldset->addField('shop_name', 'text', array('name' => 'shop_name', 'label' => Mage::helper('adminhtml')->__('Shop Name'), 'title' => Mage::helper('adminhtml')->__('Shop Name'), 'required' => true, 'value' => $profile->getShopName()));
$fieldset->addField('message', 'textarea', array('name' => 'message', 'label' => Mage::helper('adminhtml')->__('Message'), 'title' => Mage::helper('adminhtml')->__('Message'), 'value' => $profile->getMessage(), 'style' => 'width: 400px; height: 90px;'));
$fieldset->addField('contact_number', 'text', array('name' => 'contact_number', 'label' => Mage::helper('adminhtml')->__('Contact Number'), 'title' => Mage::helper('adminhtml')->__('Contact Number'), 'value' => $profile->getContactNumber(), 'required' => true, 'class' => 'validate-phoneLax'));
$fieldset->addField('country', 'select', array('name' => 'country', 'label' => Mage::helper('adminhtml')->__('Country'), 'title' => Mage::helper('adminhtml')->__('Country'), 'class' => 'input-select', 'required' => true, 'value' => $profile->getCountry(), 'options' => $this->_getCountryList()));
$fieldset->addField('image', 'file', array('name' => 'image', 'label' => Mage::helper('adminhtml')->__('Profile Picture'), 'title' => Mage::helper('adminhtml')->__('Profile Picture'), 'after_element_html' => '<br />' . $this->_getImage($profile->getImage())));
$proofList = Mage::helper('marketplace')->getVarificationProofTypeList();
if (count($proofList) > 1) {
$fieldset->addField('proof_type', 'text', array('name' => 'proof_type', 'label' => Mage::helper('adminhtml')->__('Proof Type'), 'title' => Mage::helper('adminhtml')->__('Proof Type'), 'value' => $profile->getProofType(), 'style' => 'display: none;', 'after_element_html' => $this->_getFiles($profile->getProofType(), $profile->getVarificationFiles())));
}
$fieldset->addField('admin_commission_percentage', 'text', array('name' => 'admin_commission_percentage', 'label' => Mage::helper('adminhtml')->__('Commission (in %)'), 'title' => Mage::helper('adminhtml')->__('Commission (in %)'), 'class' => 'validate-number validate-digits-range digits-range-0-100', 'required' => true, 'style' => 'display:none;', 'value' => $profile->getAdminCommissionPercentage(), 'after_element_html' => '<b>' . $profile->getAdminCommissionPercentage() . '</b>'));
$fieldset->addField('total_admin_commission', 'text', array('name' => 'total_admin_commission', 'label' => Mage::helper('adminhtml')->__('Admin Earnings'), 'title' => Mage::helper('adminhtml')->__('Admin Earnings'), 'disabled' => true, 'style' => 'display:none;', 'value' => $profile->getTotalAdminCommission(), 'after_element_html' => '<b>' . $this->formatPrice($profile->getTotalAdminCommission()) . '</b>'));
$fieldset->addField('total_vendor_amount', 'text', array('name' => 'total_vendor_amount', 'label' => Mage::helper('adminhtml')->__('Vendor Balance'), 'title' => Mage::helper('adminhtml')->__('Vendor Balance'), 'disabled' => true, 'style' => 'display:none;', 'value' => number_format($profile->getTotalVendorAmount() - $profile->getTotalVendorPaid(), 4, '.', ''), 'after_element_html' => '<b>' . $this->formatPrice($profile->getTotalVendorAmount() - $profile->getTotalVendorPaid()) . '</b>'));
$fieldset = $form->addFieldset('bank_fieldset', array('legend' => Mage::helper('adminhtml')->__('Bank Information')));
$fieldset->addField('account_name', 'text', array('name' => 'account_name', 'label' => Mage::helper('adminhtml')->__('Account Name'), 'id' => 'account_name', 'value' => $profile->getAccountName(), 'title' => Mage::helper('adminhtml')->__('Account Name'), 'required' => true));
$fieldset->addField('bank_name', 'text', array('name' => 'bank_name', 'label' => Mage::helper('adminhtml')->__('Bank Name'), 'id' => 'bank_name', 'value' => $profile->getBankName(), 'title' => Mage::helper('adminhtml')->__('Bank Name'), 'required' => true));
$fieldset->addField('account_number', 'text', array('name' => 'account_number', 'label' => Mage::helper('adminhtml')->__('Account Number'), 'id' => 'account_number', 'value' => $profile->getAccountNumber(), 'title' => Mage::helper('adminhtml')->__('Account Number'), 'required' => true));
$fieldset->addField('ifsc_code', 'text', array('name' => 'ifsc_code', 'label' => Mage::helper('adminhtml')->__('IFSC code'), 'id' => 'ifsc_code', 'value' => $profile->getIfscCode(), 'title' => Mage::helper('adminhtml')->__('IFSC code'), 'required' => true));
$fieldset->addField('pan_number', 'text', array('name' => 'pan_number', 'label' => Mage::helper('adminhtml')->__('PAN Number'), 'id' => 'pan_number', 'value' => $profile->getPanNumber(), 'title' => Mage::helper('adminhtml')->__('PAN Number'), 'required' => true));
$fieldset->addField('tin_number', 'text', array('name' => 'tin_number', 'label' => Mage::helper('adminhtml')->__('TIN Number'), 'id' => 'tin_number', 'value' => $profile->getTinNumber(), 'title' => Mage::helper('adminhtml')->__('TIN Number'), 'required' => true));
$fieldset->addField('vat_number', 'text', array('name' => 'vat_number', 'label' => Mage::helper('adminhtml')->__('CST/VAT Number'), 'id' => 'vat_number', 'value' => $profile->getVatNumber(), 'title' => Mage::helper('adminhtml')->__('CST/VAT Number'), 'required' => true));
}
$form->setAction($this->getUrl('*/system_account/save'));
$form->setMethod('post');
$form->setUseContainer(true);
$form->setId('edit_form');
$this->setForm($form);
//return parent::_prepareForm();
return Mage_Adminhtml_Block_Widget_Form::_prepareForm();
}
示例13: _prepareForm
/**
* Form with widget to select
*/
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('base_fieldset', array('legend' => $this->helper('widget')->__('Widget')));
$select = $fieldset->addField('select_widget_type', 'select', array('label' => $this->helper('widget')->__('Widget Type'), 'title' => $this->helper('widget')->__('Widget Type'), 'name' => 'widget_type', 'required' => true, 'options' => $this->_getWidgetSelectOptions(), 'after_element_html' => $this->_getWidgetSelectAfterHtml()));
$form->setUseContainer(true);
$form->setId('widget_options_form');
$form->setMethod('post');
$form->setAction($this->getUrl('*/*/buildWidget'));
$this->setForm($form);
}
示例14: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldSet = $form->addFieldset('base_fieldset', array('legend' => $this->helper('enterprise_support')->__('Chose Report Types')));
$fieldSet->addField('select_report_type', 'multiselect', array('name' => 'report_types[]', 'label' => Mage::helper('enterprise_support')->__('Types'), 'title' => Mage::helper('enterprise_support')->__('Types'), 'required' => true, 'values' => Mage::helper('enterprise_support')->getSysReportTypeOptions(), 'value' => Mage::helper('enterprise_support')->getSysReportTypeNames()));
$form->setUseContainer(true);
$form->setId('sysreport_create_form');
$form->setMethod('post');
$form->setAction($this->getUrl('*/*/create'));
$this->setForm($form);
}
示例15: _prepareForm
protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('create-ticket-fieldset', array('legend' => $this->__('Create Ticket'), 'class' => 'fieldset-wide'));
$fieldset->addField('ticket_fields_area', 'note', array('name' => 'ticket_fields_area', 'text' => '<div style="width:50%;">' . $this->getLayout()->createBlock('freshdesk/adminhtml_ticket_edit_form_fields')->setForm($this)->toHtml() . '</div>'));
$form->setUseContainer(true);
$form->setId('edit_form');
$form->setMethod('post');
$form->setAction($this->getSaveUrl());
$this->setForm($form);
return parent::_prepareForm();
}