Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2019-11-02 12:59:49 +01:00
commit 58ffb73627
44 changed files with 381 additions and 153 deletions

View File

@ -236,7 +236,7 @@ foreach($listofnotifiedevents as $notifiedevent)
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // 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++;

View File

@ -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 '<input type="hidden" id="action" name="action" value="search">';
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
@ -466,7 +466,7 @@ if ($mode == 'searchkey')
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).'</td>';
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);

View File

@ -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)
{

View File

@ -488,7 +488,7 @@ if ($resql)
if (! empty($arrayfields['a.tms']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.percent']['checked'])) {
print '<td class="liste_titre center">';
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 '</td>';
}

View File

@ -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&amp;file=invoicesnbinyear-'.$endyear.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;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&amp;file=invoicesamountinyear-'.$endyear.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph();

View File

@ -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&amp;file=invoicesnbinyear-'.$year.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;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&amp;file=invoicesamountinyear-'.$year.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$year.'.png';
$px2 = new DolGraph();

View File

@ -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&amp;file=ordersnbinyear-'.$endyear.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;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&amp;file=ordersamountinyear-'.$endyear.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersamountinyear-'.$endyear.'.png';
$px2 = new DolGraph();

View File

@ -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&amp;file=ordersnbinyear-'.$endyear.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;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&amp;file=ordersamountinyear-'.$endyear.'.png';
// default value for customer mode
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph();

View File

@ -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;
}

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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='';
/**

View File

@ -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';
/**

View File

@ -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<75>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';
/**

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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<75>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';

View File

@ -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<75>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';

View File

@ -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();

View File

@ -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();

View File

@ -564,7 +564,7 @@ if (! empty($id) && $action == 'edit')
}
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\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 "</td></tr>\n";
@ -708,7 +708,7 @@ if (! empty($id) && $action != 'edit')
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
$form->form_modes_reglement(null, $object->modepaymentid, 'none');
$form->form_modes_reglement(null, $object->mode_reglement_id, 'none');
print "</td></tr>\n";
// Other attributes

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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';
/**

View File

@ -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

View File

@ -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';
/**

View File

@ -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 '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
@ -189,21 +193,14 @@ print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png');
print '<div class="info">'.$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 '<strong>'.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>';
print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>'."\n";
if ($lastUpdate) {
print '<strong>'.dol_print_date($db->jdate($lastUpdate), 'dayhour').'</strong>';
print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).'</strong>'."\n";
} else {
print $langs->trans('None');
}
else print $langs->trans('None');
print "</div><br>\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 = '';

View File

@ -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

View File

@ -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;

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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;

View File

@ -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;
}
/**

View File

@ -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

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;
/**

View File

@ -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';
/**

View File

@ -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