Merge remote-tracking branch 'Dolibarr/14.0' into 14

This commit is contained in:
Francis Appels 2021-07-15 14:17:44 +02:00
commit 6ffdf6f597
6 changed files with 22 additions and 11 deletions

View File

@ -1043,7 +1043,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250');
$moreforfilter .= '</div>';
}
// If the user can view prospects other than his'
// Filter on product tags
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';

View File

@ -6828,6 +6828,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray = array_merge($substitutionarray, array(
'__MYCOMPANY_NAME__' => $mysoc->name,
'__MYCOMPANY_EMAIL__' => $mysoc->email,
'__MYCOMPANY_PHONE__' => $mysoc->phone,
'__MYCOMPANY_FAX__' => $mysoc->fax,
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
'__MYCOMPANY_PROFID2__' => $mysoc->idprof2,
'__MYCOMPANY_PROFID3__' => $mysoc->idprof3,

View File

@ -1251,6 +1251,8 @@ class Holiday extends CommonObject
public function LibStatut($status, $mode = 0, $startdate = '')
{
// phpcs:enable
global $langs;
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
global $langs;
//$langs->load("mymodule");
@ -1266,9 +1268,11 @@ class Holiday extends CommonObject
$this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('RefuseCP');
}
$params = array();
$statusType = 'status6';
if (!empty($startdate) && $startdate > dol_now()) {
if (!empty($startdate) && $startdate >= dol_now()) { // If not yet passed, we use a green "in live" color
$statusType = 'status4';
$params = array('tooltip'=>$this->labelStatus[$status].' - '.$langs->trans("Forthcoming"));
}
if ($status == self::STATUS_DRAFT) {
$statusType = 'status0';
@ -1283,7 +1287,7 @@ class Holiday extends CommonObject
$statusType = 'status5';
}
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode, '', $params);
}

View File

@ -730,6 +730,7 @@ if ($resql) {
$holidaystatic->id = $obj->rowid;
$holidaystatic->ref = ($obj->ref ? $obj->ref : $obj->rowid);
$holidaystatic->statut = $obj->status;
$holidaystatic->date_debut = $db->jdate($obj->date_debut);
// User
$userstatic->id = $obj->fk_user;
@ -790,7 +791,7 @@ if ($resql) {
}
if (!empty($arrayfields['duration']['checked'])) {
print '<td class="right">';
$nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday);
$nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates
print $nbopenedday.' '.$langs->trans('DurationDays');
print '</td>';
if (!$i) {

View File

@ -1137,3 +1137,4 @@ CopiedToClipboard=Copied to clipboard
InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.
ConfirmCancel=Are you sure you want to cancel
EmailMsgID=Email MsgID
Forthcoming=Forthcoming

View File

@ -1280,7 +1280,8 @@ class Societe extends CommonObject
$this->get_codefournisseur($this, 1);
}
$this->code_compta = trim($this->code_compta);
$this->code_compta_client = trim(empty($this->code_compta) ? $this->code_compta_client : $this->code_compta);
$this->code_compta = $this->code_compta_client; // for backward compatbility
$this->code_compta_fournisseur = trim($this->code_compta_fournisseur);
// Check parameters. More tests are done later in the ->verify()
@ -1292,8 +1293,8 @@ class Societe extends CommonObject
$customer = false;
if (!empty($allowmodcodeclient) && !empty($this->client)) {
// Attention get_codecompta peut modifier le code suivant le module utilise
if (empty($this->code_compta)) {
// If $allowmodcodeclient is set and value is not set, we generate it
if (empty($this->code_compta_client)) {
$ret = $this->get_codecompta('customer');
if ($ret < 0) {
return -1;
@ -1305,8 +1306,8 @@ class Societe extends CommonObject
$supplier = false;
if (!empty($allowmodcodefournisseur) && !empty($this->fournisseur)) {
// Attention get_codecompta peut modifier le code suivant le module utilise
if ($this->code_compta_fournisseur == "") {
// If $allowmodcodefournisseur is set and value is not set, we generate it
if (empty($this->code_compta_fournisseur)) {
$ret = $this->get_codecompta('supplier');
if ($ret < 0) {
return -1;
@ -1460,7 +1461,7 @@ class Societe extends CommonObject
if ($customer) {
$sql .= ", code_client = ".(!empty($this->code_client) ? "'".$this->db->escape($this->code_client)."'" : "null");
$sql .= ", code_compta = ".(!empty($this->code_compta) ? "'".$this->db->escape($this->code_compta)."'" : "null");
$sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null");
}
if ($supplier) {
@ -3311,7 +3312,8 @@ class Societe extends CommonObject
$result = $mod->get_code($this->db, $this, $type);
if ($type == 'customer') {
$this->code_compta = $mod->code;
$this->code_compta_client = $mod->code;
$this->code_compta = $this->code_compta_client; // For backward compatibility
} elseif ($type == 'supplier') {
$this->code_compta_fournisseur = $mod->code;
}
@ -3323,6 +3325,7 @@ class Societe extends CommonObject
}
} else {
if ($type == 'customer') {
$this->code_compta_client = '';
$this->code_compta = '';
} elseif ($type == 'supplier') {
$this->code_compta_fournisseur = '';