diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a5ca1691096..9d61ea07afa 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -586,13 +586,14 @@ class Adherent extends CommonObject $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; - $lthirdparty->country_id=$this->country_id; //$lthirdparty->phone_mobile=$this->phone_mobile; - $result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates + $result=$lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates + if ($result < 0) { $this->error=$lthirdparty->error; + $this->errors=$lthirdparty->errors; dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); $error++; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index dcad54e535f..53d1ff60836 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -359,7 +359,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from templae $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; @@ -862,6 +862,7 @@ if ($rowid > 0) $customercode = $tmpcompany->get_codeclient($tmpcompany,0); $formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'); } + // @TODO Add other extrafields mandatory for thirdparty creation print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c9b01a6a49d..676e76fe16a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4848,6 +4848,7 @@ abstract class CommonObject if ($this->array_options[$key] === '') $mandatorypb=true; if ($mandatorypb) { + dol_syslog($this->error); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); return -1; } @@ -6142,7 +6143,7 @@ abstract class CommonObject if (! is_object($form)) $form=new Form($db); $out = ''; - + if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { $out .= "\n"; @@ -6156,7 +6157,7 @@ abstract class CommonObject && empty($extrafields->attributes[$this->table_element]['list'][$key]) && $mode == 'view'){ continue; } - + $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) {