Beispiel #1
0
 public function init()
 {
     $this->setDecorators([['ViewScript', ['viewScript' => 'vlan-interface/forms/vlan-interface.phtml']]]);
     $virtualInterface = $this->createElement('hidden', 'virtualinterfaceid');
     $this->addElement($virtualInterface);
     $this->addElement(IXP_Form_Vlan::getPopulatedSelect('vlanid'));
     $this->getElement('vlanid')->setAttrib('class', 'chzn-select span6');
     $ipv4enabled = $this->createElement('checkbox', 'ipv4enabled');
     $ipv4enabled->setLabel('IPv4 Enabled')->setCheckedValue('1');
     $this->addElement($ipv4enabled);
     $ipv4addressid = new OSS_Form_Element_DatabaseDropdown('ipv4addressid');
     $ipv4addressid->setRequired(false)->setChosenOptions(["0" => ""])->setLabel('IPv4 Address')->addFilter('StringTrim')->setErrorMessages(array('Please select or enter a IPv4 address'));
     $this->addElement($ipv4addressid);
     $ipv4hostname = $this->createElement('text', 'ipv4hostname');
     $ipv4hostname->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->addValidator('hostname', false, ['allow' => Zend_Validate_Hostname::ALLOW_DNS])->setLabel('IPv4 Hostname')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv4hostname);
     $ipv4bgpmd5secret = $this->createElement('text', 'ipv4bgpmd5secret');
     $ipv4bgpmd5secret->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->setLabel('IPv4 BGP MD5 Secret')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv4bgpmd5secret);
     $ipv4canping = $this->createElement('checkbox', 'ipv4canping');
     $ipv4canping->setLabel('IPv4 Can Ping')->setCheckedValue('1');
     $this->addElement($ipv4canping);
     $ipv4monitorrcbgp = $this->createElement('checkbox', 'ipv4monitorrcbgp');
     $ipv4monitorrcbgp->setLabel('IPv4 Monitor RC BGP')->setCheckedValue('1');
     $this->addElement($ipv4monitorrcbgp);
     $this->addDisplayGroup(['ipv4addressid', 'ipv4hostname', 'ipv4bgpmd5secret', 'ipv4canping', 'ipv4monitorrcbgp'], 'ipv4DisplayGroup');
     $this->getDisplayGroup('ipv4DisplayGroup')->setLegend('IPv4 Details');
     $ipv6enabled = $this->createElement('checkbox', 'ipv6enabled');
     $ipv6enabled->setLabel('IPv6 Enabled')->setCheckedValue('1');
     $this->addElement($ipv6enabled);
     $ipv6addressid = new OSS_Form_Element_DatabaseDropdown('ipv6addressid');
     $ipv6addressid->setRequired(false)->setLabel('IPv6 Address')->setChosenOptions(["0" => ""])->addFilter('StringTrim')->setErrorMessages(array('Please select or enter a IPv6 address'));
     $this->addElement($ipv6addressid);
     $ipv6hostname = $this->createElement('text', 'ipv6hostname');
     $ipv6hostname->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->addValidator('hostname', false, ['allow' => Zend_Validate_Hostname::ALLOW_DNS])->setLabel('IPv6 Hostname')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv6hostname);
     $ipv6bgpmd5secret = $this->createElement('text', 'ipv6bgpmd5secret');
     $ipv6bgpmd5secret->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->setLabel('IPv6 BGP MD5 Secret')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv6bgpmd5secret);
     $ipv6canping = $this->createElement('checkbox', 'ipv6canping');
     $ipv6canping->setLabel('IPv6 Can Ping')->setCheckedValue('1');
     $this->addElement($ipv6canping);
     $ipv6monitorrcbgp = $this->createElement('checkbox', 'ipv6monitorrcbgp');
     $ipv6monitorrcbgp->setLabel('IPv6 Monitor RC BGP')->setCheckedValue('1');
     $this->addElement($ipv6monitorrcbgp);
     $this->addDisplayGroup(array('ipv6addressid', 'ipv6hostname', 'ipv6bgpmd5secret', 'ipv6canping', 'ipv6monitorrcbgp'), 'ipv6DisplayGroup');
     $this->getDisplayGroup('ipv6DisplayGroup')->setLegend('IPv6 Details');
     $irrdbfilter = $this->createElement('checkbox', 'irrdbfilter');
     $irrdbfilter->setLabel('Apply IRRDB Filtering')->setValue('1')->setCheckedValue('1');
     $this->addElement($irrdbfilter);
     $mcastenabled = $this->createElement('checkbox', 'mcastenabled');
     $mcastenabled->setLabel('Multicast Enabled')->setCheckedValue('1');
     $this->addElement($mcastenabled);
     $maxbgpprefix = $this->createElement('text', 'maxbgpprefix');
     $maxbgpprefix->addValidator('int')->addValidator('greaterThan', false, array(-1))->setRequired(false)->setLabel('Max BGP Prefixes');
     $this->addElement($maxbgpprefix);
     $rsclient = $this->createElement('checkbox', 'rsclient');
     $rsclient->setLabel('Route Server Client')->setCheckedValue('1');
     $this->addElement($rsclient);
     $as112client = $this->createElement('checkbox', 'as112client');
     $as112client->setLabel('AS112 Client')->setCheckedValue('1');
     $this->addElement($as112client);
     $busyhost = $this->createElement('checkbox', 'busyhost');
     $busyhost->setLabel('Busy host')->setCheckedValue('1');
     $this->addElement($busyhost);
     $notes = $this->createElement('textarea', 'notes');
     $notes->setLabel('Notes')->setRequired(false)->setAttrib('class', 'span3')->addFilter(new OSS_Filter_StripSlashes())->setAttrib('cols', 60)->setAttrib('rows', 5);
     $this->addElement($notes);
     $this->addElement(self::createSubmitElement('submit', _('Add')));
     $this->addElement($this->createCancelElement());
     $preselectIPv4Address = $this->createElement('hidden', 'preselectIPv4Address');
     $this->addElement($preselectIPv4Address);
     $preselectIPv6Address = $this->createElement('hidden', 'preselectIPv6Address');
     $this->addElement($preselectIPv6Address);
     $preselectVlanInterface = $this->createElement('hidden', 'preselectVlanInterface');
     $this->addElement($preselectVlanInterface);
     $preselectCustomer = $this->createElement('hidden', 'preselectCustomer');
     $this->addElement($preselectCustomer);
 }
