Merge branch '13.0' of github.com:Dolibarr/dolibarr into 13.0

This commit is contained in:
Florian HENRY 2021-01-18 19:24:43 +01:00
commit 3194bea832
15 changed files with 85 additions and 64 deletions

View File

@ -5874,8 +5874,14 @@ abstract class CommonObject
} elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[2].':'.$reg[3] => 'N'); $param['options'] = array($reg[2].':'.$reg[3] => 'N');
$type = 'link'; $type = 'link';
} elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N');
$type = 'sellist';
} elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N');
$type = 'sellist';
} elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[2].':'.$reg[3] => 'N');
$type = 'sellist'; $type = 'sellist';
} elseif (preg_match('/varchar\((\d+)\)/', $val['type'], $reg)) { } elseif (preg_match('/varchar\((\d+)\)/', $val['type'], $reg)) {
$param['options'] = array(); $param['options'] = array();
@ -6042,24 +6048,20 @@ abstract class CommonObject
$keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
{ if (strpos($InfoFieldList[4], 'extra.') !== false) {
if (strpos($InfoFieldList[4], 'extra.') !== false)
{
$keyList = 'main.'.$InfoFieldList[2].' as rowid'; $keyList = 'main.'.$InfoFieldList[2].' as rowid';
} else { } else {
$keyList = $InfoFieldList[2].' as rowid'; $keyList = $InfoFieldList[2].' as rowid';
} }
} }
if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
{
list($parentName, $parentField) = explode('|', $InfoFieldList[3]); list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
$keyList .= ', '.$parentField; $keyList .= ', '.$parentField;
} }
$fields_label = explode('|', $InfoFieldList[1]); $fields_label = explode('|', $InfoFieldList[1]);
if (is_array($fields_label)) if (is_array($fields_label)) {
{
$keyList .= ', '; $keyList .= ', ';
$keyList .= implode(', ', $fields_label); $keyList .= implode(', ', $fields_label);
} }
@ -6454,13 +6456,18 @@ abstract class CommonObject
$param['options'] = array(); $param['options'] = array();
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) $param['options'] = $val['arrayofkeyval']; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) $param['options'] = $val['arrayofkeyval'];
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) {
{
$type = 'link'; $type = 'link';
$param['options'] = array($reg[1].':'.$reg[2]=>$reg[1].':'.$reg[2]); $param['options'] = array($reg[1].':'.$reg[2]=>$reg[1].':'.$reg[2]);
} elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N');
$type = 'sellist'; $type = 'sellist';
} elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N');
$type = 'sellist';
} elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[1].':'.$reg[2] => 'N');
$type = 'sellist';
} }
$langfile = $val['langfile']; $langfile = $val['langfile'];
@ -6551,8 +6558,7 @@ abstract class CommonObject
$selectkey = "rowid"; $selectkey = "rowid";
$keyList = 'rowid'; $keyList = 'rowid';
if (count($InfoFieldList) >= 3) if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
{
$selectkey = $InfoFieldList[2]; $selectkey = $InfoFieldList[2];
$keyList = $InfoFieldList[2].' as rowid'; $keyList = $InfoFieldList[2].' as rowid';
} }

View File

