diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 6d1a5c57cf6..52de58b80b8 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -236,7 +236,7 @@ foreach($listofnotifiedevents as $notifiedevent) $s=''; // Do not use type="email" here, we must be able to enter a list of email with , separator. $arrayemail=explode(',', $value); $showwarning=0; - foreach($arrayemail as $key=>$valuedet) + foreach($arrayemail as $keydet => $valuedet) { $valuedet=trim($valuedet); if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 4d234e266e8..52ef490ceae 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -458,7 +458,7 @@ if ($mode == 'searchkey') //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; $title = $langs->trans("TranslationKeySearch"); if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; - print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit); print ''; print ''; @@ -466,7 +466,7 @@ if ($mode == 'searchkey') print '
'; print ''; print ''; - print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).''; + print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index b1b4fc83be8..f79e973bc5b 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,43 +45,67 @@ class ActionComm extends CommonObject */ public $table_element = 'actioncomm'; + /** + * @var string Name of id column + */ public $table_rowid = 'id'; /** - * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + * @var string Name of icon for actioncomm object. Filename of icon is object_action.png */ public $picto = 'action'; /** - * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - * @var int + * @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; /** - * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty - * @var integer + * @var integer 0=Default + * 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * 2=Same than 1 but accept record if fksoc is empty */ public $restrictiononfksoc = 2; /** - * Id of the event - * @var int + * @var int Id of the event */ public $id; /** - * Id of the event. Use $id as possible - * @var int + * @var int Id of the event. Use $id as possible */ public $ref; - public $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set) - public $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + /** + * @var int Id into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type_id; + + /** + * @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + */ + public $type_code; + + /** + * @var string Type label + */ public $type_label; - public $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set) - public $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set) - public $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) + + /** + * @var string Label into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type; + + /** + * @var string Color into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type_color; + + /** + * @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) + */ + public $code; /** * @var string Agenda event label @@ -89,72 +113,56 @@ class ActionComm extends CommonObject public $label; /** - * Date creation record (datec) - * - * @var integer + * @var integer Date creation record (datec) */ public $datec; /** - * Date end record (datef) - * - * @var integer + * @var integer Date end record (datef) */ public $datef; /** - * Duration (duree) - * - * @var integer + * @var integer Duration (duree) */ public $duree; /** - * Date modification record (tms) - * - * @var integer + * @var integer Date modification record (tms) */ public $datem; /** - * Object user that create action - * @var User + * @var User Object user that create action * @deprecated * @see $authorid */ public $author; /** - * Object user that modified action - * @var User + * @var User Object user that modified action * @deprecated * @see $usermodid */ public $usermod; /** - * Id user that create action - * @var int + * @var int Id user that create action */ public $authorid; /** - * Id user that modified action - * @var int + * @var int Id user that modified action */ public $usermodid; /** - * Date action start (datep) - * - * @var integer + * @var integer Date action start (datep) */ public $datep; /** - * Date action end (datep2) - * - * @var integer + * @var integer Date action end (datep2) */ public $datep2; @@ -163,90 +171,178 @@ class ActionComm extends CommonObject * @deprecated */ public $durationp = -1; - public $fulldayevent = 0; // 1=Event on full day /** - * Milestone - * @var int + * @var int 1=Event on full day + */ + public $fulldayevent = 0; + + /** + * @var int Milestone * @deprecated Milestone is already event with end date = start date */ public $punctual = 1; - public $percentage; // Percentage - public $location; // Location - public $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) - public $priority; // Small int (0 By default) + /** + * @var integer Percentage + */ + public $percentage; - public $userassigned = array(); // Array of user ids - public $userownerid; // Id of user owner = fk_user_action into table - public $userdoneid; // Id of user done (deprecated) + /** + * @var string Location + */ + public $location; - public $socpeopleassigned = array(); // Array of contact ids + /** + * @var int Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) + */ + public $transparency; - public $otherassigned = array(); // Array of other contact emails (not user, not contact) + /** + * @var int (0 By default) + */ + public $priority; + + /** + * @var int[] Array of user ids + */ + public $userassigned = array(); + + /** + * @var int Id of user owner = fk_user_action into table + */ + public $userownerid; + + /** + * @var int Id of user done (deprecated) + * @deprecated + */ + public $userdoneid; + + /** + * @var int[] Array of contact ids + */ + public $socpeopleassigned = array(); + + /** + * @var int[] Array of other contact emails (not user, not contact) + */ + public $otherassigned = array(); - /** - * Object user of owner - * @var User + /** + * @var User Object user of owner * @deprecated * @see userownerid */ public $usertodo; /** - * Object user that did action - * @var User + * @var User Object user that did action * @deprecated * @see userdoneid */ public $userdone; + /** + * @var int thirdparty id linked to action + */ public $socid; + + /** + * @var int socpeople id linked to action + */ public $contactid; /** - * Company linked to action (optional) - * @var Societe|null + * @var Societe|null Company linked to action (optional) * @deprecated * @see socid */ public $societe; /** - * Contact linked to action (optional) - * @var Contact|null + * @var Contact|null Contact linked to action (optional) * @deprecated * @see contactid */ public $contact; // Properties for links to other objects + /** + * @var int Id of linked object + */ public $fk_element; // Id of record - public $elementid; // Id of record alternative for API - public $elementtype; // Type of record. This if property ->element of object linked to. - // Ical + /** + * @var int Id of record alternative for API + */ + public $elementid; + + /** + * @var string Type of record. This if property ->element of object linked to. + */ + public $elementtype; + + /** + * @var string Ical name + */ public $icalname; + + /** + * @var string Ical color + */ public $icalcolor; + /** + * @var array Actions + */ public $actions=array(); - // Fields for emails + /** + * @var string Email msgid + */ public $email_msgid; + + /** + * @var string Email from + */ public $email_from; + + /** + * @var string Email sender + */ public $email_sender; + + /** + * @var string Email to + */ public $email_to; + + /** + * @var string Email tocc + */ public $email_tocc; + /** + * @var string Email tobcc + */ public $email_tobcc; + + /** + * @var string Email subject + */ public $email_subject; + + /** + * @var string Email errors to + */ public $errors_to; /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 1b33e5da9b8..ac474881732 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -488,7 +488,7 @@ if ($resql) if (! empty($arrayfields['a.tms']['checked'])) print ''; if (! empty($arrayfields['a.percent']['checked'])) { print ''; } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index ba0e24ddaab..5f951362be7 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -135,7 +135,8 @@ class box_graph_invoices_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); @@ -180,7 +181,8 @@ class box_graph_invoices_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 4393e9db790..6d65ea7f534 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -132,7 +132,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png'; $px1 = new DolGraph(); @@ -143,7 +144,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $px1->SetData($data1); unset($data1); - $i=$startyear;$legend=array(); + $i=$startyear; + $legend=array(); while ($i <= $endyear) { if ($startmonth != 1) @@ -177,7 +179,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png'; $px2 = new DolGraph(); diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 6e5bf253832..53952bb437b 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -135,7 +135,8 @@ class box_graph_orders_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); @@ -144,7 +145,8 @@ class box_graph_orders_permonth extends ModeleBoxes { $px1->SetData($data1); unset($data1); - $i=$startyear;$legend=array(); + $i=$startyear; + $legend=array(); while ($i <= $endyear) { if ($startmonth != 1) @@ -178,7 +180,8 @@ class box_graph_orders_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 443f374346d..911ac7a91b1 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -134,7 +134,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); @@ -143,7 +144,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes { $px1->SetData($data1); unset($data1); - $i=$startyear;$legend=array(); + $i=$startyear; + $legend=array(); while ($i <= $endyear) { if ($startmonth != 1) @@ -177,7 +179,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index afecdeeb234..f0c57cda966 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1991,56 +1991,48 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $ if ($second< 0 || $second > 60) return ''; } - if (method_exists('DateTime', 'getTimestamp')) + if (empty($gm) || $gm === 'server') { - if (empty($gm) || $gm === 'server') - { - $default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin' + $default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin' + $localtz = new DateTimeZone($default_timezone); + } + elseif ($gm === 'user') + { + // We use dol_tz_string first because it is more reliable. + $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' + try { $localtz = new DateTimeZone($default_timezone); } - elseif ($gm === 'user') + catch(Exception $e) { - // We use dol_tz_string first because it is more reliable. - $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' - try { - $localtz = new DateTimeZone($default_timezone); - } - catch(Exception $e) - { - dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING); - $default_timezone=@date_default_timezone_get(); - } + dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING); + $default_timezone=@date_default_timezone_get(); } - elseif (strrpos($gm, "tz,") !== false) - { - $timezone=str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin' - try - { - $localtz = new DateTimeZone($timezone); - } - catch(Exception $e) - { - dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING); - } - } - - if (empty($localtz)) { - $localtz = new DateTimeZone('UTC'); - } - //var_dump($localtz); - //var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute); - $dt = new DateTime(null, $localtz); - $dt->setDate((int) $year, (int) $month, (int) $day); - $dt->setTime((int) $hour, (int) $minute, (int) $second); - $date=$dt->getTimestamp(); // should include daylight saving time - //var_dump($date); - return $date; } - else + elseif (strrpos($gm, "tz,") !== false) { - dol_print_error('', 'PHP version must be 5.4+'); - return ''; + $timezone=str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin' + try + { + $localtz = new DateTimeZone($timezone); + } + catch(Exception $e) + { + dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING); + } } + + if (empty($localtz)) { + $localtz = new DateTimeZone('UTC'); + } + //var_dump($localtz); + //var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute); + $dt = new DateTime(null, $localtz); + $dt->setDate((int) $year, (int) $month, (int) $day); + $dt->setTime((int) $hour, (int) $minute, (int) $second); + $date=$dt->getTimestamp(); // should include daylight saving time + //var_dump($date); + return $date; } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 581fca03f8b..558744d87e8 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -31,6 +31,10 @@ class mailing_advthirdparties extends MailingTargets public $require_admin=0; public $require_module=array("none"); // This module should not be displayed as Selector in mailling + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='company'; /** diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index aa951426a12..b3687e4f603 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -37,6 +37,10 @@ class mailing_contacts1 extends MailingTargets public $desc='Contacts of thirdparties (prospects, customers, suppliers...)'; public $require_module=array("societe"); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='contact'; /** diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index a96457c2625..88af802ecfe 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -36,6 +36,10 @@ class mailing_example extends MailingTargets public $tooltip='MyTooltipLangKey'; public $require_module=array(); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto=''; /** diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 43d6ae08213..ae0dff89b76 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -40,6 +40,10 @@ class mailing_fraise extends MailingTargets public $require_admin=0; public $require_module=array('adherent'); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='user'; /** diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 970339e4dbb..8d55bd86adc 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -35,6 +35,10 @@ class mailing_pomme extends MailingTargets public $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=1; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='user'; /** diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 68cb49e10d9..e0c148e4f9f 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -30,6 +30,10 @@ class mailing_thirdparties extends MailingTargets public $require_admin=0; public $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='company'; /** diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 75dc4b9499b..7e3b468fc6d 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -28,6 +28,10 @@ class mailing_thirdparties_services_expired extends MailingTargets public $require_admin=0; public $require_module=array('contrat'); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='company'; /** diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 4987c9ebc17..a69800230b1 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -35,6 +35,10 @@ class mailing_xinputfile extends MailingTargets public $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='generic'; public $tooltip='UseFormatFileEmailToTarget'; diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 8d4ecf0b72e..7014f5f894d 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -35,6 +35,10 @@ class mailing_xinputuser extends MailingTargets public $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='generic'; public $tooltip='UseFormatInputEmailToTarget'; diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index eeef6ab34e5..1477f4d65f3 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -37,6 +37,10 @@ class printing_printgcp extends PrintingDriver { public $name = 'printgcp'; public $desc = 'PrintGCPDesc'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'printer'; public $active = 'PRINTING_PRINTGCP'; public $conf = array(); diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 1d76fe6f574..37659cec199 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -32,6 +32,10 @@ class printing_printipp extends PrintingDriver { public $name = 'printipp'; public $desc = 'PrintIPPDesc'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'printer'; public $active = 'PRINTING_PRINTIPP'; public $conf = array(); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index b804f3c7a46..bc3d8302afa 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -564,7 +564,7 @@ if (! empty($id) && $action == 'edit') } // Payment mode print "\n"; @@ -708,7 +708,7 @@ if (! empty($id) && $action != 'edit') // Payment mode print "\n"; // Other attributes diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 958a9c38e8b..aed8a4e8693 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -46,6 +46,10 @@ class ExpenseReport extends CommonObject public $table_element_line = 'expensereport_det'; public $fk_element = 'fk_expensereport'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'trip'; public $lines=array(); diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 2e3fd9ef1c8..f599cccf801 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -42,6 +42,10 @@ class FichinterRec extends Fichinter public $table_element = 'fichinter_rec'; public $table_element_line = 'fichinter_rec'; public $fk_element = 'fk_fichinter'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'intervention'; public $title; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index bbed35887b0..584cd7ecf64 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -62,7 +62,10 @@ class CommandeFournisseur extends CommonOrder */ public $fk_element = 'fk_commande'; - public $picto='order'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='order'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -3586,7 +3589,7 @@ class CommandeFournisseurLigne extends CommonOrderLine * @param int $notrigger 1=Disable call to triggers * @return int <0 if KO, >0 if OK */ - public function delete($notrigger) + public function delete($notrigger = 0) { global $user; @@ -3594,7 +3597,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->db->begin(); - $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".$this->rowid; + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index d22d6b6b4aa..247779583c6 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -63,6 +63,9 @@ class FactureFournisseur extends CommonInvoice */ public $fk_element='fk_facture_fourn'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='bill'; /** diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 98fafd3609f..b18b054a65b 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -46,6 +46,9 @@ class PaiementFourn extends Paiement */ public $table_element='paiementfourn'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'payment'; public $statut; //Status of payment. 0 = unvalidated; 1 = validated diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index b75eec43eac..e71993a97fd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -54,6 +54,9 @@ class Holiday extends CommonObject */ public $fk_element = 'fk_holiday'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'holiday'; /** diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 9add71da395..c5ab5e0e5ec 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -173,6 +173,10 @@ llxHeader('', $langs->trans('CPTitreMenu')); $typeleaves=$holiday->getTypes(1, 1); +$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. +if ($result < 0) { + setEventMessages($holiday->error, $holiday->errors, 'errors'); +} print ''; @@ -189,21 +193,14 @@ print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; $lastUpdate = $holiday->getConfCP('lastUpdate'); -if ($lastUpdate) -{ - $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; - $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; - print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')), 'dayhour', 'tzuser').''; - print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; +if ($lastUpdate) { + print ''.dol_print_date($db->jdate($lastUpdate), 'dayhour').''; + print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).''."\n"; +} else { + print $langs->trans('None'); } -else print $langs->trans('None'); print "

\n"; -$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. -if ($result < 0) -{ - setEventMessages($holiday->error, $holiday->errors, 'errors'); -} $filters = ''; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 863f519231d..20c80d07981 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -55,7 +55,10 @@ class Establishment extends CommonObject */ public $ismultientitymanaged = 1; - public $picto='building'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='building'; /** * @var int ID diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 1e7fdebaa64..dcf95b37ad6 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -64,7 +64,12 @@ class Livraison extends CommonObject public $ref_customer; public $date_delivery; // Date really received + + /** + * @var integer|string date_creation + */ public $date_creation; + public $date_valid; public $model_pdf; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 9b0c3c69ca6..f7d9955def7 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -41,6 +41,9 @@ class Loan extends CommonObject */ public $table_element='loan'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'bill'; /** diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 854e7f37bd5..43970122919 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -26,6 +26,10 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets public $enabled=0; public $require_module=array(); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='mymodule@mymodule'; /** diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 786ed7220b5..b1cdeac1f36 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -44,6 +44,9 @@ class Opensurveysondage extends CommonObject */ public $table_element='opensurvey_sondage'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'opensurvey'; public $id_sondage; diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index d6066b1a03a..1b0020faa25 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -450,12 +450,13 @@ class Products extends DolibarrApi * Get prices per customer for a product * * @param int $id ID of product + * @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i} * * @return mixed * * @url GET {id}/selling_multiprices/per_customer */ - public function getCustomerPricesPerCustomer($id) + public function getCustomerPricesPerCustomer($id, $thirdparty_id = '') { global $conf; @@ -472,12 +473,20 @@ class Products extends DolibarrApi throw new RestException(404, 'Product not found'); } - if ($result < 0) { - throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); + if ($result > 0) { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + $prodcustprice = new Productcustomerprice($this->db); + $filter = array(); + $filter['t.fk_product'] .= $id; + if ($thirdparty_id) $filter['t.fk_soc'] .= $thirdparty_id; + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); } - throw new RestException(501, 'Feature not yet available'); - //return $result; + if ( empty($prodcustprice->lines)) { + throw new RestException(404, 'Prices not found'); + } + + return $prodcustprice->lines; } /** diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 70aea5d0e9b..361497189f9 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -44,6 +44,9 @@ class Entrepot extends CommonObject */ public $table_element='entrepot'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='stock'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 1e217deef48..dbd0354cea3 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -45,6 +45,9 @@ class Productlot extends CommonObject */ public $table_element = 'product_lot'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='barcode'; /** diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a873b53dbc0..0848f87ed19 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -60,6 +60,9 @@ class Project extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'projectpub'; /** diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ed42a51491b..71bf1b17f50 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -47,6 +47,9 @@ class Task extends CommonObject */ public $fk_element='fk_task'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'task'; /** diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index eae8ab9de34..48a35412987 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -48,7 +48,11 @@ class Reception extends CommonObject public $table_element="reception"; public $table_element_line="commande_fournisseur_dispatch"; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'reception'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'reception'; public $socid; public $ref_supplier; @@ -80,8 +84,14 @@ class Reception extends CommonObject * @var int */ public $date_reception; - public $date_creation; - public $date_valid; + + /** + * @var integer|string date_creation + */ + public $date_creation; + + + public $date_valid; public $meths; public $listmeths; // List of carriers diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index c85f040f896..db64c635fd5 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -39,7 +39,10 @@ class Dolresource extends CommonObject */ public $table_element='resource'; - public $picto = 'resource'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'resource'; public $resource_id; public $resource_type; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ca17077a47b..48c37f044a5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -69,6 +69,9 @@ class Societe extends CommonObject */ protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_account", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm"); + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'company'; /** @@ -316,11 +319,12 @@ class Societe extends CommonObject * @var string */ public $user_modification; + /** - * Date of creation - * @var string + * @var integer|string date_creation */ public $date_creation; + /** * User that created the thirdparty * @var User diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index bf94c522f68..f93dfd0ea68 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -124,7 +124,13 @@ class SocieteAccount extends CommonObject public $date_last_login; public $date_previous_login; public $note_private; + + /** + * @var integer|string date_creation + */ public $date_creation; + + public $tms; /** diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 27269dbaac2..dede1c9eec9 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -66,6 +66,9 @@ class SupplierProposal extends CommonObject */ public $fk_element='fk_supplier_proposal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='propal'; /** diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 8a6fcd60ce9..aa4a6b3f8b6 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -52,7 +52,10 @@ class UserGroup extends CommonObject */ public $ismultientitymanaged = 1; - public $picto='group'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='group'; /** * @var int Entity of group
'; - print $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2); + $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2); print ajax_combobox('selectstatus'); print '
".$langs->trans("PaymentMode")."\n"; - if ($object->modepaymentid) $selected = $object->modepaymentid; + if ($object->mode_reglement_id) $selected = $object->mode_reglement_id; else $selected = ''; $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1); print "
".$langs->trans("PaymentMode").""; - $form->form_modes_reglement(null, $object->modepaymentid, 'none'); + $form->form_modes_reglement(null, $object->mode_reglement_id, 'none'); print "