Beispiel #2
0
 public function init()
 {
     $this->setDecorators([['ViewScript', ['viewScript' => 'virtual-interface/forms/add-wizard.phtml']]]);
     $this->addElement(IXP_Form_Customer::getPopulatedSelect('custid'));
     $this->getElement('custid')->setAttrib('class', 'chzn-select span12');
     ////////////////////////////////////////////////////////////////////////////////////////////////////
     // VIRTUAL INTERFACE DETAILS
     $name = $this->createElement('text', 'name');
     $name->addValidator('stringLength', false, array(0, 255, 'UTF-8'))->setRequired(false)->setLabel('Virtual Interface Name')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($name);
     $descr = $this->createElement('text', 'description');
     $descr->setLabel('Description')->addValidator('stringLength', false, array(0, 255, 'UTF-8'))->setRequired(false)->addFilter(new OSS_Filter_StripSlashes())->addFilter('StringTrim');
     $this->addElement($descr);
     $channel = $this->createElement('text', 'channelgroup');
     $channel->addValidator('int')->setLabel('Channel Group Number')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($channel);
     $mtu = $this->createElement('text', 'mtu');
     $mtu->addValidator('int')->setLabel('MTU')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($mtu);
     $trunk = $this->createElement('checkbox', 'trunk');
     $trunk->setLabel('Is 802.1q Trunk?')->setCheckedValue('1');
     $this->addElement($trunk);
     $this->addDisplayGroup(array('name', 'description', 'channelgroup', 'mtu', 'trunk'), 'virtualInterfaceDisplayGroup');
     $this->getDisplayGroup('virtualInterfaceDisplayGroup')->setLegend('Virtual Interface Details');
     /////////////////////////////////////////////////////////////////////////////////////////////////////
     // PHYSICAL INTERFACE DETAILS
     $this->addElement(IXP_Form_Switch::getPopulatedSelect('switchid'));
     $this->getElement('switchid')->setAttrib('class', 'chzn-select span12');
     $switchPorts = $this->createElement('select', 'switchportid');
     $switchPorts->setRequired(true)->setRegisterInArrayValidator(false)->setLabel('Port')->setAttrib('class', 'chzn-select span12')->addValidator('greaterThan', false, array('min' => 1))->setErrorMessages(array('Please select a switch port'));
     $this->addElement($switchPorts);
     $status = $this->createElement('select', 'status');
     $status->setMultiOptions(\Entities\PhysicalInterface::$STATES)->setRegisterInArrayValidator(true)->setAttrib('class', 'chzn-select span12')->setLabel('Status')->setErrorMessages(array('Please set the status'));
     $this->addElement($status);
     $speed = $this->createElement('select', 'speed');
     $speed->setMultiOptions(\Entities\PhysicalInterface::$SPEED)->setRegisterInArrayValidator(true)->setAttrib('class', 'chzn-select span12')->setLabel('Speed')->setErrorMessages(array('Please set the speed'));
     $this->addElement($speed);
     $duplex = $this->createElement('select', 'duplex');
     $duplex->setMultiOptions(\Entities\PhysicalInterface::$DUPLEX)->setRegisterInArrayValidator(true)->setAttrib('class', 'chzn-select span12')->setLabel('Duplex')->setErrorMessages(array('Please set the duplex'));
     $this->addElement($duplex);
     $this->addDisplayGroup(['switchid', 'switchportid', 'status', 'speed', 'duplex'], 'physicalInterfaceDisplayGroup');
     $this->getDisplayGroup('physicalInterfaceDisplayGroup')->setLegend('Physical Interface Details');
     //////////////////////////////////////////////////////////////////////////
     // VLAN INTERFACE DETAILS
     $this->addElement(IXP_Form_Vlan::getPopulatedSelect('vlanid'));
     $this->getElement('vlanid')->setAttrib('class', 'chzn-select span12');
     $ipv4enabled = $this->createElement('checkbox', 'ipv4enabled');
     $ipv4enabled->setLabel('IPv4 Enabled')->setCheckedValue('1');
     $this->addElement($ipv4enabled);
     $ipv4addressid = new OSS_Form_Element_DatabaseDropdown('ipv4addressid');
     $ipv4addressid->setRequired(false)->setChosenOptions(["0" => ""])->setLabel('IPv4 Address')->addFilter('StringTrim')->setErrorMessages(array('Please select or enter a IPv4 address'));
     $this->addElement($ipv4addressid);
     $ipv4hostname = $this->createElement('text', 'ipv4hostname');
     $ipv4hostname->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->addValidator('hostname', false, ['allow' => Zend_Validate_Hostname::ALLOW_DNS])->setLabel('IPv4 Hostname')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv4hostname);
     $ipv4bgpmd5secret = $this->createElement('text', 'ipv4bgpmd5secret');
     $ipv4bgpmd5secret->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->setLabel('IPv4 BGP MD5 Secret')->setAttrib('class', 'span10')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv4bgpmd5secret);
     $ipv4canping = $this->createElement('checkbox', 'ipv4canping');
     $ipv4canping->setLabel('IPv4 Can Ping')->setCheckedValue('1');
     $this->addElement($ipv4canping);
     $ipv4monitorrcbgp = $this->createElement('checkbox', 'ipv4monitorrcbgp');
     $ipv4monitorrcbgp->setLabel('IPv4 Monitor RC BGP')->setCheckedValue('1');
     $this->addElement($ipv4monitorrcbgp);
     $this->addDisplayGroup(['ipv4addressid', 'ipv4hostname', 'ipv4bgpmd5secret', 'ipv4canping', 'ipv4monitorrcbgp'], 'ipv4DisplayGroup');
     $this->getDisplayGroup('ipv4DisplayGroup')->setLegend('IPv4 Details');
     $ipv6enabled = $this->createElement('checkbox', 'ipv6enabled');
     $ipv6enabled->setLabel('IPv6 Enabled')->setCheckedValue('1');
     $this->addElement($ipv6enabled);
     $ipv6addressid = new OSS_Form_Element_DatabaseDropdown('ipv6addressid');
     $ipv6addressid->setRequired(false)->setLabel('IPv6 Address')->setChosenOptions(["0" => ""])->addFilter('StringTrim')->setErrorMessages(array('Please select or enter a IPv6 address'));
     $this->addElement($ipv6addressid);
     $ipv6hostname = $this->createElement('text', 'ipv6hostname');
     $ipv6hostname->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->addValidator('hostname', false, ['allow' => Zend_Validate_Hostname::ALLOW_DNS])->setLabel('IPv6 Hostname')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv6hostname);
     $ipv6bgpmd5secret = $this->createElement('text', 'ipv6bgpmd5secret');
     $ipv6bgpmd5secret->addValidator('stringLength', false, array(1, 64, 'UTF-8'))->setLabel('IPv6 BGP MD5 Secret')->setAttrib('class', 'span10')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($ipv6bgpmd5secret);
     $ipv6canping = $this->createElement('checkbox', 'ipv6canping');
     $ipv6canping->setLabel('IPv6 Can Ping')->setCheckedValue('1');
     $this->addElement($ipv6canping);
     $ipv6monitorrcbgp = $this->createElement('checkbox', 'ipv6monitorrcbgp');
     $ipv6monitorrcbgp->setLabel('IPv6 Monitor RC BGP')->setCheckedValue('1');
     $this->addElement($ipv6monitorrcbgp);
     $this->addDisplayGroup(['ipv6addressid', 'ipv6hostname', 'ipv6bgpmd5secret', 'ipv6canping', 'ipv6monitorrcbgp'], 'ipv6DisplayGroup');
     $this->getDisplayGroup('ipv6DisplayGroup')->setLegend('IPv6 Details');
     $irrdbfilter = $this->createElement('checkbox', 'irrdbfilter');
     $irrdbfilter->setLabel('Apply IRRDB Filtering')->setValue('1')->setCheckedValue('1');
     $this->addElement($irrdbfilter);
     $mcastenabled = $this->createElement('checkbox', 'mcastenabled');
     $mcastenabled->setLabel('Multicast Enabled')->setCheckedValue('1');
     $this->addElement($mcastenabled);
     $maxbgpprefix = $this->createElement('text', 'maxbgpprefix');
     $maxbgpprefix->addValidator('int')->addValidator('greaterThan', false, array(-1))->setRequired(false)->setLabel('Max BGP Prefixes');
     $this->addElement($maxbgpprefix);
     $rsclient = $this->createElement('checkbox', 'rsclient');
     $rsclient->setLabel('Route Server Client')->setCheckedValue('1');
     $this->addElement($rsclient);
     $as112client = $this->createElement('checkbox', 'as112client');
     $as112client->setLabel('AS112 Client')->setCheckedValue('1');
     $this->addElement($as112client);
     $busyhost = $this->createElement('checkbox', 'busyhost');
     $busyhost->setLabel('Busy host')->setCheckedValue('1');
     $this->addElement($busyhost);
     $this->addDisplayGroup(['irrdbfilter', 'mcastenabled', 'maxbgpprefix', 'rsclient', 'as112client', 'busyhost'], 'vlanInterfaceDisplayGroup');
     $this->getDisplayGroup('vlanInterfaceDisplayGroup')->setLegend('Other VLAN Interface Settings');
     $this->addElement(self::createSubmitElement('submit', _('Add')));
     $this->addElement($this->createCancelElement());
     $preselectIPv4Address = $this->createElement('hidden', 'preselectIPv4Address');
     $this->addElement($preselectIPv4Address);
     $preselectIPv6Address = $this->createElement('hidden', 'preselectIPv6Address');
     $this->addElement($preselectIPv6Address);
     $preselectVlanInterface = $this->createElement('hidden', 'preselectVlanInterface');
     $this->addElement($preselectVlanInterface);
     $preselectSwitchPort = $this->createElement('hidden', 'preselectSwitchPort');
     $this->addElement($preselectSwitchPort);
     $preselectPhysicalInterface = $this->createElement('hidden', 'preselectPhysicalInterface');
     $this->addElement($preselectPhysicalInterface);
 }
 public function init()
 {
     $this->setDecorators([['ViewScript', ['viewScript' => 'customer/forms/billing-registration.phtml']]]);
     $billingContact = $this->createElement('text', 'billingContactName');
     $billingContact->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setLabel('Contact')->addFilter('StringTrim')->setAttrib('class', 'span6')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingContact);
     $billingAddress1 = $this->createElement('text', 'billingAddress1');
     $billingAddress1->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setLabel('Address')->setAttrib('class', 'span6')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingAddress1);
     $billingAddress2 = $this->createElement('text', 'billingAddress2');
     $billingAddress2->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span6')->setLabel('')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingAddress2);
     $billingAddress3 = $this->createElement('text', 'billingAddress3');
     $billingAddress3->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span6')->setLabel('')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingAddress3);
     $billingTownCity = $this->createElement('text', 'billingTownCity');
     $billingTownCity->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span4')->setLabel('City')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingTownCity);
     $billingCountry = $this->createElement('select', 'billingCountry');
     $billingCountry->setMultiOptions(["" => ""] + OSS_Countries::getCountriesArray())->setRegisterInArrayValidator(true)->setValue("")->setLabel('Country')->setRequired(false)->setAttrib('class', 'chzn-select span6');
     $this->addElement($billingCountry);
     $billingPostcode = $this->createElement('text', 'billingPostcode');
     $billingPostcode->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span4')->setLabel('Postcode')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingPostcode);
     $billingEmail = $this->createElement('text', 'billingEmail');
     $billingEmail->addValidator('emailAddress')->setRequired(false)->setAttrib('class', 'span6')->setAttrib('placeholder', '*****@*****.**')->setLabel('E-Mail')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingEmail);
     $billingTelephone = $this->createElement('text', 'billingTelephone');
     $billingTelephone->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span6')->setAttrib('placeholder', '+353 1 234 5678')->setLabel('Telephone')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($billingTelephone);
     $invoiceMethod = $this->createElement('select', 'invoiceMethod');
     $invoiceMethod->setMultiOptions(['' => ''] + \Entities\CompanyBillingDetail::$INVOICE_METHODS)->setRegisterInArrayValidator(true)->setLabel('Invoice Method')->setRequired(false)->setAttrib('class', 'chzn-select-deselect span6');
     $this->addElement($invoiceMethod);
     $purchaseOrderRequired = $this->createElement('checkbox', 'purchaseOrderRequired');
     $purchaseOrderRequired->setLabel('Purchase Order Required')->setValue('0')->addValidator('InArray', false, [[0, 1]])->addFilter('Int');
     $this->addElement($purchaseOrderRequired);
     $billingFrequency = $this->createElement('select', 'billingFrequency');
     $billingFrequency->setMultiOptions(['' => ''] + \Entities\CompanyBillingDetail::$BILLING_FREQUENCIES)->setRegisterInArrayValidator(true)->setLabel('Billing Frequency')->setRequired(false)->setAttrib('class', 'chzn-select-deselect span6');
     $this->addElement($billingFrequency);
     $invoiceEmail = $this->createElement('text', 'invoiceEmail');
     $invoiceEmail->addValidator('emailAddress')->setRequired(false)->setAttrib('class', 'span6')->setAttrib('placeholder', '*****@*****.**')->setLabel('Invoice E-Mail')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($invoiceEmail);
     $vatNumber = $this->createElement('text', 'vatNumber');
     $vatNumber->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span6')->setLabel('VAT Number')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($vatNumber);
     $vatRate = $this->createElement('text', 'vatRate');
     $vatRate->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span4')->setLabel('VAT Rate')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($vatRate);
     $registeredName = $this->createElement('text', 'registeredName');
     $registeredName->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setLabel('Registered Name')->addFilter('StringTrim')->setAttrib('class', 'span6')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($registeredName);
     $companyNumber = $this->createElement('text', 'companyNumber');
     $companyNumber->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setLabel('Company Number')->addFilter('StringTrim')->setAttrib('class', 'span6')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($companyNumber);
     $jurisdiction = new OSS_Form_Element_DatabaseDropdown('jurisdiction', ['dql' => 'select crd.jurisdiction from \\Entities\\CompanyRegisteredDetail crd WHERE crd.jurisdiction IS NOT NULL']);
     $jurisdiction->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setLabel('Jurisdiction')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($jurisdiction);
     $address1 = $this->createElement('text', 'address1');
     $address1->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setLabel('Address')->setAttrib('class', 'span6')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($address1);
     $address2 = $this->createElement('text', 'address2');
     $address2->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span6')->setLabel('')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($address2);
     $address3 = $this->createElement('text', 'address3');
     $address3->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span6')->setLabel('')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($address3);
     $townCity = $this->createElement('text', 'townCity');
     $townCity->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span4')->setLabel('City')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($townCity);
     $country = $this->createElement('select', 'country');
     $country->setMultiOptions(["" => ""] + OSS_Countries::getCountriesArray())->setRegisterInArrayValidator(true)->setValue("")->setLabel('Country')->setRequired(false)->setAttrib('class', 'chzn-select span6');
     $this->addElement($country);
     $postcode = $this->createElement('text', 'postcode');
     $postcode->addValidator('stringLength', false, array(0, 64, 'UTF-8'))->setRequired(false)->setAttrib('class', 'span4')->setLabel('Postcode')->addFilter('StringTrim')->addFilter(new OSS_Filter_StripSlashes());
     $this->addElement($postcode);
     $this->addDisplayGroup(['billingContact', 'billingAddress1', 'billingAddress2', 'billingTownCity', 'billingCountry'], 'billingDisplayGroup');
     $this->getDisplayGroup('billingDisplayGroup')->setLegend('Billing Details');
     $this->addElement(self::createSubmitElement('submit', _('Save Changes')));
     $this->addElement($this->createCancelElement());
 }