@ -6720,7 +6720,7 @@ class Form
// Add code for jquery to use multiselect // Add code for jquery to use multiselect
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
{ {
$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.' --> $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->
<script>'."\n"; <script>'."\n";
if ($addjscombo == 1) if ($addjscombo == 1)
{ {
@ -6751,6 +6751,10 @@ class Form
formatSelection: formatSelection, formatSelection: formatSelection,
templateSelection: formatSelection /* For 4.0 */ templateSelection: formatSelection /* For 4.0 */
}); });
/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
the size only if component is not hidden by default on load */
$(\'#'.$htmlname.' + .select2\').addClass(\''.$morecss.'\');
});'."\n"; });'."\n";
} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT'))
{ {

View File

@ -352,7 +352,7 @@ class FormProjets
if (empty($option_only) && !empty($conf->use_javascript_ajax)) if (empty($option_only) && !empty($conf->use_javascript_ajax))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$out .= $comboenhancement; $out .= $comboenhancement;
$morecss = 'minwidth200 maxwidth500'; $morecss = 'minwidth200 maxwidth500';
} }
@ -388,7 +388,7 @@ class FormProjets
continue; continue;
} }
$labeltoshow = ''; $labeltoshow = ''; $titletoshow = '';
$disabled = 0; $disabled = 0;
if ($obj->fk_statut == Project::STATUS_DRAFT) if ($obj->fk_statut == Project::STATUS_DRAFT)
@ -408,32 +408,39 @@ class FormProjets
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')';
$labeltoshow .= ' '.dol_trunc($obj->title, $maxlength); $labeltoshow .= ' '.dol_trunc($obj->title, $maxlength);
$titletoshow = $labeltoshow;
if ($obj->name) $labeltoshow .= ' ('.$obj->name.')'; if ($obj->name) {
$labeltoshow .= ' ('.$obj->name.')';
$titletoshow .= ' <span class="opacitymedium">('.$obj->name.')</span>';
}
$disabled = 0; $disabled = 0;
if ($obj->fk_statut == Project::STATUS_DRAFT) if ($obj->fk_statut == Project::STATUS_DRAFT) {
{
$disabled = 1; $disabled = 1;
$labeltoshow .= ' - '.$langs->trans("Draft"); $labeltoshow .= ' - '.$langs->trans("Draft");
} elseif ($obj->fk_statut == Project::STATUS_CLOSED) $titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("Draft").'</span>';
{ } elseif ($obj->fk_statut == Project::STATUS_CLOSED) {
if ($discard_closed == 2) $disabled = 1; if ($discard_closed == 2) $disabled = 1;
$labeltoshow .= ' - '.$langs->trans("Closed"); $labeltoshow .= ' - '.$langs->trans("Closed");
} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) $titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("Closed").'</span>';
{ } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
$disabled = 1; $disabled = 1;
$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
$titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>';
} }
$labeltoshow .= ' - '; $labeltoshow .= ' - ';
$titletoshow .= ' - ';
} }
// Label for task // Label for task
$labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength); $labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
$titletoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
if (!empty($selected) && $selected == $obj->rowid) if (!empty($selected) && $selected == $obj->rowid)
{ {
$out .= '<option value="'.$obj->rowid.'" selected'; $out .= '<option value="'.$obj->rowid.'" selected';
$out .= ' data-html="'.dol_escape_htmltag($titletoshow).'"';
//if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
$out .= '>'.$labeltoshow.'</option>'; $out .= '>'.$labeltoshow.'</option>';
} else { } else {
@ -445,6 +452,7 @@ class FormProjets
if ($disabled) $resultat .= ' disabled'; if ($disabled) $resultat .= ' disabled';
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat .= ' data-html="'.dol_escape_htmltag($titletoshow).'"';
$resultat .= '>'; $resultat .= '>';
$resultat .= $labeltoshow; $resultat .= $labeltoshow;
$resultat .= '</option>'; $resultat .= '</option>';

View File

@ -3268,7 +3268,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'intervention', 'label', 'language', 'link', 'list', 'listlight', 'lot', 'intervention', 'label', 'language', 'link', 'list', 'listlight', 'lot',
'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next', 'map-marker-alt', 'member', 'money-bill-alt', 'mrp', 'note', 'next',
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', 'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', 'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',

View File

@ -476,6 +476,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$projectstatic->public = $lines[$i]->public; $projectstatic->public = $lines[$i]->public;
$projectstatic->title = $lines[$i]->projectlabel; $projectstatic->title = $lines[$i]->projectlabel;
$projectstatic->usage_bill_time = $lines[$i]->usage_bill_time; $projectstatic->usage_bill_time = $lines[$i]->usage_bill_time;
$projectstatic->status = $lines[$i]->projectstatus;
$taskstatic->id = $lines[$i]->id; $taskstatic->id = $lines[$i]->id;
$taskstatic->ref = $lines[$i]->ref; $taskstatic->ref = $lines[$i]->ref;
@ -881,6 +882,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
$projectstatic->ref = $lines[$i]->project_ref; $projectstatic->ref = $lines[$i]->project_ref;
$projectstatic->title = $lines[$i]->project_label; $projectstatic->title = $lines[$i]->project_label;
$projectstatic->public = $lines[$i]->public; $projectstatic->public = $lines[$i]->public;
$projectstatic->status = $lines[$i]->project_status;
$taskstatic->id = $lines[$i]->task_id; $taskstatic->id = $lines[$i]->task_id;
$taskstatic->ref = ($lines[$i]->task_ref ? $lines[$i]->task_ref : $lines[$i]->task_id); $taskstatic->ref = ($lines[$i]->task_ref ? $lines[$i]->task_ref : $lines[$i]->task_id);
@ -1843,6 +1845,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
$projectstatic->title = $lines[$i]->projectlabel; $projectstatic->title = $lines[$i]->projectlabel;
$projectstatic->public = $lines[$i]->public; $projectstatic->public = $lines[$i]->public;
$projectstatic->thirdparty_name = $lines[$i]->thirdparty_name; $projectstatic->thirdparty_name = $lines[$i]->thirdparty_name;
$projectstatic->status = $lines[$i]->projectstatus;
$taskstatic->id = $lines[$i]->id; $taskstatic->id = $lines[$i]->id;
$taskstatic->ref = ($lines[$i]->ref ? $lines[$i]->ref : $lines[$i]->id); $taskstatic->ref = ($lines[$i]->ref ? $lines[$i]->ref : $lines[$i]->id);

View File

@ -280,13 +280,10 @@ class ProductFournisseur extends Product
} }
// Multicurrency // Multicurrency
$multicurrency_buyprice = null;
$multicurrency_unitBuyPrice = null; $multicurrency_unitBuyPrice = null;
$fk_multicurrency = null; $fk_multicurrency = null;
if (!empty($conf->multicurrency->enabled)) { if (!empty($conf->multicurrency->enabled)) {
if (empty($multicurrency_tx)) $multicurrency_tx = 1; if (empty($multicurrency_tx)) $multicurrency_tx = 1;
if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0;
if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0; if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0;
if ($multicurrency_price_base_type == 'TTC') if ($multicurrency_price_base_type == 'TTC')
{ {

View File

@ -70,7 +70,7 @@ class MyObject extends CommonObject
/** /**
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'label' the translation key. * 'label' the translation key.
* 'picto' is code of a picto to show before value in forms * 'picto' is code of a picto to show before value in forms

View File

@ -433,7 +433,7 @@ $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' ';
//$nav .= ' <input type="submit" name="submitdateselect" class="button valignmiddle" value="'.$langs->trans("Refresh").'">'; //$nav .= ' <input type="submit" name="submitdateselect" class="button valignmiddle" value="'.$langs->trans("Refresh").'">';
$nav .= ' <button type="submit" name="button_search_x" value="x" class="bordertransp"><span class="fa fa-search"></span></button>'; $nav .= ' <button type="submit" name="button_search_x" value="x" class="bordertransp"><span class="fa fa-search"></span></button>';
$picto = 'calendarweek'; $picto = 'clock';
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].($project->id > 0 ? '?id='.$project->id : '').'">'; print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].($project->id > 0 ? '?id='.$project->id : '').'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
@ -447,7 +447,7 @@ print '<input type="hidden" name="addtimemonth" value="'.$tmp['mon'].'">';
print '<input type="hidden" name="addtimeday" value="'.$tmp['mday'].'">'; print '<input type="hidden" name="addtimeday" value="'.$tmp['mday'].'">';
$head = project_timesheet_prepare_head($mode, $usertoprocess); $head = project_timesheet_prepare_head($mode, $usertoprocess);
print dol_get_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, 'projecttask'); print dol_get_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, $picto);
// Show description of content // Show description of content
print '<div class="hideonsmartphone opacitymedium">'; print '<div class="hideonsmartphone opacitymedium">';
@ -476,6 +476,7 @@ print '<div class="colorbacktimesheet float valignmiddle">';
$titleassigntask = $langs->transnoentities("AssignTaskToMe"); $titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">'; print '<div class="taskiddiv inline-block">';
print img_picto('', 'projecttask');
$formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess);
print '</div>'; print '</div>';
print ' '; print ' ';
@ -500,22 +501,22 @@ $moreforfilter = '';
// If the user can view user other than himself // If the user can view user other than himself
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block hideonsmartphone">'.$langs->trans('User').' </div>'; $moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
$includeonly = 'hierarchyme'; $includeonly = 'hierarchyme';
if (empty($user->rights->user->user->lire)) $includeonly = array($user->id); if (empty($user->rights->user->user->lire)) $includeonly = array($user->id);
$moreforfilter .= $form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); $moreforfilter .= img_picto($langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
{ {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block">'.$langs->trans('Project').' </div>'; $moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= '<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">'; $moreforfilter .= img_picto($langs->trans('Project'), 'project').'<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block">'.$langs->trans('ThirdParty').' </div>'; $moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= '<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">'; $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').'<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }

View File

@ -361,7 +361,7 @@ $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' ';
//$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">'; //$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav .= ' <button type="submit" name="button_search_x" value="x" class="bordertransp"><span class="fa fa-search"></span></button>'; $nav .= ' <button type="submit" name="button_search_x" value="x" class="bordertransp"><span class="fa fa-search"></span></button>';
$picto = 'calendarweek'; $picto = 'clock';
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
@ -372,7 +372,7 @@ print '<input type="hidden" name="month" value="'.$month.'">';
print '<input type="hidden" name="year" value="'.$year.'">'; print '<input type="hidden" name="year" value="'.$year.'">';
$head = project_timesheet_prepare_head($mode, $usertoprocess); $head = project_timesheet_prepare_head($mode, $usertoprocess);
print dol_get_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, 'projecttask'); print dol_get_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, $picto);
// Show description of content // Show description of content
print '<div class="hideonsmartphone opacitymedium">'; print '<div class="hideonsmartphone opacitymedium">';
@ -400,6 +400,7 @@ print '<div class="colorbacktimesheet float valignmiddle">';
$titleassigntask = $langs->transnoentities("AssignTaskToMe"); $titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">'; print '<div class="taskiddiv inline-block">';
print img_picto('', 'projecttask');
$formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1);
print '</div>'; print '</div>';
print ' '; print ' ';
@ -425,22 +426,22 @@ if (! empty($conf->categorie->enabled))
// If the user can view user other than himself // If the user can view user other than himself
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block hideonsmartphone">'.$langs->trans('User').' </div>'; $moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
$includeonly = 'hierachyme'; $includeonly = 'hierachyme';
if (empty($user->rights->user->user->lire)) $includeonly = array($user->id); if (empty($user->rights->user->user->lire)) $includeonly = array($user->id);
$moreforfilter .= $form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= img_picto($langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
{ {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block">'.$langs->trans('Project').' </div>'; $moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= '<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">'; $moreforfilter .= img_picto($langs->trans('Project'), 'project').'<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block">'.$langs->trans('ThirdParty').' </div>'; $moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= '<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">'; $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').'<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }

View File

@ -451,7 +451,7 @@ $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' ';
//$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">'; //$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav .= ' <button type="submit" name="submitdateselect" value="x" class="bordertransp"><span class="fa fa-search"></span></button>'; $nav .= ' <button type="submit" name="submitdateselect" value="x" class="bordertransp"><span class="fa fa-search"></span></button>';
$picto = 'calendarweek'; $picto = 'clock';
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
@ -464,7 +464,7 @@ print '<input type="hidden" name="month" value="'.$month.'">';
print '<input type="hidden" name="year" value="'.$year.'">'; print '<input type="hidden" name="year" value="'.$year.'">';
$head = project_timesheet_prepare_head($mode, $usertoprocess); $head = project_timesheet_prepare_head($mode, $usertoprocess);
print dol_get_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, 'projecttask'); print dol_get_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, $picto);
// Show description of content // Show description of content
print '<div class="hideonsmartphone opacitymedium">'; print '<div class="hideonsmartphone opacitymedium">';
@ -492,6 +492,7 @@ print '<div class="colorbacktimesheet float valignmiddle">';
$titleassigntask = $langs->transnoentities("AssignTaskToMe"); $titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">'; print '<div class="taskiddiv inline-block">';
print img_picto('', 'projecttask');
$formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess);
print '</div>'; print '</div>';
print ' '; print ' ';
@ -555,22 +556,22 @@ if (! empty($conf->categorie->enabled))
// If the user can view user other than himself // If the user can view user other than himself
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block hideonsmartphone">'.$langs->trans('User').' </div>'; $moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
$includeonly = 'hierarchyme'; $includeonly = 'hierarchyme';
if (empty($user->rights->user->user->lire)) $includeonly = array($user->id); if (empty($user->rights->user->user->lire)) $includeonly = array($user->id);
$moreforfilter .= $form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= img_picto($langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
{ {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block">'.$langs->trans('Project').' </div>'; $moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= '<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">'; $moreforfilter .= img_picto($langs->trans('Project'), 'project').'<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block">'.$langs->trans('ThirdParty').' </div>'; $moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= '<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">'; $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').'<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }

View File

@ -1046,13 +1046,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
$title = $langs->trans("ListTaskTimeUserProject"); $title = $langs->trans("ListTaskTimeUserProject");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
} else { } else {
print '<!-- List of time spent for project -->'."\n"; print '<!-- List of time spent for project -->'."\n";
$title = $langs->trans("ListTaskTimeForTask"); $title = $langs->trans("ListTaskTimeForTask");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1);
} }
$i = 0; $i = 0;
@ -1120,7 +1120,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
else $userid = $contactsofproject[0]; else $userid = $contactsofproject[0];
if ($projectstatic->public) $contactsofproject = array(); if ($projectstatic->public) $contactsofproject = array();
print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth250');
} else { } else {
if ($nboftasks) { if ($nboftasks) {
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
@ -1204,7 +1204,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
if (!empty($arrayfields['t.task_label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>'; if (!empty($arrayfields['t.task_label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>';
} }
// Author // Author
if (!empty($arrayfields['author']['checked'])) print '<td class="liste_titre">'.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth150').'</td>'; if (!empty($arrayfields['author']['checked'])) print '<td class="liste_titre">'.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250').'</td>';
// Note // Note
if (!empty($arrayfields['t.note']['checked'])) print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; if (!empty($arrayfields['t.note']['checked'])) print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>';
// Duration // Duration

View File

@ -1304,11 +1304,11 @@ table[summary="list_of_modules"] .fa-cog {
.minwidth500imp { min-width: 250px !important; } .minwidth500imp { min-width: 250px !important; }
} }
select.widthcentpercentminusx, input.widthcentpercentminusx { select.widthcentpercentminusx, span.widthcentpercentminusx, input.widthcentpercentminusx {
width: calc(100% - 52px) !important; width: calc(100% - 52px) !important;
display: inline-block; display: inline-block;
} }
select.widthcentpercentminusxx, input.widthcentpercentminusxx { select.widthcentpercentminusxx, span.widthcentpercentminusxx, input.widthcentpercentminusxx {
width: calc(100% - 70px) !important; width: calc(100% - 70px) !important;
display: inline-block; display: inline-block;
} }

View File

@ -1295,7 +1295,7 @@ table[summary="list_of_modules"] .fa-cog {
.minwidth500imp { min-width: 250px !important; } .minwidth500imp { min-width: 250px !important; }
} }
/* Set a width. Note: add also a max-width that will be used in priority */ /* Set a width. Note: add also a max-width, for example maxwidth500, that will be used in priority */
.widthcentpercentminusx { .widthcentpercentminusx {
width: calc(100% - 50px) !important; width: calc(100% - 50px) !important;
display: inline-block; display: inline-block;

View File

@ -3628,11 +3628,11 @@ if ($action == 'editmeta' || $action == 'createcontainer') // Edit properties of
print '<tr><td class="toptd">'.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).'</td><td>'; print '<tr><td class="toptd">'.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).'</td><td>';
print img_picto('', 'category', 'class="paddingright"'); print img_picto('', 'category', 'class="paddingright"');
print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), null, null, 'quatrevingtpercent widthcentpercentminusx'); print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), null, null, 'minwidth200 widthcentpercentminusxx');
print "</td></tr>"; print "</td></tr>";
} }
if (!empty($conf->global->WEBSITE_PAGE_SHOW_INTERNAL_LINKS_TO_OBJECT)) { if (!empty($conf->global->WEBSITE_PAGE_SHOW_INTERNAL_LINKS_TO_OBJECT)) { // TODO Replace this with link into element_element ?
print '<tr><td class="titlefieldcreate">'; print '<tr><td class="titlefieldcreate">';
print 'ObjectClass'; print 'ObjectClass';
print '</td><td>'; print '</td><td>';