/**
  * Block constructor
  */
 public function __construct()
 {
     $this->_controller = 'sitemap';
     $this->_headerText = Mage::helper('sitemap')->__('Google Sitemap');
     $this->_addButtonLabel = Mage::helper('sitemap')->__('Add Sitemap');
     parent::__construct();
 }
 /**
  * (non-PHPdoc)
  * @see lib/Faett/Channel/Serializer/Interfaces/Faett_Channel_Serializer_Interfaces_Serializer#serialize()
  */
 public function serialize()
 {
     try {
         // initialize a new DOM document
         $doc = new DOMDocument('1.0', 'UTF-8');
         // create new namespaced root element
         $a = $doc->createElementNS($this->_namespace, 'a');
         // add the schema to the root element
         $a->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', 'http://pear.php.net/dtd/rest.allcategories http://pear.php.net/dtd/rest.allcategories.xsd');
         // create an element for the channel's name
         $ch = $doc->createElement('ch');
         $ch->nodeValue = Mage::helper('channel')->getChannelName();
         // append the element with the channel's name to the root element
         $a->appendChild($ch);
         // load the product's attributes
         $attributes = $this->_category->getSelectOptions();
         // iterate over the channel's categories
         foreach ($attributes as $attribute) {
             $c = $doc->createElement('c');
             $c->setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '/channel/index/c/' . $attribute . '/info.xml');
             $c->nodeValue = $attribute;
             // append the XLink to the root element
             $a->appendChild($c);
         }
         // append the root element to the DOM tree
         $doc->appendChild($a);
         // return the XML document
         return $doc->saveXML();
     } catch (Exception $e) {
         return $e->getMessage();
     }
 }
Example #3
1
 /**
  * Prepare to render
  */
 protected function _prepareToRender()
 {
     $this->addColumn('customer_group_id', array('label' => Mage::helper('Mage_Customer_Helper_Data')->__('Customer Group'), 'renderer' => $this->_getGroupRenderer()));
     $this->addColumn('min_sale_qty', array('label' => Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Minimum Qty'), 'style' => 'width:100px'));
     $this->_addAfter = false;
     $this->_addButtonLabel = Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Add Minimum Qty');
 }
Example #4
1
 /**
  * Options getter
  *
  * @return array
  */
 public function toGridOptionArray()
 {
     return array(
         self::IMAGE => Mage::helper('adminhtml')->__('Image'),
         self::PRODUCT => Mage::helper('adminhtml')->__('Product')
     );
 }
Example #5
1
 public function PostAction()
 {
     $evidencija_model = Mage::getModel('evidencija/evidencija');
     $devices_model = Mage::getModel('evidencija/devices');
     $post_name = $this->getRequest()->getPost('name');
     $post_sn = $this->getRequest()->getPost('sn');
     $post_supplier = $this->getRequest()->getPost('supplier');
     $post_comment = $this->getRequest()->getPost('comment');
     $post_warranty = $this->getRequest()->getPost('warranty');
     $helper = Mage::helper('evidencija');
     if (empty($post_sn[0])) {
         $this->redirectError('Morate uneti serijski broj !!!');
     } else {
         // prepare data for customer table
         $evidencija_data = array('name' => $post_name, 'supplier' => $post_supplier, 'comment' => $post_comment, 'warranty' => $post_warranty);
         $evidencija_model->setData($evidencija_data)->save();
         $evidencija_id = $evidencija_model->getEntityId();
         foreach ($post_sn as $key => $post) {
             if (empty($post)) {
                 continue;
             }
             // prepare data for device table
             $post = rtrim($post, "\r");
             $post = rtrim($post, "\n");
             $device_data = array('device_id' => $evidencija_id, 'serial' => $post);
             $devices_model->setData($device_data)->save();
         }
         if ($devices_model->getEntityId()) {
             Mage::getSingleton('core/session')->addSuccess($this->__('Nov uredjaj je uspešno dodat u bazu'));
         } else {
             Mage::getSingleton('core/session')->addError($this->__('Došlo je do greške, obavesti Dodu !'));
         }
         $this->_redirectReferer();
     }
 }
Example #6
1
 /**
  * Change columns position
  *
  * @param string $table
  * @param string $column
  * @param boolean $after
  * @param boolean $first
  * @return Enterprise_SalesArchive_Model_Resource_Helper_Mysql4
  */
 public function changeColumnPosition($table, $column, $after = false, $first = false)
 {
     if ($after && $first) {
         if (is_string($after)) {
             $first = false;
         } else {
             $after = false;
         }
     } elseif (!$after && !$first) {
         // If no new position specified
         return $this;
     }
     if (!$this->_getWriteAdapter()->isTableExists($table)) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Table not found'));
     }
     $columns = array();
     $adapter = $this->_getWriteAdapter();
     $description = $adapter->describeTable($table);
     foreach ($description as $columnDescription) {
         $columns[$columnDescription['COLUMN_NAME']] = $adapter->getColumnDefinitionFromDescribe($columnDescription);
     }
     if (!isset($columns[$column])) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Column not found'));
     } elseif ($after && !isset($columns[$after])) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Positioning column not found'));
     }
     if ($after) {
         $sql = sprintf('ALTER TABLE %s MODIFY COLUMN %s %s AFTER %s', $adapter->quoteIdentifier($table), $adapter->quoteIdentifier($column), $columns[$column], $adapter->quoteIdentifier($after));
     } else {
         $sql = sprintf('ALTER TABLE %s MODIFY COLUMN %s %s FIRST', $adapter->quoteIdentifier($table), $adapter->quoteIdentifier($column), $columns[$column]);
     }
     $adapter->query($sql);
     return $this;
 }
Example #7
1
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_ordered', array('header' => Mage::helper('sales')->__('Sales Items'), 'index' => 'total_qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_invoiced', array('header' => Mage::helper('sales')->__('Items'), 'index' => 'total_qty_invoiced', 'type' => 'number', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns')));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('total_income_amount', array('header' => Mage::helper('sales')->__('Sales Total'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_income_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_revenue_amount', array('header' => Mage::helper('sales')->__('Revenue'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_revenue_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_profit_amount', array('header' => Mage::helper('sales')->__('Profit'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_profit_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_invoiced_amount', array('header' => Mage::helper('sales')->__('Invoiced'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_invoiced_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_paid_amount', array('header' => Mage::helper('sales')->__('Paid'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_paid_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_refunded_amount', array('header' => Mage::helper('sales')->__('Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_refunded_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount', array('header' => Mage::helper('sales')->__('Sales Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount_actual', array('header' => Mage::helper('sales')->__('Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_shipping_amount', array('header' => Mage::helper('sales')->__('Sales Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_shipping_amount_actual', array('header' => Mage::helper('sales')->__('Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_discount_amount', array('header' => Mage::helper('sales')->__('Sales Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_discount_amount_actual', array('header' => Mage::helper('sales')->__('Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_canceled_amount', array('header' => Mage::helper('sales')->__('Canceled'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_canceled_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addExportType('*/*/exportSalesCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportSalesExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
Example #8
0
 /**
  * Retrieve all options array
  *
  * @return array
  */
 public function getAllOptions()
 {
     if (is_null($this->_options)) {
         $this->_options = array(array('label' => Mage::helper('eav')->__('Selecteaza'), 'value' => '', 'selected' => 'selected'), array('label' => Mage::helper('eav')->__('Incluse in pret'), 'value' => 'incluse'), array('label' => Mage::helper('eav')->__('Decontate de client'), 'value' => 'decontate'));
     }
     return $this->_options;
 }
Example #9
0
 protected function _beforeToHtml()
 {
     $this->moduleName = Mage::helper('M2ePro/Module')->getName();
     $this->moduleVersion = Mage::helper('M2ePro/Module')->getVersion();
     $this->moduleRevision = Mage::helper('M2ePro/Module')->getRevision();
     return parent::_beforeToHtml();
 }
Example #10
0
 function getarchiveOptions($order = 'DESC', $limit = '', $show_post_count = false, $showMonths = true)
 {
     $order = strtoupper($order);
     $collection = Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter('status', 3)->setOrder('created_time', $order);
     $collection->getSelect()->reset(Zend_Db_Select::COLUMNS)->columns('heading');
     if ($showMonths) {
         $collection->getSelect()->group(array('YEAR(created_time)', 'MONTH(created_time)'));
     } else {
         $collection->getSelect()->group(array('YEAR(created_time)'));
     }
     if ('' != $limit) {
         $collection->limit($limit);
     }
     //$collection->printLogQuery(true);die;
     $output = '';
     $route = Mage::helper('gallery')->getRoute('archive');
     foreach ($collection as $item) {
         $tm = mktime(0, 0, 0, $item->month, 1, $item->year);
         if ($showMonths) {
             $url = $route . "/y/" . $item->year . "/m/" . $item->month;
             $text = date('F Y', $tm);
         } else {
             $url = $route . "/y/" . $item->year;
             $text = date('Y', $tm);
         }
         $after = "";
         if ($show_post_count) {
             $after = ' (' . $item->posts . ')';
         }
         $output .= "<div class='nav_link'><a href='" . $url . "'>" . $text . " " . $after . "</a></div>";
     }
     return $output;
 }
Example #11
0
 /**
  * Modify header & button labels
  *
  */
 public function __construct()
 {
     $this->_controller = 'customer_group';
     $this->_headerText = Mage::helper('customer')->__('Customer Groups');
     $this->_addButtonLabel = Mage::helper('customer')->__('Add New Customer Group');
     parent::__construct();
 }
Example #12
0
 /**
  * Get product input types as option array
  *
  * @return array
  */
 public function toOptionArray()
 {
     $inputTypes = array(array('value' => 'price', 'label' => Mage::helper('catalog')->__('Price')), array('value' => 'media_image', 'label' => Mage::helper('catalog')->__('Media Image')));
     $response = new Varien_Object();
     $response->setTypes(array());
     Mage::dispatchEvent('adminhtml_product_attribute_types', array('response' => $response));
     $_disabledTypes = array();
     $_hiddenFields = array();
     foreach ($response->getTypes() as $type) {
         $inputTypes[] = $type;
         if (isset($type['hide_fields'])) {
             $_hiddenFields[$type['value']] = $type['hide_fields'];
         }
         if (isset($type['disabled_types'])) {
             $_disabledTypes[$type['value']] = $type['disabled_types'];
         }
     }
     if (Mage::registry('attribute_type_hidden_fields') === null) {
         Mage::register('attribute_type_hidden_fields', $_hiddenFields);
     }
     if (Mage::registry('attribute_type_disabled_types') === null) {
         Mage::register('attribute_type_disabled_types', $_disabledTypes);
     }
     return array_merge(parent::toOptionArray(), $inputTypes);
 }
 /**
  * Initialize edit tabs
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->setId('customer_attribute_tabs');
     $this->setDestElementId('edit_form');
     $this->setTitle(Mage::helper('enterprise_customer')->__('Attribute Information'));
 }
 public function __construct()
 {
     $this->_controller = 'report_review_product';
     $this->_headerText = Mage::helper('reports')->__('Products Reviews');
     parent::__construct();
     $this->_removeButton('add');
 }
Example #15
0
 /**
  * Retrieve all attribute options
  *
  * @return array
  */
 public function getAllOptions()
 {
     if (!$this->_options) {
         $this->_options = array(array('label' => Mage::helper('giftmessage')->__('Yes'), 'value' => 1), array('label' => Mage::helper('giftmessage')->__('No'), 'value' => 0), array('label' => Mage::helper('giftmessage')->__('Use config'), 'value' => 2));
     }
     return $this->_options;
 }
Example #16
0
 public function getAdditionalActionsButtonHtml()
 {
     $data = array('target_css_class' => 'additional-actions-button-drop-down', 'items' => array(array('url' => $this->getUrl('*/adminhtml_development_tools_magento/clearMagentoCache'), 'target' => '_blank', 'label' => Mage::helper('M2ePro')->__('Flush Magento Cache'))));
     $dropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
     $dropDownBlock->setData($data);
     return $dropDownBlock->toHtml();
 }
Example #17
0
 /**
  * Initialize tabs and define tabs block settings
  */
 public function __construct()
 {
     parent::__construct();
     $this->setId('page_tabs');
     $this->setDestElementId('edit_form');
     $this->setTitle(Mage::helper('slider')->__('Slider Item Info'));
 }
 public function render(Varien_Object $row)
 {
     $sendType = $row->getTemplateSendType();
     $actions = array();
     // Edit Action
     $actions[] = array('url' => $this->getUrl('*/*/brontoEdit', array('id' => $row->getId())), 'caption' => $this->__('Edit'));
     // Delete Action
     $actions[] = array('url' => $this->getUrl('*/*/massDelete', array('template_id' => $row->getId())), 'caption' => $this->__('Delete'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to delete the selected template?  If this template is currently assigned to be used, it will automatically be reassigned to the default Magento template.'));
     switch ($sendType) {
         case 'transactional':
             $actions[] = array('url' => $this->getUrl('*/*/updateSendType', array('template_id' => $row->getId(), 'send_type' => 'marketing')), 'caption' => $this->__('Set to Bronto Marketing'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to set this template to send through Bronto as a marketing message?'));
             $actions[] = array('url' => $this->getUrl('*/*/updateSendType', array('template_id' => $row->getId(), 'send_type' => 'magento')), 'caption' => $this->__('Set to Magento Email'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to set this template to send through Magento?'));
             break;
         case 'magento':
             $actions[] = array('url' => $this->getUrl('*/*/updateSendType', array('template_id' => $row->getId(), 'send_type' => 'transactional')), 'caption' => $this->__('Set to Bronto Transactional'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to set this template to send through Bronto as a transactional message?'));
             $actions[] = array('url' => $this->getUrl('*/*/updateSendType', array('template_id' => $row->getId(), 'send_type' => 'marketing')), 'caption' => $this->__('Set to Bronto Marketing'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to set this template to send through Bronto as a marketing message?'));
             break;
         default:
             $actions[] = array('url' => $this->getUrl('*/*/updateSendType', array('template_id' => $row->getId(), 'send_type' => 'transactional')), 'caption' => $this->__('Set to Bronto Transactional'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to set this template to send through Bronto as a transactional message?'));
             $actions[] = array('url' => $this->getUrl('*/*/updateSendType', array('template_id' => $row->getId(), 'send_type' => 'magento')), 'caption' => $this->__('Set to Magento Email'), 'confirm' => Mage::helper('bronto_email')->__('Are you sure you want to set this template to send through Magento?'));
             break;
     }
     $this->getColumn()->setActions($actions);
     return parent::render($row);
 }
Example #19
0
 /**
  * Retrieve required options from parent
  */
 protected function _beforeToHtml()
 {
     if (!$this->getParentBlock()) {
         Mage::throwException(Mage::helper('adminhtml')->__('Invalid parent block for this block'));
     }
     parent::_beforeToHtml();
 }
Example #20
0
 public function __construct()
 {
     $this->_controller = 'sales_invoice';
     $this->_headerText = Mage::helper('sales')->__('Invoices');
     parent::__construct();
     $this->_removeButton('add');
 }
 /**
  * Block constructor
  */
 public function __construct()
 {
     $this->_controller = 'system_variable';
     $this->_headerText = Mage::helper('adminhtml')->__('Custom Variables');
     parent::__construct();
     $this->_updateButton('add', 'label', Mage::helper('adminhtml')->__('Add New Variable'));
 }
 protected function _prepareMassaction()
 {
     $this->setMassactionIdField('opp_order_id');
     $this->getMassactionBlock()->setFormFieldName('full_stock_orders_order_ids');
     $this->getMassactionBlock()->addItem('add_selection', array('label' => Mage::helper('sales')->__('Add to Selection'), 'url' => $this->getUrl('*/*/massAddToSelection')));
     return $this;
 }
 protected function _addSubscriberToAutomation($email, $subscriber, $websiteId)
 {
     $storeId = $subscriber->getStoreId();
     $store = Mage::app()->getStore($storeId);
     $programId = Mage::helper('ddg')->getAutomationIdByType('XML_PATH_CONNECTOR_AUTOMATION_STUDIO_SUBSCRIBER', $websiteId);
     //not mapped ignore
     if (!$programId) {
         return;
     }
     try {
         //check the subscriber alredy exists
         $enrolmentCollection = Mage::getModel('ddg_automation/automation')->getCollection()->addFieldToFilter('email', $email)->addFieldToFilter('automation_type', Dotdigitalgroup_Email_Model_Automation::AUTOMATION_TYPE_NEW_SUBSCRIBER)->addFieldToFilter('website_id', $websiteId);
         $enrolmentCollection->getSelect()->limit(1);
         $enrolment = $enrolmentCollection->getFirstItem();
         //add new subscriber to automation
         if (!$enrolment->getId()) {
             //save subscriber to the queue
             $automation = Mage::getModel('ddg_automation/automation');
             $automation->setEmail($email)->setAutomationType(Dotdigitalgroup_Email_Model_Automation::AUTOMATION_TYPE_NEW_SUBSCRIBER)->setEnrolmentStatus(Dotdigitalgroup_Email_Model_Automation::AUTOMATION_STATUS_PENDING)->setTypeId($subscriber->getId())->setWebsiteId($websiteId)->setStoreName($store->getName())->setProgramId($programId);
             $automation->save();
         }
     } catch (Exception $e) {
         Mage::logException($e);
     }
 }
Example #24
0
 /**
  * Get layer state key
  *
  * @return string
  */
 public function getStateKey()
 {
     if ($this->_stateKey === null) {
         $this->_stateKey = 'Q_' . Mage::helper('catalogsearch')->getQuery()->getId() . '_' . parent::getStateKey();
     }
     return $this->_stateKey;
 }
Example #25
0
 /**
  * Index action.
  *
  * @return void
  */
 public function indexAction()
 {
     $maxUploadSize = Mage::helper('Mage_ImportExport_Helper_Data')->getMaxUploadSize();
     $this->_getSession()->addNotice($this->__('Total size of uploadable files must not exceed %s', $maxUploadSize));
     $this->_initAction()->_title($this->__('Import'))->_addBreadcrumb($this->__('Import'), $this->__('Import'));
     $this->renderLayout();
 }
Example #26
0
 public function render(Varien_Data_Form_Element_Abstract $element)
 {
     $html = $this->_getHeaderHtml($element);
     $modules = Mage::getConfig()->getNode('modules')->children();
     $linkTitle = Mage::helper('codall')->__('Goto Extension Page');
     foreach ($modules as $moduleName => $values) {
         if (0 !== strpos($moduleName, 'Codnitive_')) {
             continue;
         }
         /*if($moduleName == 'Codnitive_Codall'){
         			continue;
         		}*/
         if ($values->title) {
             $moduleName = (string) $values->title;
         }
         if ($values->link) {
             $link = (string) $values->link;
             $moduleName = "<a href='{$link}' target='_blank' title='{$linkTitle}'>{$moduleName}</a>";
         }
         $field = $element->addField($moduleName, 'label', array('label' => $moduleName, 'value' => (string) $values->version));
         $html .= $field->toHtml();
     }
     $html .= $this->_getFooterHtml($element);
     return $html;
 }
Example #27
0
 /**
  * Preparation of current form
  *
  * @return Inic_Faq_Block_Admin_Edit_Tab_Main Self
  */
 protected function _prepareForm()
 {
     $model = Mage::registry('faq');
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('faq_');
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('faq')->__('General information'), 'class' => 'fieldset-wide'));
     if ($model->getFaqId()) {
         $fieldset->addField('faq_id', 'hidden', array('name' => 'faq_id'));
     }
     $approveInfo = $fieldset->addField('question', 'text', array('name' => 'question', 'label' => Mage::helper('faq')->__('FAQ item question'), 'title' => Mage::helper('faq')->__('FAQ item question'), 'required' => true));
     /**
      * Check is single store mode
      */
     if (!Mage::app()->isSingleStoreMode()) {
         $store_id = $fieldset->addField('store_id', 'multiselect', array('name' => 'store_id[]', 'label' => Mage::helper('faq')->__('Store view'), 'title' => Mage::helper('faq')->__('Store view'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)));
     } else {
         $store_id = $fieldset->addField('store_id', 'hidden', array('name' => 'store_id[]', 'value' => Mage::app()->getStore(true)->getId()));
         $model->setStoreId(Mage::app()->getStore(true)->getId());
     }
     $status = $fieldset->addField('is_active', 'select', array('label' => Mage::helper('faq')->__('Status'), 'title' => Mage::helper('faq')->__('Item status'), 'name' => 'is_active', 'required' => true, 'options' => array('1' => Mage::helper('faq')->__('Enabled'), '0' => Mage::helper('faq')->__('Disabled'))));
     $fieldset->addField('is_most_frequent', 'select', array('label' => Mage::helper('faq')->__('Is Most Frequent'), 'title' => Mage::helper('faq')->__('Is Most Frequent'), 'name' => 'is_most_frequent', 'required' => true, 'options' => array('1' => Mage::helper('faq')->__('Yes'), '0' => Mage::helper('faq')->__('No'))));
     $category_id = $fieldset->addField('category_id', 'multiselect', array('label' => Mage::helper('faq')->__('Category'), 'title' => Mage::helper('faq')->__('Category'), 'name' => 'category_id[]', 'required' => false, 'values' => Mage::getResourceSingleton('faq/category_collection')->toOptionArray()));
     $fieldset->addField('answer', 'editor', array('name' => 'answer', 'label' => Mage::helper('faq')->__('Content'), 'title' => Mage::helper('faq')->__('Content'), 'style' => 'height:36em;', 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(), 'state' => 'html', 'required' => true));
     $data = $model->getData();
     if (!count($data)) {
         $data['store_id'] = 0;
     }
     $form->setValues($data);
     $this->setForm($form);
     $cat_id = $model->getData('category_id');
     $selected = $cat_id ? $cat_id : "";
     $this->setChild('form_after', $this->getLayout()->createBlock('faq/adminhtml_widget_form_element_selectdependence')->addFieldMap($store_id->getHtmlId(), $category_id->getHtmlId(), $selected));
     return parent::_prepareForm();
 }
Example #28
0
 protected function _beforeToHtml()
 {
     $this->addTab('selling', array('label' => Mage::helper('M2ePro')->__('Selling Settings'), 'title' => Mage::helper('M2ePro')->__('Selling Settings'), 'content' => $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_add_tabs_selling')->toHtml()));
     $this->addTab('search', array('label' => Mage::helper('M2ePro')->__('Search Settings'), 'title' => Mage::helper('M2ePro')->__('Search Settings'), 'content' => $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_add_tabs_search')->toHtml()));
     $this->setActiveTab($this->getRequest()->getParam('tab', 'selling'));
     return parent::_beforeToHtml();
 }
 /**
  * Retrieve all options array
  *
  * @return array
  */
 public function getAllOptions()
 {
     if (is_null($this->_options)) {
         $this->_options = array(array("label" => Mage::helper("eav")->__("no_select"), "value" => 0), array("label" => Mage::helper("eav")->__("adult_content"), "value" => 1), array("label" => Mage::helper("eav")->__("coupon"), "value" => 2), array("label" => Mage::helper("eav")->__("default"), "value" => 3), array("label" => Mage::helper("eav")->__("electronic_good"), "value" => 4), array("label" => Mage::helper("eav")->__("electronic_software"), "value" => 5), array("label" => Mage::helper("eav")->__("gift_certificate"), "value" => 6), array("label" => Mage::helper("eav")->__("handling_only"), "value" => 7), array("label" => Mage::helper("eav")->__("service"), "value" => 8), array("label" => Mage::helper("eav")->__("shipping_and_handling"), "value" => 9), array("label" => Mage::helper("eav")->__("shipping_only"), "value" => 10), array("label" => Mage::helper("eav")->__("subscription"), "value" => 11));
     }
     return $this->_options;
 }
Example #30
0
 /**
  * Add payment info block to layout
  *
  * @return Mage_Payment_Block_Info_Container
  */
 protected function _prepareLayout()
 {
     if ($info = $this->getPaymentInfo()) {
         $this->setChild($this->_getInfoBlockName(), Mage::helper('payment')->getInfoBlock($info));
     }
     return parent::_prepareLayout();
 }