Exemple #1
0
 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');
 }
Exemple #2
0
 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');
 }
Exemple #3
0
 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'target_path', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Target Path'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'request_path', array('filters' => array('StringTrim'), 'label' => $translate->_('Request Path'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12'));
     $this->addElement('select', 'product_id', array('filters' => array('StringTrim'), 'label' => $translate->_('Products'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('product_id')->setAllowEmpty(false)->setMultiOptions(Products::getList(true));
     $this->addElement('select', 'category_id', array('filters' => array('StringTrim'), 'label' => $translate->_('Categories'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('category_id')->setAllowEmpty(false)->setMultiOptions(ProductsCategories::getList(true));
     $this->addElement('checkbox', 'temporary', array('filters' => array('StringTrim'), 'label' => $translate->_('Temporary'), 'decorators' => array('Bootstrap')));
     $this->addElement('hidden', 'url_rewrite_id');
 }
Exemple #4
0
 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('select', 'product_id', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Product'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('product_id')->setAllowEmpty(false)->setMultiOptions(Products::getList());
     $this->addElement('text', 'publishedat', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Published At'), 'class' => 'form-control date'));
     $this->addElement('text', 'nick', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Nick'), 'class' => 'form-control'));
     $this->addElement('select', 'referer', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Who is Talking About Us?'), 'class' => 'form-control', 'multiOptions' => array('Google' => 'Google', 'Bing' => 'Bing', 'Yahoo' => 'Yahoo', $translate->_('Other Search Engine') => $translate->_('Other Search Engine'), 'Websites' => $translate->_('Websites/Blogs'), $translate->_('Friend suggestion') => $translate->_('Friend suggestion'))));
     $this->addElement('text', 'city', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('City'), 'class' => 'form-control'));
     $this->addElement('text', 'ip', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('IP'), 'class' => 'form-control'));
     $this->addElement('text', 'latitude', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Latitude'), 'class' => 'form-control'));
     $this->addElement('text', 'longitude', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Longitude'), 'class' => 'form-control'));
     $this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subject'), 'class' => 'form-control'));
     $this->addElement('text', 'email', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Email'), 'class' => 'form-control'));
     $this->addElement('text', 'stars', array('filters' => array('StringTrim'), 'required' => true, 'data-clearable' => $translate->_('Delete'), 'data-min' => "1", 'data-max' => "5", 'label' => $translate->_('Stars'), 'decorators' => array('Bootstrap'), 'class' => 'rating'));
     $this->addElement('checkbox', 'active', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Active'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('textarea', 'review', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'required' => true, 'class' => 'col-lg-12 form-control wysiwyg'));
     $this->addElement('hidden', 'review_id');
 }
 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'name', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'uri', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('URI'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'googlecategs', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Google Categories'), 'description' => $translate->_('See at http://support.google.com/merchants/bin/answer.py?hl=it&answer=1705911 for the list of the tassonomy'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'position', array('filters' => array('StringTrim'), 'label' => $translate->_('Position'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Description'), 'class' => 'col-lg-12 form-control wysiwyg'));
     $this->addElement('textarea', 'keywords', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Keywords'), 'rows' => 5, 'class' => 'col-lg-12'));
     $this->addElement('select', 'parent', array('filters' => array('StringTrim'), 'label' => $translate->_('Parent Category'), 'description' => $translate->_('Select here the parent category.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('parent')->setAllowEmpty(false)->setMultiOptions(ProductsCategories::getList(true));
     $this->addElement('multiselect', 'products', array('label' => $translate->_('Products'), 'description' => $translate->_('Select here the products to add to this category. Use Ctrl button to select more categories.'), 'decorators' => array('Bootstrap'), 'size' => 20, 'class' => 'form-control'));
     $this->getElement('products')->setAllowEmpty(false)->setMultiOptions(Products::getList());
     $this->addElement('textarea', 'blocks', array('filters' => array('StringTrim'), 'label' => $translate->_('Blocks'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12'));
     $this->addElement('checkbox', 'enabled', array('label' => $translate->_('Enabled'), 'decorators' => array('Bootstrap'), 'class' => 'checkbox'));
     $this->addElement('multiselect', 'wikipages', array('label' => 'Wiki Pages', 'decorators' => array('Bootstrap'), 'class' => 'form-control multiselect'));
     $this->getElement('wikipages')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Wiki::getList());
     $this->addElement('submit', 'save', array('required' => false, 'label' => 'Save', 'decorators' => array('Bootstrap'), 'class' => 'btn'));
     $this->addElement('hidden', 'category_id');
 }
Exemple #6
0
 /**
  * newAction
  * Create the form module in order to create a record
  * @return unknown_type
  */
 public function doAction()
 {
     $request = $this->getRequest();
     $q = $request->getParam('q');
     $q = strtolower($q);
     if (!$q) {
         return;
     }
     $q = trim($q);
     $customers = Customers::getList();
     foreach ($customers as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             echo "{$key}|{$value}|customers|" . $this->translator->translate('Customers') . "\n";
         }
     }
     $customers = Customers::getEmailList();
     foreach ($customers as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             echo "{$key}|{$value}|customers|" . $this->translator->translate('Customer email') . "\n";
         }
     }
     $domains = Domains::getList();
     foreach ($domains as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             echo "{$key}|{$value}|domains|" . $this->translator->translate('Domains') . "\n";
         }
     }
     $products = Products::getList();
     foreach ($products as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             echo "{$key}|{$value}|products|" . $this->translator->translate('Products') . "\n";
         }
     }
     $orders = Orders::getList();
     foreach ($orders as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             echo "{$key}|{$value}|orders|" . $this->translator->translate('Orders') . "\n";
         }
     }
     $wiki = Wiki::getList();
     foreach ($wiki as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             echo "{$key}|{$value}|wiki|" . $this->translator->translate('Wiki') . "\n";
         }
     }
     die;
 }
Exemple #7
0
 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'name', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Product name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'nickname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Product Nickname'), 'description' => $translate->_('This is the short name of the product'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'uri', array('filters' => array('StringTrim'), 'label' => $translate->_('URI'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'sku', array('filters' => array('StringTrim'), 'label' => $translate->_('SKU'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('textarea', 'shortdescription', array('filters' => array('StringTrim'), 'label' => $translate->_('Short Description'), 'id' => 'shortdescription', 'class' => 'col-lg-12 form-control wysiwyg'));
     $this->addElement('textarea', 'metakeywords', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Keywords'), 'rows' => 5, 'class' => 'col-lg-12 form-control'));
     $this->addElement('textarea', 'metadescription', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Meta Description'), 'rows' => 5, 'class' => 'col-lg-12 form-control'));
     $this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'id' => 'description', 'class' => 'col-lg-12 form-control wysiwyg'));
     $this->addElement('select', 'category_id', array('label' => $translate->_('Category'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(ProductsCategories::getList());
     $this->addElement('select', 'welcome_mail_id', array('label' => $translate->_('Welcome E-Mail'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('welcome_mail_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(EmailsTemplates::getList());
     $this->addElement('select', 'server_group_id', array('label' => $translate->_('Server group'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('server_group_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(ServersGroups::getList(true));
     $this->addElement('select', 'autosetup', array('label' => $translate->_('Automatic setup'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('autosetup')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(array('0' => 'Do not automatically setup this product', '1' => 'Automatically setup the product as soon as an order is placed', '2' => 'Automatically setup the product as soon as the first payment is received', '3' => 'Automatically setup the product when you manually accept a pending order', '4' => 'Automatically setup the product as soon as the payment is complete'));
     $this->addElement('multiselect', 'related', array('label' => $translate->_('Related Products'), 'decorators' => array('Bootstrap'), 'size' => '20x', 'title' => $translate->_('Select ...'), 'data-container' => 'body', 'data-selected-text-format' => 'count > 2', 'data-size' => 'auto', 'data-live-search' => 'true', 'class' => 'multiselect show-tick col-md-4'));
     $this->addElement('multiselect', 'upgrade', array('label' => $translate->_('Product Upgrades'), 'decorators' => array('Bootstrap'), 'size' => '20x', 'title' => $translate->_('Select ...'), 'data-container' => 'body', 'data-selected-text-format' => 'count > 2', 'data-size' => 'auto', 'data-live-search' => 'true', 'class' => 'multiselect show-tick col-md-4'));
     $this->getElement('related')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Products::getList());
     $this->getElement('upgrade')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Products::getList());
     $this->addElement('select', 'tax_id', array('label' => 'Tax', 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('tax_id')->setAllowEmpty(false)->setMultiOptions(Taxes::getList(true));
     $this->addElement('text', 'cost', array('filters' => array('StringTrim'), 'label' => $translate->_('Cost'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'price_1', array('filters' => array('StringTrim'), 'label' => $translate->_('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('textarea', 'setup', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('XML Setup Configuration. See the manual'), 'class' => 'col-lg-12 form-control'));
     $this->addElement('select', 'enabled', array('label' => $translate->_('Enabled'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'Disabled', '1' => 'Active')));
     $this->addElement('select', 'ishighlighted', array('label' => $translate->_('Is Highlighted'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'No', '1' => 'Yes')));
     $this->addElement('select', 'isrefundable', array('label' => $translate->_('Is Refundable'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'No', '1' => 'Yes')));
     $this->addElement('select', 'default', array('label' => $translate->_('Default Image'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'No', '1' => 'Yes')));
     $this->addElement('select', 'iscomparable', array('label' => $translate->_('Is Comparable'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'No', '1' => 'Yes')));
     $this->addElement('select', 'showonrss', array('label' => $translate->_('Publish on RSS Feed'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'No', '1' => 'Yes')));
     $this->addElement('select', 'downgradable', array('label' => $translate->_('Allow downgrades'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('0' => 'No', '1' => 'Yes')));
     $this->addElement('select', 'type', array('label' => $translate->_('Product Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('generic' => $translate->_('Generic'), 'domain' => $translate->_('Domain'), 'hosting' => $translate->_('Hosting'))));
     // If the browser client is an Apple client hide the file upload html object
     if (false == Shineisp_Commons_Utilities::isAppleClient()) {
         $this->addElement('text', 'filedescription', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
         $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'));
         $file->addValidator('Extension', false, $filetypes)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
         $this->addElement($file);
     }
     $this->addElement('multiselect', 'wikipages', array('label' => $translate->_('Wiki Pages'), 'decorators' => array('Bootstrap'), 'title' => $translate->_('Select ...'), 'data-container' => 'body', 'data-selected-text-format' => 'count > 2', 'data-size' => 'auto', 'data-live-search' => 'true', 'class' => 'multiselect show-tick col-md-4'));
     $this->getElement('wikipages')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Wiki::getList());
     $this->addElement('select', 'tranche_billing_cycle_id', array('label' => $translate->_('Billing Cycle'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('tranche_billing_cycle_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(BillingCycle::getList());
     $this->addElement('text', 'tranche_qty', array('filters' => array('StringTrim'), 'label' => $translate->_('Quantity'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'tranche_measure', array('filters' => array('StringTrim'), 'label' => $translate->_('Measurement label'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'tranche_setupfee', array('filters' => array('StringTrim'), 'label' => $translate->_('Setup fee'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'tranche_price', array('filters' => array('StringTrim'), 'label' => $translate->_('Unit Price'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('multiselect', 'tranche_includes_domains', array('isArray' => true, 'label' => $translate->_('Domain included'), 'decorators' => array('Bootstrap'), 'title' => $translate->_('Select ...'), 'data-container' => 'body', 'data-selected-text-format' => 'count > 2', 'data-size' => 'auto', 'data-live-search' => 'true', 'class' => 'multiselect show-tick col-md-4'));
     $this->getElement('tranche_includes_domains')->setAllowEmpty(true)->setRegisterInArrayValidator(false)->setMultiOptions(DomainsTlds::getList());
     $this->addElement('select', 'group_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Attribute Group'), 'required' => true, 'class' => 'form-control'));
     $this->getElement('group_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(ProductsAttributesGroups::getList());
     $this->addElement('text', 'position', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Position'), 'class' => 'form-control'));
     $this->addElement('textarea', 'blocks', array('filters' => array('StringTrim'), 'label' => $translate->_('Blocks'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control'));
     $this->addElement('hidden', 'product_id');
 }
Exemple #8
0
 /**
  * Create the form module in order to create a record
  * @return unknown_type
  */
 public function doAction()
 {
     $request = $this->getRequest();
     $q = $request->getParam('q');
     $results = array();
     $q = strtolower($q);
     if (empty($q)) {
         die(json_encode(array($this->translator->translate('No Records'))));
     }
     $cms = CmsPages::getList();
     foreach ($cms as $key => $value) {
         if (strpos(strtolower($value), $q) !== false) {
             $results[] = array('icon' => 'glyphicon-file', 'section' => $this->translator->translate('Cms'), 'value' => $value, 'url' => "/admin/cmspages/edit/id/{$key}", 'tokens' => explode(' ', $value));
         }
     }
     $customers = Customers::getList();
     if (!empty($customers)) {
         foreach ($customers as $key => $value) {
             if (strpos(strtolower($value), $q) !== false) {
                 $results[] = array('icon' => 'glyphicon-user', 'section' => $this->translator->translate('Customer'), 'value' => $value, 'url' => "/admin/customers/edit/id/{$key}", 'tokens' => explode(' ', $value));
             }
         }
     }
     $domains = Domains::getList();
     if (!empty($domains)) {
         foreach ($domains as $key => $value) {
             if (strpos(strtolower($value), $q) !== false) {
                 $results[] = array('icon' => 'glyphicon-globe', 'section' => $this->translator->translate('Domain'), 'value' => $value, 'url' => "/admin/domains/edit/id/{$key}", 'tokens' => explode(' ', $value));
             }
         }
     }
     $products = Products::getList();
     if (!empty($products)) {
         foreach ($products as $key => $value) {
             if (strpos(strtolower($value), $q) !== false) {
                 $results[] = array('icon' => 'glyphicon-barcode', 'section' => $this->translator->translate('Product'), 'value' => $value, 'url' => "/admin/products/edit/id/{$key}", 'tokens' => explode(' ', $value));
             }
         }
     }
     $orders = Orders::getList();
     if (!empty($orders)) {
         foreach ($orders as $key => $value) {
             if (strpos(strtolower($value), $q) !== false) {
                 $results[] = array('icon' => 'glyphicon-briefcase', 'section' => $this->translator->translate('Order'), 'value' => $value, 'url' => "/admin/orders/edit/id/{$key}", 'tokens' => explode(' ', $value));
             }
         }
     }
     $ordersitems = OrdersItems::getItemsListbyDescription($q);
     if (!empty($ordersitems)) {
         foreach ($ordersitems as $key => $value) {
             $results[] = array('icon' => 'glyphicon-briefcase', 'section' => $this->translator->translate('Order Item'), 'value' => $value, 'url' => "/admin/ordersitems/edit/id/{$key}", 'tokens' => explode(' ', $value));
         }
     }
     $tickets = Tickets::getList();
     if (!empty($tickets)) {
         foreach ($tickets as $key => $value) {
             if (strpos(strtolower($value), $q) !== false) {
                 $results[] = array('icon' => 'glyphicon-check', 'section' => $this->translator->translate('Ticket'), 'value' => $value, 'url' => "/admin/tickets/edit/id/{$key}", 'tokens' => explode(' ', $value));
             }
         }
     }
     $wiki = Wiki::getList();
     if (!empty($wiki)) {
         foreach ($wiki as $key => $value) {
             if (strpos(strtolower($value), $q) !== false) {
                 $results[] = array('icon' => 'glyphicon-question-sign', 'section' => $this->translator->translate('Wiki'), 'value' => $value, 'url' => "/admin/wiki/edit/id/{$key}", 'tokens' => explode(' ', $value));
             }
         }
     }
     $ticket = TicketsNotes::getItemsNote($q);
     foreach ($ticket as $key => $value) {
         $results[] = array('icon' => 'glyphicon-question-sign', 'section' => $this->translator->translate('Ticket Notes'), 'value' => $value, 'url' => "/admin/wiki/tickets/id/{$key}", 'tokens' => explode(' ', $value));
     }
     die(json_encode($results));
 }