| @@ 161-170 (lines=10) @@ | ||
| 158 | } |
|
| 159 | ||
| 160 | // we update/add the contactperson. |
|
| 161 | if (isset($input['type']) && $input['type'] == 'corporation') { // firma |
|
| 162 | $this->contact->loadContactPerson($contact_person_id); |
|
| 163 | settype($input['contactperson'], 'string'); |
|
| 164 | settype($input['contactemail'], 'string'); |
|
| 165 | settype($input['contactphone'], 'string'); |
|
| 166 | if (!$contact_person_id = $this->contact->contactperson->save(array('name'=>$input['contactperson'], 'email'=>$input['contactemail'], 'phone'=>$input['contactphone']))) { |
|
| 167 | $this->error->merge($this->contact->getError()->getMessage()); |
|
| 168 | return false; |
|
| 169 | } |
|
| 170 | } |
|
| 171 | ||
| 172 | // currency |
|
| 173 | if (!empty($input['currency']) && strtoupper($input['currency']) != 'DKK' && $this->kernel->intranet->hasModuleAccess('currency')) { |
|
| @@ 161-170 (lines=10) @@ | ||
| 158 | } |
|
| 159 | ||
| 160 | // we update/add the contactperson. |
|
| 161 | if (isset($input['type']) && $input['type'] == 'corporation') { // firma |
|
| 162 | $this->contact->loadContactPerson($contact_person_id); |
|
| 163 | settype($input['contactperson'], 'string'); |
|
| 164 | settype($input['contactemail'], 'string'); |
|
| 165 | settype($input['contactphone'], 'string'); |
|
| 166 | if (!$contact_person_id = $this->contact->contactperson->save(array('name'=>$input['contactperson'], 'email'=>$input['contactemail'], 'phone'=>$input['contactphone']))) { |
|
| 167 | $this->error->merge($this->contact->getError()->getMessage()); |
|
| 168 | return false; |
|
| 169 | } |
|
| 170 | } |
|
| 171 | ||
| 172 | $value['contact_id'] = $this->contact->get('id'); |
|
| 173 | $value['contact_address_id'] = $this->contact->address->get('id'); |
|