Custom fields were not saving

This commit is contained in:
drigato 2014-06-24 12:46:11 -04:00
parent 3307cc8645
commit 73724bdd04
2 changed files with 11 additions and 6 deletions

View File

@ -133,6 +133,9 @@ class BillingController extends Zend_Controller_Action {
$postfields["password"] = md5($credentials["password"]);
$postfields["action"] = "updateclient";
$postfields["customfields"] = base64_encode(serialize($formData["customfields"]));
unset($formData["customfields"]);
//$postfields["clientid"] = Application_Model_Preference::GetClientId();
$postfields["clientid"] = 1846;

View File

@ -140,15 +140,16 @@ class Application_Form_BillingClient extends Zend_Form
$this->addElement($securityqans);
foreach ($client["customfields"] as $field) {
if ($field["id"] == 7) {
if ($field["id"] == "7") {
$vatvalue = $field["value"];
} elseif ($field["id"] == 71) {
} elseif ($field["id"] == "71") {
$subscribevalue = $field["value"];
}
}
$vat = new Zend_Form_Element_Text('customfield7');
$vat = new Zend_Form_Element_Text("7");
$vat->setLabel(_('VAT/Tax ID (EU only)'))
->setBelongsTo('customfields')
->setValue($vatvalue)
->setAttrib('class', 'input_text')
//->setRequired(true)
@ -156,9 +157,10 @@ class Application_Form_BillingClient extends Zend_Form
->addFilter('StringTrim');
$this->addElement($vat);
$subscribe = new Zend_Form_Element_Checkbox('customfield71');
$subscribe = new Zend_Form_Element_Checkbox('71');
$subscribe->setLabel(_('Subscribe to Sourcefabric newsletter'))
->setValue($subscribevalue)
->setBelongsTo('customfields')
->setAttrib('class', 'input_text')
->setRequired(true)
->addValidator($notEmptyValidator)