Custom fields were not saving
This commit is contained in:
parent
3307cc8645
commit
73724bdd04
|
@ -125,13 +125,16 @@ class BillingController extends Zend_Controller_Action {
|
|||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
|
||||
|
||||
$credentials = self::getAPICredentials();
|
||||
|
||||
$postfields = array();
|
||||
$postfields["username"] = $credentials["username"];
|
||||
$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;
|
||||
|
@ -140,7 +143,7 @@ class BillingController extends Zend_Controller_Action {
|
|||
$postfields = array_merge($postfields, $formData);
|
||||
unset($postfields["password2verify"]);
|
||||
unset($postfields["submit"]);
|
||||
|
||||
|
||||
$query_string = "";
|
||||
foreach ($postfields as $k=>$v) $query_string .= "$k=".urlencode($v)."&";
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue