Example #1
0
 /**
  * Saving dns zones
  * 
  * 
  * @params integer $id 
  * @params array $zones 
  * @return ARRAY Record
  */
 public static function saveZone($domainId, $zones)
 {
     Doctrine::getTable('Dns_Zones')->findBy('domain_id', $domainId)->delete();
     if (count($zones) > 0) {
         $myzone = new Doctrine_Collection('Dns_Zones');
         $i = 0;
         foreach ($zones as $zone) {
             $dnszonetype = Dns_Zones_Types::getType($zone['fieldtype']);
             $myzone[$i]->domain_id = $domainId;
             $myzone[$i]->subdomain = $zone['subdomain'];
             $myzone[$i]->type_id = $dnszonetype;
             $myzone[$i]->target = $zone['target'];
             $myzone[$i]->updating_date = date('Y-m-d H:i:s');
             $i++;
         }
         $myzone->save();
         return true;
     }
     return false;
 }
Example #2
0
 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', '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');
 }
Example #3
0
 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');
 }