Merge remote-tracking branch 'upstream/7.0' into 7.0

This commit is contained in:
Juanjo Menent 2018-12-29 15:07:09 +01:00
commit cf64053fa5
30 changed files with 66 additions and 30 deletions

View File

@ -840,7 +840,7 @@ if (empty($action) || $action == 'view') {
// Test that setup is complete
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0';
$resql = $db->query($sql);
if ($resql)
{

View File

@ -582,13 +582,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++;
}

View File

@ -120,7 +120,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{
// Creation user
$company = new Societe($db);
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'));
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'), GETPOST('customercode', 'alpha'));
if ($result < 0)
{
@ -1011,6 +1011,15 @@ if ($rowid > 0)
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
);
// If customer code was forced to "required", we ask it at creation to avoid error later
if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED))
{
$tmpcompany = new Societe($db);
$tmpcompany->name=$companyname;
$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);
}

View File

@ -4579,6 +4579,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;
}

View File

@ -1355,7 +1355,7 @@ class Form
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
}
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>';
if ($htmlname != 'none' && ! $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>';
if ($showempty == 1) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>&nbsp;</option>';
if ($showempty == 2) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans("Internal").'</option>';
$num = $this->db->num_rows($resql);
@ -1417,7 +1417,7 @@ class Form
{
$out.= '<option value="-1"'.($showempty==2?'':' selected').' disabled>'.$langs->trans($socid?"NoContactDefinedForThirdParty":"NoContactDefined").'</option>';
}
if ($htmlname != 'none' || $options_only)
if ($htmlname != 'none' && ! $options_only)
{
$out.= '</select>';
}

View File

@ -589,8 +589,8 @@ class FormCompany
runJsCodeForEvent'.$htmlname.'(values);
}
});
/* Clean contact */
$("div#s2id_contactid>a>span").html(\'\');
$(this).trigger("blur");
});
// Function used to execute events when search_htmlname change

View File

@ -149,6 +149,7 @@ class pdf_ban extends ModeleBankAccountDoc
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -158,6 +158,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -129,6 +129,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -251,6 +251,7 @@ class pdf_einstein extends ModelePDFCommandes
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
if (class_exists('TCPDF'))
{

View File

@ -176,6 +176,7 @@ class pdf_strato extends ModelePDFContract
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -163,6 +163,7 @@ class pdf_merou extends ModelePdfExpedition
$heightforinfotot = 0; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -225,6 +225,7 @@ class pdf_rouget extends ModelePdfExpedition
$heightforinfotot = 8; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -205,6 +205,7 @@ class pdf_standard extends ModeleExpenseReport
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -268,6 +268,7 @@ class pdf_crabe extends ModelePDFFactures
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
if (class_exists('TCPDF'))
{

View File

@ -166,6 +166,7 @@ class pdf_soleil extends ModelePDFFicheinter
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -195,6 +195,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$heightforinfotot = 30; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -80,7 +80,7 @@ class modAccounting extends DolibarrModules
"MAIN_COMPANY_CODE_ALWAYS_REQUIRED",
"chaine",
"1",
"With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 0
"With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 1
);
$this->const[2] = array(
"MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED",

View File

@ -195,6 +195,7 @@ class pdf_standard extends ModelePDFProduct
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
if (class_exists('TCPDF'))
{

View File

@ -154,6 +154,7 @@ class pdf_baleine extends ModelePDFProjects
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
if (class_exists('TCPDF'))
{

View File

@ -172,6 +172,7 @@ class pdf_beluga extends ModelePDFProjects
$heightforinfotot = 40; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
if (class_exists('TCPDF'))
{
@ -256,7 +257,7 @@ class pdf_beluga extends ModelePDFProjects
$iniY = $tab_top + $heightoftitleline + 1;
$curY = $tab_top + $heightoftitleline + 1;
$nexY = $tab_top + $heightoftitleline + 1;
$listofreferent=array(
'propal'=>array(
'name'=>"Proposals",
@ -371,8 +372,8 @@ class pdf_beluga extends ModelePDFProjects
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
if ($key == 'agenda')
if ($key == 'agenda')
{
// var_dump($elementarray);
}
@ -381,11 +382,11 @@ class pdf_beluga extends ModelePDFProjects
if ($num >= 0)
{
$nexY = $pdf->GetY() + 5;
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
@ -421,7 +422,7 @@ class pdf_beluga extends ModelePDFProjects
$num = count($elementarray);
// Loop on each lines
for ($i = 0; $i < $num; $i ++)
for ($i = 0; $i < $num; $i ++)
{
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
@ -499,10 +500,10 @@ class pdf_beluga extends ModelePDFProjects
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$curY = $tab_top_newpage + $heightoftitleline + 1;
// Label
$pdf->SetXY($this->posxref, $curY);
$posybefore=$pdf->GetY();
@ -560,7 +561,7 @@ class pdf_beluga extends ModelePDFProjects
{
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty)?$element->thirdparty->name:''), 1, 'L');
}
// Amount without tax
if (empty($value['disableamount'])) {
$pdf->SetXY($this->posxamountht, $curY);
@ -613,7 +614,7 @@ class pdf_beluga extends ModelePDFProjects
$curY = $nexY;
}
}
$nexY+=2; // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages
@ -778,7 +779,7 @@ class pdf_beluga extends ModelePDFProjects
$pdf->SetXY($posx,$posy);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty->getFullName($outputlangs), '', 'R');
}
$pdf->SetTextColor(0,0,60);
}

View File

@ -330,6 +330,7 @@ class pdf_azur extends ModelePDFPropales
$heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0;
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
//print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);

View File

@ -211,6 +211,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -261,6 +261,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -217,6 +217,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -239,6 +239,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))

