protected function _prepareForm() { $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post')); $form->setUseContainer(true); $this->setForm($form); $generalFieldset = $form->addFieldset('aw_hdu3_priority_form', array('legend' => $this->__('General Details'))); $_cfg = array('label' => $this->__('Status'), 'name' => 'status', 'values' => AW_Helpdesk3_Model_Source_Status::toOptionArray()); /** * @var $currentPriority AW_Helpdesk3_Model_Ticket_Priority */ $currentPriority = Mage::registry('current_priority'); if ($currentPriority->getIsSystem()) { $_cfg['note'] = $this->__('System Priority cannot be disabled or deleted'); if ($currentPriority->isEnabled()) { $_cfg['disabled'] = true; } } $generalFieldset->addField('status', 'select', $_cfg); $generalFieldset->addField('font_color', 'text', array('label' => $this->__('Font Color'), 'name' => 'font_color')); $generalFieldset->addField('background_color', 'text', array('label' => $this->__('Background Color'), 'name' => 'background_color')); Varien_Data_Form::setFieldsetElementRenderer($this->getLayout()->createBlock('aw_hdu3/adminhtml_form_fieldset_renderer_labelElement', '', array('label_values' => Mage::registry('current_priority')->getLabelValues()))); $titlesFieldset = $form->addFieldset('aw_hdu3_priority_form_titles', array('legend' => $this->__('Manage Titles'))); $titlesFieldset->addField('id', 'hidden', array('name' => 'id')); $form->setValues(Mage::registry('current_priority')->getData()); return parent::_prepareForm(); }
protected function _prepareMassaction() { $this->setMassactionIdField('statusIds'); $this->getMassactionBlock()->setFormFieldName('statusIds'); $this->getMassactionBlock()->addItem('status', array('label' => $this->__('Change status'), 'url' => $this->getUrl('*/*/massStatus'), 'additional' => array('visibility' => array('name' => 'status', 'type' => 'select', 'class' => 'required-entry', 'label' => $this->__('Status'), 'values' => AW_Helpdesk3_Model_Source_Status::toOptionArray())))); return $this; }
protected function _prepareColumns() { $this->addColumn('id', array('header' => $this->__('ID'), 'align' => 'right', 'width' => '50px', 'index' => 'id')); $this->addColumn('is_active', array('header' => $this->__('Status'), 'align' => 'right', 'width' => '50px', 'index' => 'is_active', 'type' => 'options', 'options' => AW_Helpdesk3_Model_Source_Status::toOptionHash())); $this->addColumn('title', array('header' => $this->__('Title'), 'align' => 'left', 'index' => 'title')); $this->addColumn('store_ids', array('header' => $this->__('Store'), 'align' => 'left', 'index' => 'store_ids', 'type' => 'store', 'sortable' => false, 'renderer' => 'aw_hdu3/adminhtml_widget_grid_renderer_storeIds', 'filter_condition_callback' => array($this, 'filterStore'), 'width' => 200)); $this->addColumn('action', array('header' => $this->__('Action'), 'width' => '100', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => $this->__('Delete'), 'url' => array('base' => '*/*/delete'), 'confirm' => $this->__('Are you sure you want do this?'), 'field' => 'id'), array('caption' => $this->__('Edit'), 'url' => array('base' => '*/*/edit'), 'field' => 'id')), 'filter' => false, 'sortable' => false, 'is_system' => true)); return parent::_prepareColumns(); }
protected function _prepareColumns() { $this->addColumn('id', array('header' => $this->__('ID'), 'align' => 'right', 'width' => '50px', 'index' => 'id')); $this->addColumn('status', array('header' => $this->__('Status'), 'align' => 'left', 'width' => '200px', 'index' => 'status', 'type' => 'options', 'options' => AW_Helpdesk3_Model_Source_Status::toOptionHash())); $this->addColumn('title', array('header' => $this->__('Title'), 'align' => 'left', 'index' => 'title')); $stores = Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(true, true); $stores = array_merge(array('label' => 'Not Visible', 'value' => ''), $stores); $this->addColumn('store_ids', array('header' => $this->__('Visible on'), 'align' => 'left', 'index' => 'store_ids', 'type' => 'store', 'display_not_set' => true, 'store_all' => true, 'empty_stores' => true, 'sortable' => false, 'renderer' => 'aw_hdu3/adminhtml_widget_grid_renderer_storeIds', 'filter' => 'aw_hdu3/adminhtml_widget_grid_filter_storeIds', 'width' => 200, 'options' => $stores)); $this->addColumn('sort_order', array('header' => $this->__('Sort Order'), 'align' => 'right', 'width' => '50px', 'index' => 'sort_order')); $this->addColumn('action', array('header' => $this->__('Action'), 'width' => '100px', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => $this->__('Delete'), 'url' => array('base' => '*/*/delete'), 'confirm' => $this->__('Are you sure you want do this?'), 'field' => 'id', 'type' => 'delete'), array('caption' => $this->__('Edit'), 'url' => array('base' => '*/*/edit'), 'field' => 'id')), 'renderer' => 'aw_hdu3/adminhtml_widget_grid_renderer_departmentActions', 'filter' => false, 'sortable' => false, 'is_system' => true)); return parent::_prepareColumns(); }
protected function _prepareForm() { $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post')); $form->setUseContainer(true); $this->setForm($form); $fieldset = $form->addFieldset('template_details', array('legend' => $this->__('Template details'))); $fieldset->addField('is_active', 'select', array('label' => $this->__('Status'), 'name' => 'is_active', 'values' => AW_Helpdesk3_Model_Source_Status::toOptionArray())); $fieldset->addField('title', 'text', array('label' => $this->__('Title'), 'name' => 'title', 'required' => true)); $fieldset->addField('store_ids', 'multiselect', array('name' => 'store_ids[]', 'label' => $this->__('Store'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true), 'required' => true)); $fieldset->addField('content', 'editor', array('label' => $this->__('Content'), 'name' => 'content', 'style' => 'width:500px; height:400px;', 'config' => $this->_getWysiwygConfig())); $form->setValues(Mage::registry('current_template')->getData()); return parent::_prepareForm(); }
protected function _prepareForm() { $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post')); $form->setUseContainer(true); $this->setForm($form); $fieldset = $form->addFieldset('aw_hdu3_rejecting_pattern_form', array('legend' => $this->__('General Information'))); $fieldset->addField('title', 'text', array('name' => 'title', 'label' => $this->__('Title'), 'required' => true)); $fieldset->addField('is_active', 'select', array('name' => 'is_active', 'label' => $this->__('Status'), 'required' => true, 'values' => AW_Helpdesk3_Model_Source_Status::toOptionArray())); $fieldset->addField('types', 'multiselect', array('name' => 'types', 'label' => $this->__('Scope'), 'required' => true, 'values' => AW_Helpdesk3_Model_Source_Gateway_Mail_RejectPattern::toOptionArray())); $fieldset->addField('pattern', 'text', array('name' => 'pattern', 'label' => $this->__('Pattern'), 'required' => true)); $form->setValues(Mage::registry('current_pattern')->getData()); return parent::_prepareForm(); }
protected function _initForm() { $form = new Varien_Data_Form(); $fieldset = $form->addFieldset('aw_hdu3_department_general_form', array('legend' => $this->__('Department Details'))); $_cfg = array('label' => $this->__('Status'), 'name' => 'status', 'values' => AW_Helpdesk3_Model_Source_Status::toOptionArray()); /** * @var $currentDepartment AW_Helpdesk3_Model_Department */ $currentDepartment = Mage::registry('current_department'); if ($currentDepartment->isPrimary()) { $_cfg['note'] = $this->__('Primary Department cannot be disabled or deleted'); if ($currentDepartment->isEnabled()) { $_cfg['disabled'] = true; } } $fieldset->addField('status', 'select', $_cfg); $fieldset->addField('store_ids', 'multiselect', array('name' => 'store_ids[]', 'label' => $this->__('Visible on'), 'image' => $this->getSkinUrl('images/grid-cal.gif'), 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true))); $fieldset->addField('title', 'text', array('label' => $this->__('Title'), 'name' => 'title', 'required' => true)); $fieldset->addField('sort_order', 'text', array('label' => $this->__('Sort Order'), 'name' => 'sort_order')); $form->setValues(Mage::registry('current_department')->getData()); $this->setForm($form); }