/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $cats = new CategoriesCoins(); $cat_options = $cats->getPeriodEarlyMed(); $denominations = new Denominations(); $denomination_options = $denominations->getOptionsEarlyMedieval(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new WearTypes(); $wear_options = $wears->getWears(); $rulers = new Rulers(); $ro = $rulers->getEarlyMedRulers(); $mints = new Mints(); $mo = $mints->getEarlyMedievalMints(); parent::__construct($options); $this->setName('earlymedievalcoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(null => 'Choose denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow'); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int'); $categoryID = new Zend_Form_Element_Select('categoryID'); $categoryID->setLabel('Category of coin: ')->addValidators(array('NotEmpty'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose category', 'Available categories' => $cat_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); $ruler_id = new Zend_Form_Element_Select('ruler_id'); $ruler_id->setLabel('Ruler: ')->addValidator('InArray', false, array(array_keys($ro)))->addMultiOptions(array(null => 'Choose a ruler', 'Available rulers' => $ro))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim')); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => '')); $mint_id = new Zend_Form_Element_Select('mint_id'); $mint_id->setLabel('Issuing mint: ')->addValidator('InArray', false, array(array_keys($mo)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose a mint', 'Available mints' => $mo)); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->setValue(1)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose coin status', 'Available status' => $status_options)); $status_qualifier = new Zend_Form_Element_Radio('status_qualifier'); $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => '')); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a degree of wear', 'Available options' => $wear_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->addFilters(array('StripTags', 'StringTrim')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim')); $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark'); $rev_mm->setLabel('Reverse mint mark: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim')); $initial = new Zend_Form_Element_Textarea('initial_mark'); $initial->setLabel('Initial mark: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim')); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose die axis', 'Available options' => $die_options)); $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty'); $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int'); $typeID = new Zend_Form_Element_Select('typeID'); $typeID->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $typeID, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $submit, $rev_mm, $initial)); $this->addDisplayGroup(array('categoryID', 'ruler_id', 'typeID', 'ruler_qualifier', 'denomination', 'denomination_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'initial_mark', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
public function __construct($options = null) { // Construct the select menu data $rulers = new Rulers(); $ruler_options = $rulers->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new Weartypes(); $wear_options = $wears->getWears(); parent::__construct($options); $this->setName('romancoin'); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->setRegisterInArrayValidator(false)->addValidator()->setDecorators($decorators); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $ruler_options))->setRegisterInArrayValidator(false)->setDecorators($decorators); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $mint_ID = new Zend_Form_Element_Select('mint_id'); $mint_ID->setLabel('Issuing mint: ')->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $mint_options))->setRegisterInArrayValidator(false)->setDecorators($decorators); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setValue(1)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_options))->setDecorators($decorators); $status_qualifier = new Zend_Form_Element_Radio('status_qualifier'); $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding'); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding'); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose die axis' => $die_options))->setDecorators($decorators); $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty'); $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $this->addElements(array($ruler, $denomination, $mint_ID, $status, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->addDisplayGroup(array('submit'), 'submit'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { // Construct the select menu data $rulers = new Rulers(); $ruler_options = $rulers->getRulersGreek(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsGreek(); $mints = new Mints(); $mint_options = $mints->getMintsGreek(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new WearTypes(); $wear_options = $wears->getWears(); parent::__construct($options); $this->setName('greekcoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->addMultiOptions(array(null => 'Choose a denomination', 'Valid denominations' => $denomination_options))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($denomination_options))); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => '')); $ruler = new Zend_Form_Element_Select('ruler_id'); $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a ruler', 'Valid coin issuers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options))); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => '')); $mint_ID = new Zend_Form_Element_Select('mint_id'); $mint_ID->setLabel('Issuing mint: ')->addValidators(array('NotEmpty', 'Int'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose denomination', 'Available options' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options))); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => '')); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setValue(1)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose coin status', 'Available options' => $status_options))->addValidator('InArray', false, array(array_keys($status_options))); $status_qualifier = new Zend_Form_Element_Radio('status_qualifier'); $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => '')); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose degree of wear', 'Available options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->addFilters(array('StringTrim', 'StripTags')); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 60)->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 60)->setAttrib('class', 'span6')->addFilters(array('StringTrim', 'StripTags', 'BasicHtml', 'EmptyParagraph')); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose die axis', 'Available options' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)))->addFilters(array('StringTrim', 'StripTags')); $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty'); $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StringTrim', 'StripTags'))->setOptions(array('separator' => '')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($ruler, $denomination, $mint_ID, $status, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
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'); }
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'); }
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 customers() { $registry = Shineisp_Registry::getInstance(); $translator = $registry->Zend_Translate; $this->view->customers = Customers::getList($translator->translate('Select the customer ...'), array(array('where' => 'u.status_id = ?', 'params' => Statuses::id('active', 'customers')))); return $this->view->render('partials/customers.phtml'); }
/** * 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 function init() { // Get all settings Shineisp_Registry::set('Settings', Settings::getAll()); // Statuses are used everywhere in system, so we need to make just one query Shineisp_Registry::set('Status', Statuses::getAll()); }
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', '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() { $NS = new Zend_Session_Namespace('Default'); $translate = Shineisp_Registry::get('Zend_Translate'); // Set the custom decorator $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator'); $this->addElement('select', 'domain_id', array('decorators' => array('Bootstrap'), 'required' => false, 'label' => $translate->_('Domain'), 'description' => $translate->_('Choose the domain name reference'), 'class' => 'form-control large-input')); $this->getElement('domain_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList(true, $NS->customer['customer_id'])); $this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'title' => $translate->_('Write here a subject of the issue.'), 'label' => $translate->_('Subject'), 'description' => $translate->_('Write here the domain name or a simple description of the problem.'), 'class' => 'form-control large-input')); $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Body Message'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here all the information.'), 'rows' => '8', 'class' => 'form-control wysiwyg-simple')); $this->addElement('select', 'status', array('filters' => array('StringTrim'), 'label' => $translate->_('Set the issue status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'multioptions' => array('' => '', Statuses::id("solved", "tickets") => $translate->_('Solved'), Statuses::id("closed", "tickets") => $translate->_('Closed')))); $this->addElement('select', 'category_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'description' => 'Select a category.', 'class' => 'form-control large-input')); $this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList(true)); if (false == Shineisp_Commons_Utilities::isAppleClient()) { $MBlimit = Settings::findbyParam('useruploadlimit'); $Types = Settings::findbyParam('useruploadfiletypes'); 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'), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $Types, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)))); $file->addValidator('Extension', false, $Types)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1); $this->addElement($file); } else { $this->addElement('hidden', 'attachments'); } $this->addElement('submit', 'submit', array('label' => $translate->_('Send help request'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg')); $this->addElement('hidden', 'ticket_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'); }
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() { // Get authenticated user $auth = Zend_Auth::getInstance()->getIdentity(); // Store logged ISP. I'm inside admin, se we use only the logged user if (isset($auth['isp_id'])) { $isp_id = intval($auth['isp_id']); $ISP = new Isp(); Shineisp_Registry::set('ISP', $ISP->find($isp_id)); } // Load all the status in the registry $statusreg = Shineisp_Registry::get('Status'); if (empty($statusreg)) { $status = Statuses::getAll(); Shineisp_Registry::set('Status', $status); } parent::init(); }
/** * Response * Create the Order, Invoice and send an email to the customer * @param $response from the Gateway Server * @return order_id or false */ public function Response($response) { $bank = self::getModule(); $bankid = $bank['bank_id']; if (!empty($response['item_number'])) { // Get the indexes of the order $orderid = trim($response['custom']); if (is_numeric($orderid) && is_numeric($bankid)) { // Replacing the comma with the dot in the amount value. $amount = str_replace(",", ".", $response['amount']); $payment = Payments::addpayment($orderid, $response['thx_id'], $bankid, 0, $amount); Orders::set_status($orderid, Statuses::id("paid", "orders")); // Paid OrdersItems::set_statuses($orderid, Statuses::id("paid", "orders")); // Paid return $orderid; } } }
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'); }
public function init() { try { // Store logged ISP. I'm in the public area, se we use only the URL $ISP = Isp::findByUrl($_SERVER['HTTP_HOST']); if (!empty($ISP)) { Shineisp_Registry::set('ISP', $ISP); } // Load all the status in the registry $statusreg = Shineisp_Registry::get('Status'); if (empty($statusreg)) { $status = Statuses::getAll(); Shineisp_Registry::set('Status', $status); } } catch (Exception $e) { Shineisp_Commons_Utilities::log(__METHOD__ . " " . $e->getMessage()); } parent::init(); }
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'); }
/** * Check if all items of order are completed ***/ public static function checkIfOrderItemsAreCompleted($orderid) { $records = OrdersItems::getAllDetails($orderid, "s.code as statuscode", true); foreach ($records as $record) { if ($record['statuscode'] != Statuses::id('complete', 'orders')) { return false; } } return true; }
/** * activate * Activate an order item * @param $orderItemId * @return true|false */ public static function activate($orderItemId) { Shineisp_Commons_Utilities::log(__METHOD__ . " - Activate Detail ID #" . $orderItemId); $orderItemId = intval($orderItemId); if ($orderItemId < 1) { // missing order item id from arguments return false; } // Get OrderItem $ordersItem = self::find($orderItemId); $ordersItem = $ordersItem->toArray(); $OrderItem = array_shift($ordersItem); if (!$OrderItem) { // order item not found return false; } // Get customerId related to this order $customerId = Orders::getCustomer($OrderItem['order_id']); /* * START ACTIVATIONS CODE */ $upgrade = Orders::isUpgrade($OrderItem['order_id']); $upgrade_uuid = false; if ($upgrade !== false) { $orderItem = OrdersItems::getDetail($upgrade); Shineisp_Commons_Utilities::logs(__METHOD__ . " - OITEM::" . print_r($orderItem, true)); $oldOrderId = $orderItem['order_id']; Orders::set_status($oldOrderId, Statuses::id("changed", "orders")); // Close the old order ::status changed OrdersItems::set_status($upgrade, Statuses::id("changed", "orders")); $upgrade_uuid = $orderItem['uuid']; // log Shineisp_Commons_Utilities::logs(__METHOD__ . " - Order changed from #" . $oldOrderId . " to #" . $OrderItem['order_id']); } if (empty($OrderItem['parameters'])) { Shineisp_Commons_Utilities::logs(__METHOD__ . " - Order items setup parameters empty"); return false; } // Is this an hosting? execute panel task // TODO: this should call an hook or an even bound to the panel if (isset($OrderItem['Products']) && isset($OrderItem['Products']['type']) && $OrderItem['Products']['type'] == 'hosting') { Shineisp_Commons_Utilities::logs(__METHOD__ . " Hosting task queued"); PanelsActions::AddTask($customerId, $OrderItem['detail_id'], "fullProfile", $OrderItem['parameters']); return true; } // Is this a domain? execute domain task if (isset($OrderItem['tld_id']) && intval($OrderItem['tld_id']) > 0) { $parameters = json_decode($OrderItem['parameters']); if (empty($parameters->domain)) { Shineisp_Commons_Utilities::logs(__METHOD__ . " Domain has been not set in the order detail #{$orderItemId}"); return false; } // Create the domain record $domain = Domains::Create($parameters->domain, intval($OrderItem['tld_id']), intval($customerId), $orderItemId); // Create the domain task if (!empty($parameters->domain) && !empty($parameters->action)) { $domains[] = array('domain' => $parameters->domain, 'action' => $parameters->action); $retval = DomainsTasks::AddTasks($domains); Shineisp_Commons_Utilities::logs(__METHOD__ . " Domain task queued"); } return $retval; } }
/** * Get the product sold summary or per year */ public static function getBestseller($year = null) { $Session = new Zend_Session_Namespace('Admin'); $locale = $Session->langid; // Get the year incomes total and subtract the credit memo $dq = Doctrine_Query::create()->select('detail_id, p.product_id as id, count(*) as total, pag.name as group, pd.name as product,')->from('OrdersItems oi')->leftJoin('oi.Orders o')->leftJoin('oi.Products p')->leftJoin("p.ProductsData pd WITH pd.language_id = {$locale}")->leftJoin('p.ProductsAttributesGroups pag')->where('oi.status_id = ? OR oi.status_id = ?', array(Statuses::id('paid', 'orders'), Statuses::id('complete', 'orders')))->andWhere('p.isp_id = ?', Isp::getCurrentId())->groupBy('pd.name')->orderBy('count(*) desc'); if (is_numeric($year)) { $dq->andWhere('Year(o.order_date) = ?', $year); } $data = $dq->execute(null, Doctrine::HYDRATE_ARRAY); return $data; }
<table width='686' style='font-size:11px;'> <tr> <td colspan='2'> </td> </tr> <tr> <td width='311' align='left' valign='top'><?php echo $departmentName; ?> Department______________ </td> <td width='281' align='right' valign='top'>Date______________</td> </tr> <tr> <td align='left' valign='top'>Academic Status: <span style='color: red; font-weight:bold; '> <?php echo Statuses::getStudentStatus($enrollment); ?> </span> </td> <td align='right' valign='top'> </td> </tr> <tr> <td colspan='2' align='left' valign='top' style='font-size:11px;'> Note:- 1. This grade is invalid unless it bears the official seal of the college<br> 2. There must be no eraser </td> </tr> </table> <br /> <br /> <?php
public function __construct($options = null) { // Construct the select menu data $denominations = new Denominations(); $denomination_options = $denominations->getOptionsRoman(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new Weartypes(); $wear_options = $wears->getWears(); $rulers = new Rulers(); $ro = $rulers->getRomanRulers(); $mints = new Mints(); $mo = $mints->getRomanMints(); $reeces = new Reeces(); $reece = $reeces->getOptions(); parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator'); $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element'); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li'))); $this->setName('romancoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRequired(true)->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a denomination'); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $ruler = new Zend_Form_Element_Select('ruler_id'); $ruler->setLabel('Ruler: ')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose a ruler' => $ro))->addValidator('InArray', false, array(array_keys($ro))); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Ruler qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $mint_id = new Zend_Form_Element_Select('mint_id'); $mint_id->setLabel('Issuing mint: ')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose a mint' => $mo))->addValidator('InArray', false, array(array_keys($mo)))->addFilters(array('StripTags', 'StringTrim')); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $reeceID = new Zend_Form_Element_Select('reeceID'); $reeceID->setLabel('Reece period: ')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose period' => $reece))->addValidator('InArray', false, array(array_keys($reece)))->addFilters(array('StripTags', 'StringTrim')); $moneyer = new Zend_Form_Element_Select('moneyer'); $moneyer->setLabel('Republican Moneyer: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $moneyer_qualifier = new Zend_Form_Element_Radio('moneyer_qualifier'); $moneyer_qualifier->setLabel('Republican Moneyer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $revtypeID = new Zend_Form_Element_Select('revtypeID'); $revtypeID->setLabel('Reverse type: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $revTypeID_qualifier = new Zend_Form_Element_Radio('revTypeID_qualifier'); $revTypeID_qualifier->setLabel('Reverse type qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->setDecorators($decorators); $status_qualifier = new Zend_Form_Element_Radio('status_qualifier'); $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80))->addFilters(array('StripTags', 'StringTrim')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80))->addFilters(array('StripTags', 'StringTrim')); $reverse_mintmark = new Zend_Form_Element_Textarea('reverse_mintmark'); $reverse_mintmark->setLabel('Reverse mintmark: ')->setAttribs(array('rows' => 3, 'cols' => 80))->addFilters(array('StripTags', 'StringTrim')); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->addMultiOptions(array(NULL => NULL, 'Choose die axis' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim')); $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty'); $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName(); if ($action == 'editcoin') { $rulers = new Rulers(); $ruler_options = $rulers->getRomanRulers(); $ruler->addMultiOptions(array(NULL => NULL, 'Choose ruler' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options))); $mints = new Mints(); $mint_options = $mints->getRomanMints(); $mint_id->addMultiOptions(array(NULL => NULL, 'Choose Roman mint' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options))); $reeces = new Reeces(); $reece_options = $reeces->getReeces(); $reeceID->addMultiOptions(array(NULL => NULL, 'Choose Reece period' => $reece_options))->addValidator('InArray', false, array(array_keys($reece_options))); } $this->addElements(array($ruler, $denomination, $moneyer, $mint_id, $reeceID, $status, $revtypeID, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $revTypeID_qualifier, $reverse_mintmark, $submit, $hash)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'reeceID', 'revtypeID', 'revTypeID_qualifier', 'moneyer', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->addDisplayGroup(array('submit'), 'submit'); }
public function executeDoPromotion(sfWebRequest $request) { ## find section detail $i = 1; $this->programSectionId = $request->getParameter('id'); $this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->getOneProgramSectionById($this->programSectionId); $enrollments = Doctrine_Core::getTable('EnrollmentInfo')->getEnrollmentsBySectionId($this->programSectionId); ## Get promotion information if available for existing class, $this->promotionInfo = Doctrine_Core::getTable('PromotionSetting')->getOnePromotionSetting($this->sectionDetail->getProgramId(), $this->sectionDetail->getYear(), $this->sectionDetail->getSemester()); $this->forward404Unless($this->promotionInfo); //$this->enrollmentsToCreate[] = Array(); ## Create section, $this->sectionToCreate = new ProgramSection(); $this->sectionToCreate->setProgramId($this->sectionDetail->getProgramId()); $this->sectionToCreate->setCenterId($this->sectionDetail->getCenterId()); $this->sectionToCreate->setAcademicCalendarId($this->sectionDetail->getAcademicCalendarId()); $academicYearToSave = ProgramSectionActions::getNextACYearForSection($this->sectionDetail->getYear(), $this->sectionDetail->getSemester(), $this->sectionDetail->getAcademicYear()); $this->sectionToCreate->setAcademicYear($academicYearToSave); $this->sectionToCreate->setYear($this->promotionInfo->getToYear()); $this->sectionToCreate->setSemester($this->promotionInfo->getToSemester()); $this->sectionToCreate->setSectionNumber($this->sectionDetail->getSectionNumber()); $this->sectionToCreate->setIsActivated(TRUE); $this->sectionToCreate->save(); $this->sectionDetail->setIsPromoted(TRUE); //$this->sectionDetail->setIsActivated(TRUE); $this->sectionDetail->save(); foreach ($enrollments as $enrollment) { ## get student status with given ENROLLMENT, $status = Statuses::getStudentStatus($enrollment); if ($status == 'PASS' || $status == 'WARNING') { $this->enrollmentsToCreate = new EnrollmentInfo(); $this->enrollmentsToCreate->setStudentId($enrollment->getStudentId()); $this->enrollmentsToCreate->setAcademicYear($this->promotionInfo->getToAcademicYear()); $this->enrollmentsToCreate->setYear($this->promotionInfo->getToYear()); $this->enrollmentsToCreate->setSemester($this->promotionInfo->getToSemester()); $this->enrollmentsToCreate->setSectionId($this->sectionToCreate->getId()); $this->enrollmentsToCreate->setProgramId($enrollment->getProgramId()); $this->enrollmentsToCreate->setTotalChrs($enrollment->getTotalChrs()); $this->enrollmentsToCreate->setTotalGradePoints($enrollment->getTotalGradePoints()); $this->enrollmentsToCreate->setTotalRepeatedChrs($enrollment->getTotalRepeatedChrs()); $this->enrollmentsToCreate->setTotalRepeatedGradePoints($enrollment->getTotalRepeatedGradePoints()); $this->enrollmentsToCreate->setPreviousChrs($enrollment->getSemesterChrs()); $this->enrollmentsToCreate->setPreviousGradePoints($enrollment->getSemesterGradePoints()); $this->enrollmentsToCreate->setPreviousRepeatedChrs($enrollment->getSemesterRepeatedChrs()); $this->enrollmentsToCreate->setPreviousRepeatedGradePoints($enrollment->getSemesterRepeatedGradePoints()); $this->enrollmentsToCreate->save(); $studentIds[] = $enrollment->getStudentId(); $this->enrollmentCount = $i; $i++; } } $this->getUser()->setFlash('notice', 'Promotion was successfull'); $this->redirect('programsection/index'); }
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'); }
?> </td> </tr> <tr> <td align='left' valign='top'>Cumulative</td> <td align='left' valign='top'><?php echo Statuses::getTotalCreditHours($student->getEnrollmentInfos(), $sectionDetail->getYear(), $sectionDetail->getSemester()); ?> </td> <td align='right' valign='top'><?php echo Statuses::getTotalGradePoints($student->getEnrollmentInfos(), $sectionDetail->getYear(), $sectionDetail->getSemester()); ?> </td> <td align='right' valign='top'> <?php echo Statuses::getCGPA($student->getEnrollmentInfos(), $sectionDetail->getYear(), $sectionDetail->getSemester()); ?> </td> </tr> </table></td> </tr> </table> <table width='686' style='font-size:11px;' cellpadding='5px'> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2'> </td> </tr>
/** * Create a new widget for the dashboard */ public function widgetsAction() { $auth = Zend_Auth::getInstance(); $translator = Shineisp_Registry::getInstance()->Zend_Translate; $auth->setStorage(new Zend_Auth_Storage_Session('admin')); $id = $this->getRequest()->getParam('id', 'widget_' . rand()); $icon = $this->getRequest()->getParam('icon', 'fa fa-file'); $type = $this->getRequest()->getParam('type'); $title = $this->getRequest()->getParam('title'); $buttons = array(); if (!empty($id)) { $widget = new Shineisp_Commons_Widgets(); $widget->setId($id); // Ajax load of the widgets // Get only the new orders if ($type == "new_order_widget") { $records = Orders::Last(array(Statuses::id("tobepaid", "orders"))); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/orders/edit/id/%d")); $widget->setBasepath('/admin/orders/')->setIdxfield($records['index'])->setButtons($buttons); // Get all the pending, processing, and paid orders to be complete } elseif ($type == 'processing_order_widget') { $statuses = array(Statuses::id("processing", "orders"), Statuses::id("pending", "orders"), Statuses::id("paid", "orders")); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/orders/edit/id/%d")); $records = Orders::Last($statuses); $widget->setBasepath('/admin/orders/')->setIdxfield($records['index'])->setButtons($buttons); // Get all the services / order items next to the expiration date from -10 days to 30 days } elseif ($type == 'recurring_services_widget') { $records = OrdersItems::getServices(); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/ordersitems/edit/id/%d")); $widget->setBasepath('/admin/ordersitems/')->setIdxfield($records['index'])->setButtons($buttons); // Get the last 5 tickets opened by the customers } elseif ($type == 'last_tickets_widget') { $records = Tickets::Last(null, 5); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/tickets/edit/id/%d")); $widget->setBasepath('/admin/tickets/')->setIdxfield($records['index'])->setButtons($buttons); // get the last domain tasks to be executed } elseif ($type == 'last_domain_tasks_widget') { $records = DomainsTasks::Last(); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/domainstasks/edit/id/%d")); $widget->setBasepath('/admin/domainstasks/')->setIdxfield($records['index'])->setButtons($buttons); // get the last ISP panel tasks to be executed } elseif ($type == 'last_panel_tasks_widget') { $records = PanelsActions::Last(); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/panelsactions/edit/id/%d")); $widget->setBasepath('/admin/panelsactions/')->setIdxfield($records['index'])->setButtons($buttons); // get the domains next the expiration date } elseif ($type == 'expiring_domain_widget') { // Create the header table columns $records['fields'] = array('expiringdate' => array('label' => $translator->translate('Expiry Date')), 'domains' => array('label' => $translator->translate('Domain')), 'days' => array('label' => $translator->translate('Days left'))); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/domains/edit/id/%d")); $records['data'] = Domains::getExpiringDomains(null, 107, -1, 5); $records['index'] = "domain_id"; $widget->setBasepath('/admin/domains/')->setIdxfield($records['index'])->setButtons($buttons); // get the messages/notes posted by the customers within the orders } elseif ($type == 'order_messages_widget') { $records = Messages::Last('orders'); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/orders/edit/id/%d")); $widget->setBasepath('/admin/orders/')->setIdxfield($records['index'])->setButtons($buttons); // get the messages/notes posted by the customers within the domain } elseif ($type == 'domain_messages_widget') { $records = Messages::Last('domains'); $buttons = array('edit' => array('label' => $translator->translate('Edit'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/domains/edit/id/%d")); $widget->setBasepath('/admin/domains/')->setIdxfield($records['index'])->setButtons($buttons); // get the list of your best customers } elseif ($type == 'customers_parade_widget') { $buttons = array('edit' => array('label' => $translator->translate('Show'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/customers/edit/id/%d")); $records = Customers::Hitparade(); $widget->setBasepath('/admin/customers/')->setIdxfield($records['index'])->setButtons($buttons); // get the customer status summary } elseif ($type == 'customer_summary_widget') { $records = Customers::summary(); // get the tickets summary } elseif ($type == 'ticket_summary_widget') { $records = Tickets::summary(); // get the domains summary } elseif ($type == 'summary_domains_widget') { $records = Domains::summary(); // get the product reviews stats } elseif ($type == 'product_reviews_widget') { $records = Reviews::summary(); // get the bestseller product stats } elseif ($type == 'bestseller_widget') { $buttons = array('edit' => array('label' => $translator->translate('Show'), 'cssicon' => 'glyphicon glyphicon-pencil', 'action' => "/admin/products/edit/id/%d")); $records = Products::summary(); $widget->setBasepath('/admin/products/')->setIdxfield($records['index'])->setButtons($buttons); // get the last ISP notes } elseif ($type == 'notes_widget') { $user = $auth->getIdentity(); $records = Notes::summary($user['user_id']); $widget->setBasepath('/admin/notes/'); } else { die('No widget type has been selected: ' . $type); } // Records Builtin columns. The code get the field names as header column name if (!empty($records['fields'])) { foreach ($records['fields'] as $field => $column) { $column['alias'] = !empty($column['alias']) ? $column['alias'] : $field; $widget->setColumn($field, $column); } } if (!empty($records['data'])) { $widget->setIcon($icon)->setLabel($title)->setRecords($records['data']); die($widget->create()); } } die; }