Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/user/class/user.class.php
This commit is contained in:
commit
113ef1a02b
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,6 +16,7 @@ default.properties
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
*.orig
|
||||
Thumbs.db
|
||||
/dolibarr_genesis.mp4
|
||||
# Log files
|
||||
|
||||
Binary file not shown.
@ -223,7 +223,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
$datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
|
||||
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (GETPOSTISSET("remonth") ? $datepaye : -1) : 0;
|
||||
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (GETPOSTISSET("remonth") ? $datepaye : -1) : '';
|
||||
print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution"));
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
@ -236,7 +236,7 @@ if ($action == 'create')
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
|
||||
print '<td>';
|
||||
$form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list
|
||||
$form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list
|
||||
print '</td></tr>';
|
||||
|
||||
// Number
|
||||
|
||||
@ -352,7 +352,7 @@ class FormProjets
|
||||
if (empty($option_only) && !empty($conf->use_javascript_ajax))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$out .= $comboenhancement;
|
||||
$morecss = 'minwidth200 maxwidth500';
|
||||
}
|
||||
@ -388,7 +388,7 @@ class FormProjets
|
||||
continue;
|
||||
}
|
||||
|
||||
$labeltoshow = '';
|
||||
$labeltoshow = ''; $titletoshow = '';
|
||||
|
||||
$disabled = 0;
|
||||
if ($obj->fk_statut == Project::STATUS_DRAFT)
|
||||
@ -408,32 +408,39 @@ class FormProjets
|
||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||
$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;
|
||||
if ($obj->fk_statut == Project::STATUS_DRAFT)
|
||||
{
|
||||
if ($obj->fk_statut == Project::STATUS_DRAFT) {
|
||||
$disabled = 1;
|
||||
$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;
|
||||
$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;
|
||||
$labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany");
|
||||
$titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>';
|
||||
}
|
||||
$labeltoshow .= ' - ';
|
||||
$titletoshow .= ' - ';
|
||||
}
|
||||
|
||||
// Label for task
|
||||
$labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
|
||||
$titletoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength);
|
||||
|
||||
if (!empty($selected) && $selected == $obj->rowid)
|
||||
{
|
||||
$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
|
||||
$out .= '>'.$labeltoshow.'</option>';
|
||||
} else {
|
||||
@ -445,6 +452,7 @@ class FormProjets
|
||||
if ($disabled) $resultat .= ' disabled';
|
||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
|
||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||
$resultat .= ' data-html="'.dol_escape_htmltag($titletoshow).'"';
|
||||
$resultat .= '>';
|
||||
$resultat .= $labeltoshow;
|
||||
$resultat .= '</option>';
|
||||
|
||||
@ -290,7 +290,7 @@ class Utils
|
||||
if (!empty($dolibarr_main_db_pass))
|
||||
{
|
||||
$paramcrypted .= ' -p"'.preg_replace('/./i', '*', $dolibarr_main_db_pass).'"';
|
||||
$paramclear .= ' -p"'.str_replace(array('"', '`'), array('\"', '\`'), $dolibarr_main_db_pass).'"';
|
||||
$paramclear .= ' -p"'.str_replace(array('"', '`', '$'), array('\"', '\`', '\$'), $dolibarr_main_db_pass).'"';
|
||||
}
|
||||
|
||||
$handle = '';
|
||||
|
||||
@ -3268,7 +3268,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'intervention', 'label', 'language', 'link', 'list', 'listlight', 'lot',
|
||||
'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_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_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice',
|
||||
'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label',
|
||||
|
||||
@ -476,6 +476,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$projectstatic->public = $lines[$i]->public;
|
||||
$projectstatic->title = $lines[$i]->projectlabel;
|
||||
$projectstatic->usage_bill_time = $lines[$i]->usage_bill_time;
|
||||
$projectstatic->status = $lines[$i]->projectstatus;
|
||||
|
||||
$taskstatic->id = $lines[$i]->id;
|
||||
$taskstatic->ref = $lines[$i]->ref;
|
||||
@ -881,6 +882,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
|
||||
$projectstatic->ref = $lines[$i]->project_ref;
|
||||
$projectstatic->title = $lines[$i]->project_label;
|
||||
$projectstatic->public = $lines[$i]->public;
|
||||
$projectstatic->status = $lines[$i]->project_status;
|
||||
|
||||
$taskstatic->id = $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->public = $lines[$i]->public;
|
||||
$projectstatic->thirdparty_name = $lines[$i]->thirdparty_name;
|
||||
$projectstatic->status = $lines[$i]->projectstatus;
|
||||
|
||||
$taskstatic->id = $lines[$i]->id;
|
||||
$taskstatic->ref = ($lines[$i]->ref ? $lines[$i]->ref : $lines[$i]->id);
|
||||
|
||||
@ -46,6 +46,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
|
||||
$mode_search = 0;
|
||||
if (in_array($typ, array('int', 'double', 'real', 'price'))) $mode_search = 1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist', 'link')) && $crit != '0' && $crit != '-1') $mode_search = 2; // Search on a foreign key int
|
||||
if (in_array($typ, array('sellist')) && !is_numeric($crit)) $mode_search = 0;// Search on a foreign key string
|
||||
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search = 4; // Search on a multiselect field with sql type = text
|
||||
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
|
||||
elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {
|
||||
|
||||
@ -343,6 +343,7 @@ ALTER TABLE llx_commande_fournisseurdet ADD INDEX idx_commande_fournisseurdet_fk
|
||||
|
||||
|
||||
-- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode MODIFY COLUMN tracking varchar(255) NULL;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_c_shipment_mode ALTER COLUMN tracking DROP NOT NULL;
|
||||
|
||||
INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (9,'INPERSON', 'In person at your site', NULL, NULL, 0);
|
||||
INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (10,'FEDEX', 'Fedex', NULL, 'https://www.fedex.com/apps/fedextrack/index.html?tracknumbers={TRACKID}', 0);
|
||||
|
||||
@ -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 .= ' <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 '<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'].'">';
|
||||
|
||||
$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
|
||||
print '<div class="hideonsmartphone opacitymedium">';
|
||||
@ -476,6 +476,7 @@ print '<div class="colorbacktimesheet float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
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);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
@ -500,22 +501,22 @@ $moreforfilter = '';
|
||||
|
||||
// If the user can view user other than himself
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone">'.$langs->trans('User').' </div>';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
|
||||
$includeonly = 'hierarchyme';
|
||||
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>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
|
||||
{
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block">'.$langs->trans('Project').' </div>';
|
||||
$moreforfilter .= '<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
|
||||
$moreforfilter .= '<div class="inline-block"></div>';
|
||||
$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 class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block">'.$langs->trans('ThirdParty').' </div>';
|
||||
$moreforfilter .= '<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
|
||||
$moreforfilter .= '<div class="inline-block"></div>';
|
||||
$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>';
|
||||
}
|
||||
|
||||
|
||||
@ -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 .= ' <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 '<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.'">';
|
||||
|
||||
$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
|
||||
print '<div class="hideonsmartphone opacitymedium">';
|
||||
@ -400,6 +400,7 @@ print '<div class="colorbacktimesheet float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
print '<div class="taskiddiv inline-block">';
|
||||
print img_picto('', 'projecttask');
|
||||
$formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
@ -425,22 +426,22 @@ if (! empty($conf->categorie->enabled))
|
||||
|
||||
// If the user can view user other than himself
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone">'.$langs->trans('User').' </div>';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
|
||||
$includeonly = 'hierachyme';
|
||||
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>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
|
||||
{
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block">'.$langs->trans('Project').' </div>';
|
||||
$moreforfilter .= '<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
|
||||
$moreforfilter .= '<div class="inline-block"></div>';
|
||||
$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 class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block">'.$langs->trans('ThirdParty').' </div>';
|
||||
$moreforfilter .= '<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
|
||||
$moreforfilter .= '<div class="inline-block"></div>';
|
||||
$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>';
|
||||
}
|
||||
|
||||
|
||||
@ -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 .= ' <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 '<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.'">';
|
||||
|
||||
$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
|
||||
print '<div class="hideonsmartphone opacitymedium">';
|
||||
@ -492,6 +492,7 @@ print '<div class="colorbacktimesheet float valignmiddle">';
|
||||
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
|
||||
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
|
||||
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);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
@ -555,22 +556,22 @@ if (! empty($conf->categorie->enabled))
|
||||
|
||||
// If the user can view user other than himself
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone">'.$langs->trans('User').' </div>';
|
||||
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
|
||||
$includeonly = 'hierarchyme';
|
||||
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>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
|
||||
{
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block">'.$langs->trans('Project').' </div>';
|
||||
$moreforfilter .= '<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
|
||||
$moreforfilter .= '<div class="inline-block"></div>';
|
||||
$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 class="divsearchfield">';
|
||||
$moreforfilter .= '<div class="inline-block">'.$langs->trans('ThirdParty').' </div>';
|
||||
$moreforfilter .= '<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
|
||||
$moreforfilter .= '<div class="inline-block"></div>';
|
||||
$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>';
|
||||
}
|
||||
|
||||
|
||||
@ -174,7 +174,8 @@ if (empty($reshook))
|
||||
if (!$error && $result > 0)
|
||||
{
|
||||
// Add myself as project leader
|
||||
$result = $object->add_contact($user->id, 'PROJECTLEADER', 'internal');
|
||||
$typeofcontact = 'PROJECTLEADER'; // TODO If use rename this code in dictionary, the add_contact will generate an error.
|
||||
$result = $object->add_contact($user->id, $typeofcontact, 'internal');
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
||||
@ -69,7 +69,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
$listofstatus = array_keys($listofoppstatus);
|
||||
// Complete with values found into database and not into the dictionary
|
||||
foreach ($valsamount as $key => $val) {
|
||||
if (!in_array($key, $listofstatus)) {
|
||||
if (!in_array($key, $listofstatus) && $key) {
|
||||
$listofstatus[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1046,13 +1046,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
||||
|
||||
$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 {
|
||||
print '<!-- List of time spent for project -->'."\n";
|
||||
|
||||
$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;
|
||||
@ -1120,7 +1120,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
||||
else $userid = $contactsofproject[0];
|
||||
|
||||
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 {
|
||||
if ($nboftasks) {
|
||||
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>';
|
||||
}
|
||||
// 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
|
||||
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
|
||||
|
||||
@ -818,7 +818,7 @@ if (!empty($arrayfields['country.code_iso']['checked']))
|
||||
if (!empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1);
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Staff
|
||||
|
||||
@ -1420,10 +1420,10 @@ class User extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||
$sql .= " SET fk_socpeople=".$contact->id;
|
||||
$sql .= ", civility='".$this->db->escape($contact->civility_code)."'";
|
||||
if ($contact->socid) {
|
||||
if ($contact->socid > 0) {
|
||||
$sql .= ", fk_soc=".$contact->socid;
|
||||
}
|
||||
$sql .= " WHERE rowid=".$this->id;
|
||||
$sql .= " WHERE rowid=".((int) $this->id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ $user = new User($db);
|
||||
@set_time_limit(0);
|
||||
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
||||
|
||||
if (!in_array($type, array('thirdparties', 'contacts', 'users', 'members'))) {
|
||||
if (!in_array($type, array('all', 'thirdparties', 'contacts', 'users', 'members'))) {
|
||||
print "Bad value for parameter type.\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user