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

Conflicts:
	htdocs/core/lib/project.lib.php
	htdocs/projet/list.php
This commit is contained in:
Laurent Destailleur 2022-01-15 20:28:04 +01:00
commit 5070a40fa4
5 changed files with 40 additions and 41 deletions

View File

@ -1395,14 +1395,14 @@ class Contact extends CommonObject
* @param string $moreparam Add more param into URL
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0)
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
{
global $conf, $langs, $hookmanager;
$result = ''; $label = '';
if (!empty($this->photo) && class_exists('Form')) {
$label .= '<div class="photointooltip floatright">';
$label .= Form::showphoto('contact', $this, 0, 40, 0, 'photoref', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip.
@ -1454,7 +1454,7 @@ class Contact extends CommonObject
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
/*
$hookmanager->initHooks(array('contactdao'));
@ -1476,7 +1476,7 @@ class Contact extends CommonObject
$result .= $linkstart;
if ($withpicto) {
if ($withpicto == -2) {
$result .= '<!-- picto photo user --><span class="nopadding userimg'.($moreparam ? ' '.$moreparam : '').'">'.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).'</span>';
$result .= '<!-- picto photo user --><span class="nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.Form::showphoto('contact', $this, 0, 0, 0, 'userphoto'.($withpicto == -3 ? 'small' : ''), 'mini', 0, 1).'</span>';
} else {
$result .= img_object(($notooltip ? '' : $label), ( $this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
}

View File

@ -679,22 +679,23 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Title of task
if (count($arrayfields) > 0 && !empty($arrayfields['t.label']['checked'])) {
print '<td>';
$labeltoshow = '';
if ($showlineingray) {
print '<i>';
$labeltoshow .= '<i>';
}
//else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$lines[$i]->id.'&withproject=1">';
for ($k = 0; $k < $level; $k++) {
print '<div class="marginleftonly">';
$labeltoshow .= '<div class="marginleftonly">';
}
print $lines[$i]->label;
$labeltoshow .= dol_escape_htmltag($lines[$i]->label);
for ($k = 0; $k < $level; $k++) {
print '</div>';
$labeltoshow .= '</div>';
}
if ($showlineingray) {
print '</i>';
$labeltoshow .= '</i>';
}
//else print '</a>';
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($labeltoshow).'">';
print $labeltoshow;
print "</td>\n";
}
@ -822,28 +823,6 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
}
}
// Contacts of tasks. Disabled, because available by default just after
/*
if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) {
print '<td>';
foreach (array('internal', 'external') as $source) {
$tab = $lines[$i]->liste_contact(-1, $source);
$num = count($tab);
if (!empty($num)) {
foreach ($tab as $contacttask) {
//var_dump($contacttask);
if ($source == 'internal') {
$c = new User($db);
} else {
$c = new Contact($db);
}
$c->fetch($contacttask['id']);
print $c->getNomUrl(1).' ('.$contacttask['libelle'].')<br>';
}
}
}
print '</td>';
}*/
if (count($arrayfields) > 0 && !empty($arrayfields['c.budget_amount']['checked'])) {
print '<td class="center">';
print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
@ -854,6 +833,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Contacts of task
if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
print '<td class="center">';
$ifisrt = 1;
foreach (array('internal', 'external') as $source) {
$tab = $lines[$i]->liste_contact(-1, $source);
$numcontact = count($tab);
@ -867,14 +847,19 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
}
$c->fetch($contacttask['id']);
if (!empty($c->photo)) {
print $c->getNomUrl(-2).'&nbsp;';
if (get_class($c) == 'User') {
print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
} else {
print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
}
} else {
if (get_class($c) == 'User') {
print $c->getNomUrl(2, '', 0, 0, 24, 1);//.'&nbsp;';
print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
} else {
print $c->getNomUrl(2);//.'&nbsp;';
print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
}
}
$ifisrt = 0;
}
}
}

View File

@ -1323,6 +1323,7 @@ while ($i < min($num, $limit)) {
// Contacts of project
if (!empty($arrayfields['c.assigned']['checked'])) {
print '<td class="center">';
$ifisrt = 1;
foreach (array('internal', 'external') as $source) {
$tab = $object->liste_contact(-1, $source);
$numcontact = count($tab);
@ -1336,14 +1337,19 @@ while ($i < min($num, $limit)) {
}
$c->fetch($contactproject['id']);
if (!empty($c->photo)) {
print $c->getNomUrl(-2).'&nbsp;';
if (get_class($c) == 'User') {
print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
} else {
print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
}
} else {
if (get_class($c) == 'User') {
print $c->getNomUrl(2, '', 0, 0, 24, 1);//.'&nbsp;';
print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst'));
} else {
print $c->getNomUrl(2);//.'&nbsp;';
print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst'));
}
}
$ifisrt = 0;
}
}
}

View File

@ -381,6 +381,10 @@ a.butStatus {
margin: 0 0.45em !important;
}
span.userimg.notfirst {
margin-left: -5px;
}
/* Used by timesheets */
span.timesheetalreadyrecorded input {
border: none;

View File

@ -568,6 +568,10 @@ a.butStatus {
margin: 0 0.45em !important;
}
span.userimg.notfirst {
margin-left: -5px;
}
/* Used by timesheets */
span.timesheetalreadyrecorded input {
border: none;
@ -1718,7 +1722,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
text-overflow: ellipsis;
white-space: nowrap;
}
select {
padding-top: 4px;
padding-bottom: 5px;
@ -4463,7 +4467,7 @@ table.titlemodulehelp tr td img.widthpictotitle { width: 80px; }
.dolgraphtitle { margin-top: 6px; margin-bottom: 4px; }
.dolgraphtitlecssboxes { /* margin: 0px; */ }
.dolgraphchart canvas {
.dolgraphchart canvas {
/* width: calc(100% - 20px) !important; */
}
.legendColorBox, .legendLabel { border: none !important; }