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

This commit is contained in:
Laurent Destailleur 2024-07-30 12:28:15 +02:00
commit 292080ca14
6 changed files with 31 additions and 18 deletions

View File

@ -332,7 +332,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
$membertype = new AdherentType($db);
$i = 0;
$savnbfield = 9;
$savnbfield = 10;
/*$savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;*/
@ -565,6 +565,7 @@ if ($rowid > 0) {
print yn($object->vote);
print '</tr>';
// Duration
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.'&nbsp;';
if ($object->duration_value > 1) {
$dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
@ -574,13 +575,15 @@ if ($rowid > 0) {
print(!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')."&nbsp;";
print '</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td><div class="longmessagecut">';
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_public));
print "</td></tr>";
print "</div></td></tr>";
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
// Welcome email content
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td><div class="longmessagecut">';
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->mail_valid));
print "</td></tr>";
print "</div></td></tr>";
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@ -750,9 +753,6 @@ if ($rowid > 0) {
if (!empty($search_lastname)) {
$param .= "&search_lastname=".urlencode($search_lastname);
}
if (!empty($search_firstname)) {
$param .= "&search_firstname=".urlencode($search_firstname);
}
if (!empty($search_login)) {
$param .= "&search_login=".urlencode($search_login);
}
@ -770,6 +770,7 @@ if ($rowid > 0) {
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter" autocomplete="off">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'"></td>';
print '<input class="flat" type="hidden" name="page_y" value=""></td>';
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
@ -848,6 +849,7 @@ if ($rowid > 0) {
$adh->datefin = $datefin;
$adh->need_subscription = $objp->subscription;
$adh->statut = $objp->status;
$adh->status = $objp->status;
$adh->email = $objp->email;
$adh->photo = $objp->photo;

View File

@ -1586,7 +1586,8 @@ class ActionComm extends CommonObject
*/
public function getTooltipContentArray($params)
{
global $langs;
global $langs, $form;
$langs->load('agenda');
$datas = array();
@ -1646,8 +1647,14 @@ class ActionComm extends CommonObject
// show categories for this record only in ajax to not overload lists
if (isModEnabled('category') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1);
if (empty($form)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($this->db);
}
$tmpcategstring = $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1);
if ($tmpcategstring) {
$datas['categories'] = '<br>'.$tmpcategstring;
}
}
return $datas;

View File

@ -9305,7 +9305,11 @@ class Form
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
}
}
return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
if (empty($toprint)) {
return '';
} else {
return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
}
}
if ($rendermode == 0) {

View File

@ -222,7 +222,7 @@ if ($massaction == 'withdrawrequest') {
}
if ($numprlv > 0) {
$error++;
//$error++; // Not an error, a simple warning we can ignore
setEventMessages($langs->trans("Salary").' '.$objecttmp->ref.' : '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings');
} elseif (!empty($objecttmp->type_payment_code) && $objecttmp->type_payment_code != 'VIR') {
$langs->load("errors");
@ -234,6 +234,7 @@ if ($massaction == 'withdrawrequest') {
}
}
// Now process all record not in error
if (!$error && !empty($listofSalries)) {
$nbwithdrawrequestok = 0;
foreach ($listofSalries as $salary) {

View File

@ -2855,7 +2855,7 @@ class Societe extends CommonObject
* Return a link on thirdparty (with picto)
*
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier', 'project')
* @param string $option Target of link (''=auto, 'nolink'=no link, 'customer', 'prospect', 'supplier', 'project', 'agenda', ...)
* @param int $maxlen Max length of name
* @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking

View File

@ -2934,7 +2934,7 @@ class User extends CommonObject
$thirdpartystatic->fetch($this->socid);
$companyimg = '';
if (empty($params['hidethirdpartylogo'])) {
$companyimg = ' '.$thirdpartystatic->getNomUrl(2, (($option == 'nolink') ? 'nolink' : '')); // picto only of company
$companyimg = ' '.$thirdpartystatic->getNomUrl(2, 'nolink', 0, 1); // picto only of company
}
$company = ' ('.$langs->trans("Company").': '.($companyimg ? $companyimg : img_picto('', 'company')).' '.dol_string_nohtmltag($thirdpartystatic->name).')';
}
@ -2987,8 +2987,7 @@ class User extends CommonObject
*/
public function getNomUrl($withpictoimg = 0, $option = '', $infologin = 0, $notooltip = 0, $maxlen = 24, $hidethirdpartylogo = 0, $mode = '', $morecss = '', $save_lastsearch_value = -1)
{
global $langs, $conf, $db, $hookmanager, $user;
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $langs, $hookmanager, $user;
if (!$user->hasRight('user', 'user', 'read') && $user->id != $this->id) {
$option = 'nolink';
@ -3021,7 +3020,7 @@ class User extends CommonObject
$thirdpartystatic = new Societe($this->db);
$thirdpartystatic->fetch($this->socid);
if (empty($hidethirdpartylogo)) {
$companylink = ' '.$thirdpartystatic->getNomUrl(2, (($option == 'nolink') ? 'nolink' : '')); // picto only of company
$companylink = ' '.$thirdpartystatic->getNomUrl(2, 'nolink', 0, 1); // picto only of company
}
}