View File

@ -436,9 +436,10 @@ class InterfaceLdapsynchro extends DolibarrTriggers
// For member type
if (! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE) && (string) $conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1')
{
$membertype=new AdherentType($this->db);
if ($object->typeid > 0)
{
require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
$membertype=new AdherentType($this->db);
$membertype->fetch($object->typeid);
$membertype->listMembersForMemberType();
@ -555,6 +556,8 @@ class InterfaceLdapsynchro extends DolibarrTriggers
// For member type
if (! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE) && (string) $conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1')
{
require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
/*
* Change member info
*/
@ -679,6 +682,8 @@ class InterfaceLdapsynchro extends DolibarrTriggers
{
if ($object->typeid > 0)
{
require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php";
/*
* Remove member in member type
*/

View File

@ -1440,7 +1440,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_
// Il doit au moins y avoir la ligne de prix initial.
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
$object->updatePrice($object->price, $object->price_base_type, $user, $newprice_min);
$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
$result = $db->query($sql);
$num = $db->num_rows($result);

View File

@ -3079,12 +3079,13 @@ class Societe extends CommonObject
/**
* Create a third party into database from a member object
*
* @param Adherent $member Object member
* @param string $socname Name of third party to force
* @param string $socalias Alias name of third party to force
* @return int <0 if KO, id of created account if OK
* @param Adherent $member Object member
* @param string $socname Name of third party to force
* @param string $socalias Alias name of third party to force
* @param string $customercode Customer code
* @return int <0 if KO, id of created account if OK
*/
function create_from_member(Adherent $member, $socname='', $socalias='')
function create_from_member(Adherent $member, $socname='', $socalias='', $customercode='')
{
global $user,$langs;
@ -3107,7 +3108,7 @@ class Societe extends CommonObject
$this->skype=$member->skype;
$this->client = 1; // A member is a customer by default
$this->code_client = -1;
$this->code_client = ($customercode?$customercode:-1);
$this->code_fournisseur = -1;
$this->db->begin();

View File

@ -602,7 +602,7 @@ if (empty($reshook)) {
$trigger_name='USER_SENTBYMAIL';
$paramname='id'; // Name of param key to open the card
$mode='emailfromuser';
$trackid='use'.$object->id;
$trackid='use'.$id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
// Actions to build doc
@ -1183,7 +1183,7 @@ else
// Check if user has rights
$object->getrights();
if (empty($object->nb_rights) && $object->statut != 0) setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings');
if (empty($object->nb_rights) && $object->statut != 0 && empty($object->admin)) setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings');
// Connexion ldap
// pour recuperer passDoNotExpire et userChangePassNextLogon