public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'creationdate', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Date'), 'title' => $translate->_('eg: 01/11/2010'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'expiringdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'title' => $translate->_('eg: 01/11/2011'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'paymentdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Payment Date'), 'title' => $translate->_('eg: 01/11/2010'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('select', 'category_id', array('label' => $translate->_('Category'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('category_id')->setAllowEmpty(false)->setMultiOptions(PurchaseCategories::getList()); $this->addElement('select', 'method_id', array('label' => $translate->_('Payment Method'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('method_id')->setAllowEmpty(false)->setMultiOptions(PaymentsMethods::getList()); $this->addElement('text', 'number', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company'), 'required' => true, 'title' => $translate->_('eg: Google inc.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'total_net', array('filters' => array('StringTrim'), 'label' => $translate->_('Total Net'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'total_vat', array('filters' => array('StringTrim'), 'label' => $translate->_('Total VAT'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'total', array('filters' => array('StringTrim'), 'label' => $translate->_('Total'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Note'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control')); // If the browser client is an Apple client hide the file upload html object if (false == Shineisp_Commons_Utilities::isAppleClient()) { $MBlimit = Settings::findbyParam('adminuploadlimit'); $Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit); $filetypes = Settings::findbyParam('adminuploadfiletypes', 'Admin'); $file = $this->createElement('file', 'document', array('label' => $translate->_('Document'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $filetypes, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle')); $file->addValidator('Extension', false, $filetypes)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1); $file->setValueDisabled(true); $file->setRequired(false); $this->addElement($file); } $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders')); $this->addElement('hidden', 'purchase_id'); }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'quantity', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Quantity'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'setupfee', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup fees'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'discount', array('filters' => array('StringTrim'), 'label' => $translate->_('Discount'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'cost', array('filters' => array('StringTrim'), 'label' => $translate->_('Cost'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'product_id', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Products'), 'class' => 'form-control')); $this->getElement('product_id')->setAllowEmpty(false)->setMultiOptions(Products::getList(true)); $this->addElement('text', 'price', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Price'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'billing_cycle_id', array('label' => $translate->_('Billing Cycle'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('billing_cycle_id')->setAllowEmpty(false)->setMultiOptions(BillingCycle::getList(true)); $this->addElement('text', 'date_start', array('filters' => array('StringTrim'), 'label' => $translate->_('Start Date'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'date_end', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'decorators' => array('Bootstrap'), 'rows' => 5, 'class' => 'form-control')); $this->addElement('textarea', 'parameters', array('filters' => array('StringTrim'), 'label' => $translate->_('Service Panel Configuration'), 'decorators' => array('Bootstrap'), 'rows' => 5, 'description' => $translate->_('Parameters model accepted: {"domain":{"name":"domain.com","tld":"2","action":"renewDomain","authcode":null}}'), 'class' => 'form-control')); $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders')); $this->addElement('select', 'autorenew', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Auto Renewal'), 'class' => 'form-control', 'multioptions' => array(0 => 'NO', 1 => 'YES'))); $this->addElement('multiselect', 'domains', array('label' => $translate->_('Available Domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control tmpitems')); $this->getElement('domains')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList()); $this->addElement('multiselect', 'domains_selected', array('label' => $translate->_('Selected domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control items')); $this->getElement('domains_selected')->setRegisterInArrayValidator(false); // Disable the Validator in order to manage a dynamic list. $this->addElement('hidden', 'detail_id'); }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('gender')->setAllowEmpty(true)->setMultiOptions(array('M' => $translate->translate('Man'), 'F' => $translate->translate('Female'))); $this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date')); $this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth district'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('type_id')->setAllowEmpty(true)->setMultiOptions(CompanyTypes::getList(true)); $this->addElement('select', 'legalform_id', array('label' => 'Legal form', 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('legalform_id')->setAllowEmpty(true)->setMultiOptions(Legalforms::getList()); $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Taxpayer Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'address', array('filters' => array('StringTrim'), 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'zip', array('filters' => array('StringTrim'), 'label' => $translate->_('Zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'city', array('filters' => array('StringTrim'), 'label' => $translate->_('City'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeCountry( this );')); $this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList(true)); $this->addElement('text', 'phone', array('filters' => array('StringTrim'), 'label' => $translate->_('Phone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'fax', array('filters' => array('StringTrim'), 'label' => $translate->_('Fax'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control')); $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('customers')); $this->addElement('submit', 'submit', array('label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg')); $this->addElement('hidden', 'profile_id'); }
/** * create the configuration of the grid */ public static function grid($rowNum = 10) { $translator = Shineisp_Registry::getInstance()->Zend_Translate; $config['datagrid']['columns'][] = array('label' => null, 'field' => 'dp.profile_id', 'alias' => 'profile_id', 'type' => 'selectall'); $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'dp.profile_id', 'alias' => 'profile_id', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Owner'), 'field' => "CONCAT(c.lastname, ' ', c.firstname)", 'alias' => 'owner', 'sortable' => true, 'searchable' => true, 'type' => 'link', 'link' => array('idx' => 'customer_id', 'href' => '/admin/customers/edit/id/%s')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Company'), 'field' => 'dp.company', 'alias' => 'company', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Full name'), 'field' => 'CONCAT(dp.firstname, " ", dp.lastname)', 'alias' => 'fullname', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Email'), 'field' => 'dp.email', 'alias' => 'email', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Statuses'), 'field' => 's.status', 'alias' => 'status', 'sortable' => true, 'type' => 'index', 'searchable' => true, 'filterdata' => Statuses::getList('customers'), 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['fields'] = "dp.profile_id,\n\t\t\t\t\t\t\t\t\t\t dp.company as company,\n\t\t\t\t\t\t\t\t\t\t CONCAT(c.lastname, ' ', c.firstname) as owner,\n\t\t\t\t\t\t\t\t\t\t c.customer_id as customer_id,\n\t\t\t\t\t\t\t\t\t\t CONCAT(dp.firstname, ' ', dp.lastname) as fullname,\n\t\t\t\t\t\t\t\t\t\t dp.email as email,\n\t\t\t\t\t\t\t\t\t\t s.status as status"; $config['datagrid']['rownum'] = $rowNum; $dq = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('DomainsProfiles dp')->leftJoin('dp.Statuses s')->leftJoin('dp.Customers c'); $config['datagrid']['dqrecordset'] = $dq; $config['datagrid']['basepath'] = "/admin/domainsprofiles/"; $config['datagrid']['index'] = "profile_id"; $config['datagrid']['rowlist'] = array('10', '50', '100', '1000'); $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit'); $config['datagrid']['buttons']['edit']['cssicon'] = "edit"; $config['datagrid']['buttons']['edit']['action'] = "/admin/domainsprofiles/edit/id/%d"; $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete'); $config['datagrid']['buttons']['delete']['cssicon'] = "delete"; $config['datagrid']['buttons']['delete']['action'] = "/admin/domainsprofiles/confirm/id/%d"; $config['datagrid']['massactions']['common'] = array(); return $config; }
public static function grid($rowNum = 10) { $translator = Shineisp_Registry::getInstance()->Zend_Translate; $config['datagrid']['columns'][] = array('label' => null, 'field' => 't.ticket_id', 'alias' => 'ticket_id', 'type' => 'selectall'); $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 't.ticket_id', 'alias' => 'ticket_id', 'sortable' => true, 'direction' => 'desc', 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Creation date'), 'field' => 't.date_open', 'alias' => 'creation_date', 'sortable' => true, 'direction' => 'desc', 'searchable' => true, 'type' => 'date', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Update Date'), 'field' => 't.date_updated', 'alias' => 'updated_at', 'sortable' => true, 'direction' => 'desc', 'searchable' => true, 'type' => 'date', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Category'), 'field' => 'tc.category', 'alias' => 'category', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Subject'), 'field' => 't.subject', 'alias' => 'subject', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Company'), 'field' => "c.company", 'alias' => 'company', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Fullname'), 'field' => "CONCAT(c.firstname, ' ', c.lastname)", 'alias' => 'customer', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Status'), 'field' => 's.status', 'alias' => 'status', 'type' => 'index', 'sortable' => true, 'searchable' => true); $config['datagrid']['columns'][] = array('label' => $translator->translate('Replies'), 'field' => '', 'alias' => 'replies', 'type' => 'index', 'searchable' => false, 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Attachments'), 'field' => '', 'alias' => 'files', 'type' => 'index', 'searchable' => false, 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['fields'] = "t.ticket_id,\n\t\t\t\t\t\t\t\t\t\t\tt.subject as subject, \n\t\t\t\t\t\t\t\t\t\t\tt.category_id as category_id,\n\t\t\t\t\t\t\t\t\t\t\ttc.category as category, \n\t\t\t\t\t\t\t\t\t\t\ts.status as status, \n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(t.date_open, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i') as creation_date, \n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(t.date_updated, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i') as updated_at, \n\t\t\t\t\t\t\t\t\t\t\tCONCAT(c.firstname, ' ', c.lastname) as customer,\n\t\t\t\t\t\t\t\t\t\t\tc.company as company"; $dq = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('Tickets t')->leftJoin('t.TicketsCategories tc')->leftJoin('t.Customers c')->leftJoin('t.Statuses s')->addWhere("c.isp_id = ?", Isp::getCurrentId())->orderBy('ticket_id desc'); $dq->addSelect('( SELECT COUNT( * ) FROM TicketsNotes tn WHERE tn.ticket_id = t.ticket_id) as replies'); $dq->addSelect('( SELECT COUNT( * ) FROM Files f WHERE f.id = t.ticket_id) as files'); $config['datagrid']['dqrecordset'] = $dq; $config['datagrid']['rownum'] = $rowNum; $config['datagrid']['basepath'] = "/admin/tickets/"; $config['datagrid']['rowlist'] = array('10', '50', '100', '1000'); $config['datagrid']['massactions']['common'] = array('bulkexport' => 'Export', 'massdelete' => 'Delete'); $statuses = Statuses::getList('tickets'); if (!empty($statuses)) { $customacts = array(); } foreach ($statuses as $key => $value) { $customacts['bulk_set_status&status=' . $key] = "Set as {$value}"; } $config['datagrid']['massactions']['status'] = $customacts; return $config; }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('select', 'isp_id', array('label' => $translate->_('Isp'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('isp_id')->setAllowEmpty(false)->setMultiOptions(Isp::getList())->setRequired(true); $this->addElement('select', 'type_id', array('label' => $translate->_('Server Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('type_id')->setAllowEmpty(false)->setMultiOptions(Servers_Types::getList())->setRequired(true); $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('servers'))->setRequired(true); $this->addElement('text', 'name', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Server Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'ip', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('IP'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'netmask', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Netmask'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'host', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Host'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'domain', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Domain'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('textarea', 'description', array('required' => true, 'label' => $translate->_('Description'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control')); $this->addElement('select', 'panel_id', array('filters' => array('StringTrim'), 'label' => $translate->_('Control Panel'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('panel_id')->setAllowEmpty(false)->setMultiOptions(Panels::getListInstalled(true)); $this->addElement('text', 'datacenter', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Datacenter'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'cost', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Server cost'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'max_accounts', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Max accounts'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'buy_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Buy Date'), 'description' => $translate->_('Purchase date of this server'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date')); $this->addElement('checkbox', 'is_default', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Default server'), 'description' => $translate->_('Default server for the group'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('hidden', 'server_id'); }
/** * grid * create the configuration of the grid */ public static function grid($rowNum = 10) { $translator = Shineisp_Registry::getInstance()->Zend_Translate; $config['datagrid']['columns'][] = array('label' => null, 'field' => 'c.customer_id', 'alias' => 'customer_id', 'type' => 'selectall'); $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'c.customer_id', 'alias' => 'customer_id', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Company'), 'field' => 'c.company', 'alias' => 'company', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Full name'), 'field' => 'CONCAT(c.firstname, " ", c.lastname)', 'alias' => 'fullname', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Email'), 'field' => 'c.email', 'alias' => 'email', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Statuses'), 'field' => 's.status', 'alias' => 'status', 'sortable' => true, 'type' => 'index', 'searchable' => true, 'filterdata' => Statuses::getList('customers'), 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['fields'] = "c.customer_id, \n\t\t\t\t\t\t\t\t\t\t c.company as company, \n\t\t\t\t\t\t\t\t\t\t CONCAT(c.firstname, ' ', c.lastname) as fullname, \n\t\t\t\t\t\t\t\t\t\t c.email as email, \n\t\t\t\t\t\t\t\t\t\t s.status as status"; $config['datagrid']['rownum'] = $rowNum; $dq = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('Customers c')->leftJoin('c.Statuses s')->addWhere("c.isp_id = ?", Isp::getCurrentId()); $config['datagrid']['dqrecordset'] = $dq; $config['datagrid']['basepath'] = "/admin/customers/"; $config['datagrid']['index'] = "customer_id"; $config['datagrid']['rowlist'] = array('10', '50', '100', '1000'); $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit'); $config['datagrid']['buttons']['edit']['cssicon'] = "edit"; $config['datagrid']['buttons']['edit']['action'] = "/admin/customers/edit/id/%d"; $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete'); $config['datagrid']['buttons']['delete']['cssicon'] = "delete"; $config['datagrid']['buttons']['delete']['action'] = "/admin/customers/confirm/id/%d"; $config['datagrid']['massactions']['common'] = array('bulk_export' => 'Export PDF Customers List', 'bulk_excel' => 'Export EXCEL Customers List', 'bulk_xml' => 'Export XML Customers List', 'bulk_reset_password' => 'Reset password and send welcome mail', 'bulk_add_to_newsletter' => 'Add to the newsletter'); $statuses = Statuses::getList('customers'); if (!empty($statuses)) { $customacts = array(); } foreach ($statuses as $key => $value) { $customacts['bulk_set_status&status=' . $key] = "Set as {$value}"; } $config['datagrid']['massactions']['status'] = $customacts; return $config; }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'date_start', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Creation date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'date_end', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'quantity', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Quantity'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'label' => $translate->_('Message'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg')); $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Note'), 'description' => $translate->_('Write here a note. An email will be sent to the ISP staff.'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg')); $this->addElement('textarea', 'setup', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup Configuration'), 'description' => $translate->_('Here you can read the service configuration written by the ISP modules. These information are read-only.'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12')); $this->addElement('select', 'order_id', array('label' => $translate->_('Orders'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('order_id')->setAllowEmpty(false)->setMultiOptions(Orders::getList(true)); $this->addElement('multiselect', 'domains', array('label' => $translate->_('Available domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control col-lg-12 tmpitems')); $this->getElement('domains')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList()); $this->addElement('multiselect', 'domains_selected', array('label' => $translate->_('Selected domains'), 'decorators' => array('Bootstrap'), 'class' => 'form-control col-lg-12 items')); $this->getElement('domains_selected')->setRegisterInArrayValidator(false); // Disable the Validator in order to manage a dynamic list. $this->addElement('select', 'product_id', array('label' => $translate->_('Products'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('product_id')->setAllowEmpty(false)->setMultiOptions(Products::getList(true)); $this->addElement('select', 'billing_cycle_id', array('label' => $translate->_('Billing Cycle'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('billing_cycle_id')->setAllowEmpty(false)->setMultiOptions(BillingCycle::getList(true)); $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders', false, true)); $this->addElement('select', 'autorenew', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Auto Renewal'), 'description' => $translate->_('Enable or disable the automatic renewal of the service'), 'class' => 'form-control')); $this->getElement('autorenew')->setAllowEmpty(false)->setMultiOptions(array('1' => $translate->_('Yes, I would like to renew the service at the expiration date.'), '0' => $translate->_('No, I am not interested in the service renew.'))); $this->addElement('hidden', 'detail_id'); }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'action', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Action'), 'class' => 'form-control')); $this->addElement('text', 'start', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Start Date'), 'class' => 'form-control date')); $this->addElement('text', 'end', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('End Date'), 'class' => 'form-control date')); $this->addElement('textarea', 'log', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Log'), 'class' => 'form-control')); $this->addElement('textarea', 'parameters', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Parameters'), 'description' => $translate->_('Json encoded attribute parameters'), 'rows' => '5', 'class' => 'form-control')); $this->addElement('select', 'panel_id', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Panel'), 'class' => 'form-control')); $this->getElement('panel_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Panels::getList()); $this->addElement('select', 'status_id', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Status'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Statuses::getList('domains')); $this->addElement('hidden', 'action_id'); }
/** * grid * create the configuration of the grid */ public static function grid($rowNum = 10) { $translator = Shineisp_Registry::getInstance()->Zend_Translate; $config['datagrid']['columns'][] = array('label' => null, 'field' => 'd.domain_id', 'alias' => 'domain_id', 'type' => 'selectall'); $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'd.domain_id', 'alias' => 'domain_id', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Domain'), 'field' => 'd.domain', 'alias' => 'domain', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('TLD'), 'field' => 'ws.tld', 'alias' => 'tld', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Renewal'), 'field' => 'd.autorenew', 'alias' => 'autorenew', 'sortable' => true, 'searchable' => true, 'type' => 'boolean', 'attributes' => array('class' => "visible-lg visible-md hidden-xs")); $config['datagrid']['columns'][] = array('label' => $translator->translate('Creation date'), 'field' => 'creation_date', 'alias' => 'creation_date', 'sortable' => true, 'searchable' => true, 'type' => 'date', 'attributes' => array('class' => "visible-lg visible-md hidden-xs")); $config['datagrid']['columns'][] = array('label' => $translator->translate('Expiry Date'), 'field' => 'expiring_date', 'alias' => 'expiring_date', 'sortable' => true, 'searchable' => true, 'type' => 'date', 'attributes' => array('class' => "visible-lg visible-md hidden-xs")); $config['datagrid']['columns'][] = array('label' => $translator->translate('Days left'), 'field' => 'daysleft', 'alias' => 'daysleft', 'sortable' => true, 'type' => 'string', 'attributes' => array('class' => "visible-lg visible-md hidden-xs")); $config['datagrid']['columns'][] = array('label' => $translator->translate('Last Name'), 'field' => 'c.lastname', 'alias' => 'lastname', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => "visible-lg visible-md hidden-xs span1")); $config['datagrid']['columns'][] = array('label' => $translator->translate('Registrar'), 'field' => 'r.name', 'alias' => 'registrar', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => "visible-lg visible-md hidden-xs")); $config['datagrid']['columns'][] = array('label' => $translator->translate('Status'), 'field' => 's.status', 'alias' => 'status', 'sortable' => true, 'type' => 'index', 'searchable' => true, 'filterdata' => Statuses::getList('domains')); $config['datagrid']['fields'] = "d.domain_id, \r\n\t\t\t\t\t\t\t\t\t\t\tCONCAT(d.domain, '.', ws.tld) as domain, \r\n\t\t\t\t\t\t\t\t\t\t\td.autorenew as autorenew, \r\n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(creation_date, '" . Settings::getMySQLDateFormat('dateformat') . "') as creation_date, \r\n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(expiring_date, '" . Settings::getMySQLDateFormat('dateformat') . "') as expiring_date, \r\n\t\t\t\t\t\t\t\t\t\t\tDATEDIFF(expiring_date, CURRENT_DATE) as daysleft, \r\n\t\t\t\t\t\t\t\t\t\t\tr.name as registrar, \r\n\t\t\t\t\t\t\t\t\t\t\tws.tld as tld, \r\n\t\t\t\t\t\t\t\t\t\t\ts.status as status, \r\n\t\t\t\t\t\t\t\t\t\t\tc.lastname as lastname"; $dq = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('Domains d')->leftJoin('d.DomainsTlds dt')->leftJoin('dt.WhoisServers ws')->leftJoin('d.TagsConnections tc')->leftJoin('d.Customers c')->leftJoin('d.OrdersItems oi')->leftJoin('d.Registrars r')->leftJoin('d.Statuses s')->orderBy('d.domain')->addWhere("c.isp_id = ?", Isp::getCurrentId()); $config['datagrid']['dqrecordset'] = $dq; $config['datagrid']['rowlist'] = array('10', '50', '100', '1000'); $config['datagrid']['index'] = "domain_id"; // Automatic Renewal function $massactions['bulk_set_autorenew&status=1'] = "Enable Automatic Renewal"; $massactions['bulk_set_autorenew&status=0'] = "Disable Automatic Renewal"; $massactions['bulk_delete'] = 'Mass Delete'; $massactions['bulk_export'] = 'Export Domain Listing'; $massactions['bulk_check_dns'] = 'Check DNS Zone'; $config['datagrid']['massactions']['common'] = $massactions; $statuses = Statuses::getList('domains'); if (!empty($statuses)) { $customacts = array(); } foreach ($statuses as $key => $value) { $customacts['bulk_set_status&status=' . $key] = "Set as {$value}"; } $config['datagrid']['massactions']['statuses'] = $customacts; $actions = Registrars::getActions(); if (!empty($actions)) { $customacts = array(); } foreach ($actions as $registrar => $tasks) { foreach ($tasks as $action => $label) { $customacts['bulk_registrar_tasks&task=' . $action] = $translator->_('%s registrar task: %s', $registrar, $label); } } $config['datagrid']['massactions']['registrars'] = $customacts; return $config; }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'action', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Action'), 'class' => 'form-control')); $this->addElement('text', 'startdate', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Start'), 'class' => 'form-control')); $this->addElement('text', 'enddate', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('End'), 'class' => 'form-control')); $this->addElement('textarea', 'log', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Log'), 'class' => 'form-control')); $this->addElement('select', 'status_id', array('required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Status'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Statuses::getList('domains_tasks')); $this->addElement('select', 'domain_id', array('required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Domain'), 'class' => 'form-control')); $this->getElement('domain_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList()); $this->addElement('select', 'registrars_id', array('required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Registrar'), 'class' => 'form-control')); $this->getElement('registrars_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Registrars::getList()); $this->addElement('hidden', 'task_id'); }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subject'), 'class' => 'form-control')); $this->addElement('text', 'datetime', array('filters' => array('StringTrim'), 'label' => $translate->_('Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'class' => 'col-lg-12 form-control wysiwyg')); $this->addElement('select', 'sendemail', array('label' => $translate->_('Send Email'), 'description' => $translate->_('Send an email to the customer.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('1' => $translate->_('Yes'), '0' => $translate->_('No')))); $this->addElement('select', 'category_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'class' => 'form-control')); $this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList()); $this->addElement('select', 'customer_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Customer'), 'class' => 'form-control')); $this->getElement('customer_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Customers::getList()); $this->addElement('select', 'category', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'class' => 'form-control')); $this->getElement('category')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList()); $this->addElement('select', 'order_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Order reference'), 'class' => 'form-control')); $this->getElement('order_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Orders::getList(true)); $this->addElement('select', 'sibling_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Relationships'), 'class' => 'form-control')); $this->getElement('sibling_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false); $this->addElement('select', 'user_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Operator'), 'class' => 'form-control')); $this->getElement('user_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(AdminUser::getList()); #->setMultiOptions(AdminUser::getUserbyRoleID(AdminRoles::getIdRoleByName('operator'))); $this->addElement('select', 'status_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Status'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Statuses::getList('tickets')); // If the browser client is an Apple client hide the file upload html object if (false == Shineisp_Commons_Utilities::isAppleClient()) { $MBlimit = Settings::findbyParam('adminuploadlimit'); $Types = Settings::findbyParam('adminuploadfiletypes', 'Admin'); if (empty($MBlimit)) { $MBlimit = 1; } if (empty($Types)) { $Types = "zip,jpg"; } $Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit); $file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $Types, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle')); $file->addValidator('Extension', false, $Types)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1); $this->addElement($file); } else { $this->addElement('hidden', 'attachments'); } $this->addElement('hidden', 'ticket_id'); }
/** * grid * create the configuration of the grid */ public static function grid($rowNum = 10) { $ns = new Zend_Session_Namespace(); $translator = Shineisp_Registry::getInstance()->Zend_Translate; $config['datagrid']['columns'][] = array('label' => null, 'field' => 'd.detail_id', 'alias' => 'id', 'type' => 'selectall'); $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'd.detail_id', 'alias' => 'id', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Order ID'), 'field' => 'o.order_id', 'alias' => 'order_id', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Type'), 'field' => 'p.type', 'alias' => 'type', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Service'), 'field' => 'pd.name', 'alias' => 'productname', 'sortable' => true, 'searchable' => true, 'type' => 'link', 'link' => array('idx' => 'product_id', 'href' => '/admin/products/edit/id/%s')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Domain'), 'field' => 'dm.domain', 'alias' => 'domain', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Company'), 'field' => 'c.company', 'alias' => 'company', 'sortable' => true, 'searchable' => true, 'type' => 'link', 'link' => array('idx' => 'customer_id', 'href' => '/admin/customers/edit/id/%s'), 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Last name'), 'field' => 'c.lastname', 'alias' => 'lastname', 'sortable' => true, 'searchable' => true, 'type' => 'link', 'link' => array('idx' => 'customer_id', 'href' => '/admin/customers/edit/id/%s'), 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Days left'), 'field' => 'd.date_end', 'alias' => 'daysleft', 'sortable' => true, 'searchable' => false, 'type' => 'integer', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Start date'), 'field' => 'd.date_start', 'alias' => 'date_start', 'sortable' => true, 'searchable' => true, 'type' => 'date', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('End date'), 'field' => 'd.date_end', 'alias' => 'date_end', 'sortable' => true, 'searchable' => true, 'type' => 'date', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['columns'][] = array('label' => $translator->translate('Statuses'), 'field' => 's.status', 'filterdata' => Statuses::getList('services'), 'type' => 'index', 'alias' => 'status', 'sortable' => true, 'searchable' => true, 'attributes' => array('class' => 'visible-lg visible-md hidden-xs')); $config['datagrid']['fields'] = "d.detail_id as id,\n\t\t\t\t\t\t\t\t\t\t\to.order_number as order_id, \n\t\t\t\t\t\t\t\t\t\t\tp.product_id as product_id, \n\t\t\t\t\t\t\t\t\t\t\tc.customer_id as customer_id, \n\t\t\t\t\t\t\t\t\t\t\tc.company as company, \n\t\t\t\t\t\t\t\t\t\t\tc.lastname as lastname,\n\t\t\t\t\t\t\t\t\t\t\td.order_id, \n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(d.date_start, '" . Settings::getMySQLDateFormat('dateformat') . "') as date_start, \n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(d.date_end, '" . Settings::getMySQLDateFormat('dateformat') . "') as date_end, \n\t\t\t\t\t\t\t\t\t\t\tpd.name as productname, \n\t\t\t\t\t\t\t\t\t\t\tp.type as type, \n\t\t\t\t\t\t\t\t\t\t\ts.status as status, \n\t\t\t\t\t\t\t\t\t\t\toid.relationship_id as oid,\n\t\t\t\t\t\t\t\t\t\t\tdm.domain_id as domain_id,\n\t\t\t\t\t\t\t\t\t\t\tDATEDIFF(d.date_end, CURRENT_DATE) as daysleft, \n\t\t\t\t\t\t\t\t\t\t\tCONCAT(dm.domain, '.', ws.tld ) as domain,\n\t\t\t\t\t\t\t\t\t\t\tbc.name as cycle"; $config['datagrid']['rownum'] = $rowNum; $dq = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('OrdersItems d')->leftJoin('d.Orders o')->leftJoin('d.OrdersItemsDomains oid ON d.detail_id = oid.orderitem_id')->leftJoin('d.BillingCycle bc')->leftJoin('oid.Domains dm')->leftJoin('dm.DomainsTlds dt')->leftJoin('dt.WhoisServers ws')->leftJoin('d.Products p')->leftJoin("p.ProductsData pd WITH pd.language_id = {$ns->idlang}")->leftJoin('p.Taxes t')->leftJoin('o.Customers c')->leftJoin('d.Statuses s')->where('p.type <> ?', 'domain')->andWhere('o.isp_id = ?', Shineisp_Registry::get('ISP')->isp_id); $config['datagrid']['dqrecordset'] = $dq; $config['datagrid']['basepath'] = "/admin/services/"; $config['datagrid']['index'] = "detail_id"; $config['datagrid']['rowlist'] = array('10', '50', '100', '1000'); $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit'); $config['datagrid']['buttons']['edit']['cssicon'] = "edit"; $config['datagrid']['buttons']['edit']['action'] = "/admin/services/edit/id/%d"; $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete'); $config['datagrid']['buttons']['delete']['cssicon'] = "delete"; $config['datagrid']['buttons']['delete']['action'] = "/admin/services/delete/id/%d"; $config['datagrid']['massactions']['common'] = array('massdelete' => 'Mass Delete', 'bulkexport' => 'Export'); $customacts = array(); $actions = Panels::getActions(); if (!empty($actions)) { foreach ($actions as $registrar => $tasks) { foreach ($tasks as $action => $label) { $customacts['bulk_registrar_tasks&task=' . $action] = $translator->_('%s registrar task: %s', $registrar, $label); } } } $config['datagrid']['massactions']['panels'] = $customacts; return $config; }
public function listAction() { $NS = new Zend_Session_Namespace('Default'); $form = $this->getRequest()->getParams(); $arrSort = array(); $params = array(); $page = $this->getRequest()->getParam('page'); $sort = $this->getRequest()->getParam('sort'); if (!empty($sort)) { $arrSort[] = $this->SortingData($sort); $arrSort[] = $sort; } else { $arrSort[] = "status_id asc, DATEDIFF(expiring_date, CURRENT_DATE) asc"; } if (!empty($NS->search_domains)) { $params = array_merge($params, $NS->search_domains); $this->view->searchactive = 1; } else { $this->view->searchactive = 0; // $params ['search'] ['status_id'] ['method'] = "andWhere"; // $params ['search'] ['status_id'] ['criteria'] = "d.status_id <> ? AND d.status_id <> ?"; // $params ['search'] ['status_id'] ['value'] = array(Statuses::id('suspended', 'domains'), Statuses::id('expired', 'domains')); // Do not show the expired domain as default } $params['search'][] = array('method' => 'andWhere', 'criteria' => "(c.customer_id = ? OR c.parent_id = ?)", 'value' => array($NS->customer['customer_id'], $NS->customer['customer_id'])); if (isset($form['domain'])) { $params['search'][] = array('method' => 'andWhere', 'criteria' => 'd.domain like ?', 'value' => '%' . $form['domain'] . '%'); } $page = !empty($page) && is_numeric($page) ? $page : 1; $data = $this->domains->findAll("d.domain_id, \n\t\t\t\t\t\t\t CONCAT(d.domain, '.', ws.tld) as domain,\n\t\t\t\t\t\t\t DATE_FORMAT(d.expiring_date, '%d/%m/%Y') as endingdate, \n\t\t\t\t\t\t\t DATEDIFF(expiring_date, CURRENT_DATE) as days,\n\t\t\t\t\t\t\t s.status_id as status_id, s.status as status,\n\t\t\t\t\t\t\t d.autorenew as renew", $page, $NS->recordsperpage, $arrSort, $params['search']); $data['tags'] = Tags::getList($this->customer['customer_id']); $data['currentpage'] = $page; // Get all the status of the domains in order to fill the batch list $data['statuses'] = Statuses::getList('domains', true); $data['show_action_box'] = false; // This hide the status/action select box from the grid. $this->view->mex = $this->getRequest()->getParam('mex'); $this->view->mexstatus = $this->getRequest()->getParam('status'); $this->view->title = $this->translator->translate("Domain Listing"); $this->view->description = $this->translator->translate("Here you can see all the list of your domains."); $this->view->domains = $data; }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'domain', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Domain'), 'description' => $translate->_('Write down the name of the domain without any extension, white spaces, or symbols.'), 'class' => 'form-control updatechkdomain')); $this->addElement('select', 'tld_id', array('label' => $translate->_('TLD'), 'description' => $translate->_('Select the TLD from the list'), 'decorators' => array('Bootstrap'), 'class' => 'form-control updatechkdomain')); $this->getElement('tld_id')->setAllowEmpty(false)->setMultiOptions(DomainsTlds::getList())->setRequired(true); $this->addElement('select', 'registrars_id', array('label' => $translate->_('Registrar'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('registrars_id')->setAllowEmpty(true)->setMultiOptions(Registrars::getList()); // Domain Ownership $this->addElement('select', 'owner', array('label' => $translate->_('Owner'), 'description' => $translate->_("If the domain owner's profile is not set, the domain customer information will be used."), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('owner')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true)); $this->addElement('select', 'admin', array('label' => $translate->_('Admin-C'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('admin')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true)); $this->addElement('select', 'tech', array('label' => $translate->_('Tech'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('tech')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true)); $this->addElement('select', 'billing', array('label' => $translate->_('Billing'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('billing')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true)); $this->addElement('text', 'creation_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Creation date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'expiring_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'authinfocode', array('filters' => array('StringTrim'), 'label' => $translate->_('AUTHINFO CODE'), 'description' => $translate->_('Write down the Authinfo code in order to transfer the domain to this ISP'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('checkbox', 'autorenew', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Auto renewal'), 'class' => 'form-control')); $this->addElement('select', 'customer_id', array('label' => $translate->_('Customer'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('customer_id')->setAllowEmpty(false)->setMultiOptions(Customers::getList())->setRequired(true); // $note = $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Private Notes'), 'class' => 'col-lg-12 form-control')); $note = $this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Message'), 'class' => 'col-lg-12 form-control wysiwyg')); $status = $this->addElement('select', 'status_id', array('label' => 'Status', 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); // DNS SECTION // ============== $this->addElement('text', 'subdomain', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subdomain'), 'class' => 'form-control')); $this->addElement('text', 'target', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Target'), 'class' => 'form-control')); $this->addElement('select', 'zone', array('label' => $translate->_('Zone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('zone')->setAllowEmpty(false)->setMultiOptions(Dns_Zones_Types::getZones()); $status = $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('domains')); $save = $this->addElement('submit', 'save', array('required' => false, 'label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn')); $id = $this->addElement('hidden', 'domain_id'); }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'rows' => 5, 'description' => $translate->_('Write here a message for the administrator about this domain.'), 'class' => 'form-control')); $this->addElement('text', 'tags', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Tags'), 'class' => 'form-control large-input tags')); $this->addElement('text', 'authinfocode', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Authinfo'), 'class' => 'form-control medium-input')); $this->addElement('select', 'autorenew', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Autorenew'), 'description' => $translate->_('By default, every domain is set with auto-renew option enabled. Choose if the domain must be auto-renew or not at the expiring date.'), 'class' => 'form-control large-input')); $this->getElement('autorenew')->setAllowEmpty(false)->setMultiOptions(array('1' => $translate->_('Yes, I would like to renew the domain at the expiration date.'), '0' => $translate->_('No, I am not interested in the renew.'))); $status = $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input')); $status = $this->getElement('status_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Statuses::getList('domains')); $this->addElement('submit', 'submit', array('label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg')); // Adding a subform $dnsform = new Zend_Form_SubForm(); // Set the decorator $dnsform->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $dnsform->addElement('text', 'subdomain', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subdomain'), 'class' => 'form-control medium-input')); $dnsform->addElement('select', 'zones', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('DNS Type Zone'), 'class' => 'form-control large-input')); $dnsform->getElement('zones')->setAllowEmpty(false)->setMultiOptions(Dns_Zones_Types::getZones()); $dnsform->addElement('text', 'target', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Target Address'), 'class' => 'form-control large-input')); $this->addSubForm($dnsform, 'dnsform'); $id = $this->addElement('hidden', 'domain_id'); }
/** * create the configuration of the grid */ public static function grid($rowNum = 10) { $translator = Shineisp_Registry::getInstance()->Zend_Translate; $config['datagrid']['columns'][] = array('label' => null, 'field' => 'dt.task_id', 'alias' => 'task_id', 'type' => 'selectall'); $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'dt.task_id', 'alias' => 'task_id', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Action'), 'field' => 'dt.action', 'alias' => 'action', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Domain'), 'field' => 'd.domain', 'alias' => 'domain', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Tld'), 'field' => 'w.tld', 'alias' => 'tld', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Registrar'), 'field' => 'r.name', 'alias' => 'registrar', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Start'), 'field' => 'DATE_FORMAT(startdate, "' . Settings::getMySQLDateFormat('dateformat') . ' %H:%i:%s")', 'alias' => 'startdate', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('End'), 'field' => 'DATE_FORMAT(enddate, "' . Settings::getMySQLDateFormat('dateformat') . ' %H:%i:%s")', 'alias' => 'enddate', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['columns'][] = array('label' => $translator->translate('Status'), 'field' => 's.status', 'alias' => 'status', 'sortable' => true, 'searchable' => true, 'type' => 'string'); $config['datagrid']['fields'] = "task_id, s.status as status, DATE_FORMAT(startdate, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i:%s') as startdate, DATE_FORMAT(enddate, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i:%s') as enddate, dt.action as action, d.domain as domain, r.name as registrar, w.tld as tld"; $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('DomainsTasks dt')->leftJoin('dt.Statuses s')->leftJoin('dt.Registrars r')->leftJoin('dt.Domains d')->leftJoin('d.DomainsTlds t')->leftJoin('t.WhoisServers w'); $config['datagrid']['rownum'] = $rowNum; $config['datagrid']['basepath'] = "/admin/domainstaks/"; $config['datagrid']['index'] = "task_id"; $config['datagrid']['rowlist'] = array('10', '50', '100', '1000'); $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit'); $config['datagrid']['buttons']['edit']['cssicon'] = "edit"; $config['datagrid']['buttons']['edit']['action'] = "/admin/domainstaks/edit/id/%d"; $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete'); $config['datagrid']['buttons']['delete']['cssicon'] = "delete"; $config['datagrid']['buttons']['delete']['action'] = "/admin/domainstaks/delete/id/%d"; $massactions['bulk_delete'] = 'Mass Delete'; $statuses = Statuses::getList('domains_tasks'); if (!empty($statuses)) { $customacts = array(); foreach ($statuses as $key => $value) { $customacts['bulk_set_status&status=' . $key] = "Set as {$value}"; } $config['datagrid']['massactions']['statuses'] = $customacts; } $config['datagrid']['massactions']['common'] = $massactions; return $config; }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); $this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('gender')->setAllowEmpty(true)->setMultiOptions(array('M' => 'Man', 'F' => 'Female')); $this->addElement('select', 'taxfree', array('label' => $translate->_('Tax free'), 'description' => $translate->_('If it is set as Yes all the taxes will be not added in the orders'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('taxfree')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes')); $this->addElement('select', 'ignore_latefee', array('label' => $translate->_('Ignore late fee'), 'description' => $translate->_('If it is set as Yes this customers is not subject to late fee'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('ignore_latefee')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes')); $this->addElement('select', 'language_id', array('label' => $translate->_('Default Language'), 'description' => $translate->_('All the messages sent to the customer will be send using the default language selected'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('language_id')->setAllowEmpty(true)->setMultiOptions(Languages::getList()); $this->addElement('select', 'issubscriber', array('label' => $translate->_('Newsletter Subscription'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('issubscriber')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes')); $this->addElement('select', 'isreseller', array('label' => $translate->_('Is Reseller'), 'description' => 'Set the user as reseller', 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('isreseller')->setAllowEmpty(true)->setMultiOptions(array('0' => 'No', '1' => 'Yes')); $this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date')); $this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth district'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'group_id', array('label' => $translate->_('Group'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('group_id')->setAllowEmpty(true)->setMultiOptions(CustomersGroups::getList()); $this->addElement('select', 'type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('type_id')->setAllowEmpty(true)->setMultiOptions(CompanyTypes::getList(true)); $this->addElement('select', 'legalform_id', array('label' => 'Legal form', 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('legalform_id')->setAllowEmpty(true)->setMultiOptions(Legalforms::getList()); $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('button', 'customerupdate', array('label' => 'Customer Update', 'description' => 'Update the customer information retrieving the data from the registrar database.', 'decorators' => array('Bootstrap'), 'class' => 'button red customerupdate')); $this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Taxpayer Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); // If the browser client is an Apple client hide the file upload html object if (false == Shineisp_Commons_Utilities::isAppleClient()) { $MBlimit = Settings::findbyParam('adminuploadlimit', 'admin', Isp::getActiveISPID()); $filetypes = Settings::findbyParam('adminuploadfiletypes', 'Admin'); $Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit); $file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $filetypes, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle')); if ($filetypes) { $file->addValidator('Extension', false, $filetypes); } if ($Byteslimit) { $file->addValidator('Size', false, $Byteslimit); } $file->addValidator('Count', false, 1); $this->addElement($file); $this->addElement('select', 'filecategory', array('label' => $translate->_('File Category'), 'decorators' => array('Bootstrap'), 'class' => 'text-input')); $this->getElement('filecategory')->setAllowEmpty(true)->setMultiOptions(FilesCategories::getList()); } $this->addElement('text', 'address', array('filters' => array('StringTrim'), 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'code', array('filters' => array('StringTrim'), 'label' => $translate->_('Zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'city', array('filters' => array('StringTrim'), 'label' => $translate->_('City'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeCountry( this );')); $this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList(true)); $this->addElement('select', 'region_id', array('label' => $translate->_('Region'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeRegions( this );')); $this->getElement('region_id')->setRegisterInArrayValidator(false)->addValidator(new Shineisp_Validate_Regions()); $this->addElement('select', 'contacttypes', array('label' => $translate->_('Contact Types'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('contacttypes')->setAllowEmpty(false)->setMultiOptions(ContactsTypes::getList()); $this->addElement('text', 'contact', array('filters' => array('StringTrim'), 'label' => $translate->_('Contact'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control')); $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Private Notes'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg')); $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'validators' => array(array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'description' => 'Write here at least 6 characters.', 'label' => $translate->_('Password'), 'class' => 'form-control')); $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('customers')); $this->addElement('select', 'parent_id', array('label' => 'Reseller', 'decorators' => array('Bootstrap'), 'description' => 'Select the client who you want to join with the selected customer.', 'class' => 'form-control')); $criterias = array(array('where' => 'isreseller = ?', 'params' => '1')); $this->getElement('parent_id')->setAllowEmpty(true)->setMultiOptions(Customers::getList(true, $criterias)); $this->addElement('submit', 'save', array('label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn')); $this->addElement('hidden', 'customer_id'); }
private function servicesGrid() { $request = Zend_Controller_Front::getInstance()->getRequest(); try { if (isset($request->id) && is_numeric($request->id)) { // In order to select only the fields interested we have to add an alias to all the fields. If the aliases are not created Doctrine will require an index field for each join created. //$rs = Products::getAllServicesByCustomerID ( $request->id, 'oi.detail_id as detail_id, pd.name as productname' ); $rs = Products::getAllServicesByCustomerID($request->id, 'o.order_id, oi.detail_id as detail_id, pd.name as productname, DATE_FORMAT(oi.date_start, "%d/%m/%Y") AS date_start, DATE_FORMAT(oi.date_end, "%d/%m/%Y") AS date_end, DATEDIFF(oi.date_end, CURRENT_DATE) AS daysleft, oi.price as price, oi.autorenew as autorenew, oi.status_id as status'); if ($rs) { $arrStatuses = Statuses::getList('orders'); foreach ($rs as $k => $v) { if (isset($v['price'])) { //* TODO: Format price based on locale $rs[$k]['price'] = $v['price']; } if (isset($v['status']) && isset($arrStatuses[$v['status']])) { $rs[$k]['status'] = $arrStatuses[$v['status']]; } if (isset($v['autorenew'])) { $rs[$k]['autorenew'] = $v['autorenew'] == 1 ? $this->translator->translate('Yes') : $this->translator->translate('Yes'); } if (isset($v['date_start'])) { $rs[$k]['date_start'] = Shineisp_Commons_Utilities::formatDateIn($v['date_start']); } if (isset($v['date_end'])) { $rs[$k]['date_end'] = Shineisp_Commons_Utilities::formatDateIn($v['date_end']); } } $columns[] = $this->translator->translate('Product'); $columns[] = $this->translator->translate('Creation Date'); $columns[] = $this->translator->translate('Expiry Date'); $columns[] = $this->translator->translate('Days left'); $columns[] = $this->translator->translate('Price'); $columns[] = $this->translator->translate('Automatic renewal'); $columns[] = $this->translator->translate('Status'); return array('name' => 'services', 'columns' => $columns, 'records' => $rs, 'edit' => array('controller' => 'ordersitems', 'action' => 'edit'), 'pager' => true); } } } catch (Exception $e) { $this->_helper->redirector('edit', 'customers', 'admin', array('id' => $request->id, 'mex' => $this->translator->translate('Unable to process the request at this time.') . ": " . $e->getMessage(), 'status' => 'danger')); } }
public function init() { // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $translate = Shineisp_Registry::get('Zend_Translate'); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'customer_id', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Customer'), 'decorators' => array('Bootstrap'), 'field-id' => "customer_id", 'fields-data' => "lastname firstname ( company )", 'url-search' => "/admin/customers/search", 'class' => 'select2')); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'customer_parent_id', array('label' => $translate->_('Invoice destination'), 'decorators' => array('Bootstrap'), 'field-id' => "customer_id", 'fields-data' => "firstname lastname", 'url-search' => "/admin/customers/search", 'class' => 'select2', 'disable' => 'true')); $this->addElement('select', 'isp_id', array('required' => true, 'label' => $translate->_('ISP'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('isp_id')->setAllowEmpty(false)->setMultiOptions(Isp::getList()); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'categories', array('label' => $translate->_('Filter by categories'), 'decorators' => array('Bootstrap'), 'id' => 'productcategories', 'field-id' => "category_id", 'fields-data' => "name", 'url-search' => "/admin/productscategories/search", 'class' => 'select2', 'rel' => 'tree_select')); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'referdomain', array('filters' => array('StringTrim'), 'label' => $translate->_('Reference Domain'), 'description' => $translate->_('Assign a domain in order to identify the service/product'), 'decorators' => array('Bootstrap'), 'field-id' => "domain_id", 'fields-data' => "domain", 'url-search' => "/admin/domains/search", 'class' => 'select2')); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'products', array('id' => "products", 'required' => false, 'label' => $translate->_('Products'), 'field-id' => "product_id", 'fields-data' => "name", 'url-search' => "/admin/products/search", 'class' => 'select2')); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'billingcycle_id', array('id' => 'billingid', 'label' => $translate->_('Billing Cycle'), 'decorators' => array('Bootstrap'), 'field-id' => "billing_cycle_id", 'fields-data' => "name ( price / setupfee )", 'url-search' => "/admin/orders/getbillingcycles", 'class' => 'select2')); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'domains_selected', array('filters' => array('StringTrim'), 'label' => $translate->_('Add Domains'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('If you do not find a domain name from this list, you have to create it by the domain admministration page.'), 'multiple' => true, 'field-id' => "domain_id", 'fields-data' => "domain", 'url-search' => "/admin/domains/search", 'class' => 'select2')); $this->addElement('checkbox', 'is_renewal', array('label' => $translate->_('Is a Renewal?'), 'description' => "If this order is a renewal, it will be checked by ShineISP and it cannot be deleted by the customer in the customer order frontend panel.", 'decorators' => array('Bootstrap'), 'class' => 'form-control')); /* * This hidden form field will be converted in a advanced select object * the JQuery Select2 object is loaded automatically by the css class select2 */ $this->addElement('hidden', 'invoice_id', array('label' => $translate->_('Invoice No.'), 'decorators' => array('Bootstrap'), 'field-id' => "invoice_id", 'fields-data' => "formatted_number ( number )", 'url-search' => "/admin/invoices/search", 'class' => 'select2')); $this->addElement('text', 'order_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Order Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'expiring_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'description' => $translate->_('If this date is set ShineISP will suspend the order at the specified date.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'date_start', array('filters' => array('StringTrim'), 'label' => $translate->_('Date Start'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat())); $this->addElement('text', 'quantity', array('filters' => array('StringTrim'), 'label' => $translate->_('Quantity'), 'decorators' => array('Bootstrap'), 'value' => '1', 'class' => 'form-control')); $this->addElement('text', 'profit', array('filters' => array('StringTrim'), 'label' => $translate->_('Profit'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'id' => 'description', 'rows' => '3', 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control')); $this->addElement('text', 'cost', array('filters' => array('StringTrim'), 'label' => $translate->_('Cost'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'price', array('filters' => array('StringTrim'), 'label' => $translate->_('Price'), 'id' => 'price', 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'setupfee', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup fee'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'total', array('filters' => array('StringTrim'), 'label' => $translate->_('Total'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'grandtotal', array('filters' => array('StringTrim'), 'label' => $translate->_('Grand Total'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Save again in order to update the totals.'), 'class' => 'form-control bold')); $this->addElement('text', 'received_income', array('readonly' => 1, 'filters' => array('StringTrim'), 'label' => $translate->_('Income'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'missing_income', array('readonly' => 1, 'filters' => array('StringTrim'), 'label' => $translate->_('Missing income'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'fastlink', array('filters' => array('StringTrim'), 'id' => 'fastlink', 'label' => $translate->_('Fastlink Code'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Here you can read a unique code for redirect a user in the order page using the fastlink.'), 'class' => 'form-control readonly')); $this->addElement('text', 'visits', array('filters' => array('StringTrim'), 'label' => $translate->_('Visits'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Here you can read how many times the order has been viewed by the customer.'), 'class' => 'form-control readonly')); // If the browser client is an Apple client hide the file upload html object if (false == Shineisp_Commons_Utilities::isAppleClient()) { $MBlimit = Settings::findbyParam('adminuploadlimit'); $Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit); $filetypes = Settings::findbyParam('adminuploadfiletypes', 'Admin'); $file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $filetypes, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle')); if (!empty($filetypes)) { $file->addValidator('Extension', false, $filetypes); } $file->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1); $this->addElement($file); $this->addElement('select', 'filecategory', array('label' => $translate->_('Category'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('filecategory')->setAllowEmpty(false)->setMultiOptions(FilesCategories::getList())->setRegisterInArrayValidator(false)->setRequired(false); } $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Private Notes'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg')); $this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'label' => $translate->_('Post a comment'), 'decorators' => array('Bootstrap'), 'class' => 'form-control wysiwyg')); $this->addElement('select', 'status_id', array('label' => 'Status', 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders')); $this->addElement('text', 'paymentdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Payment date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date')); $this->addElement('text', 'reference', array('filters' => array('StringTrim'), 'label' => $translate->_('Payment Reference'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'bank_id', array('id' => 'paymentmethods', 'label' => $translate->_('Bank name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('bank_id')->setAllowEmpty(false)->setMultiOptions(Banks::getList(true)); $this->addElement('text', 'income', array('filters' => array('StringTrim'), 'label' => $translate->_('Income'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('text', 'payment_description', array('filters' => array('StringTrim'), 'label' => $translate->_('Notes'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->addElement('select', 'confirmed', array('filters' => array('StringTrim'), 'label' => $translate->_('Has the Transaction been confirmed?'), 'decorators' => array('Bootstrap'), 'class' => 'form-control')); $this->getElement('confirmed')->setAllowEmpty(false)->setMultiOptions(array('0' => "No, not yet", '1' => "Yes, it has been")); $this->addElement('hidden', 'order_id'); }