diff --git a/.gitignore b/.gitignore index b49fdf8dc86..371c8be2f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ default.properties .DS_Store .idea *.iml +*.orig Thumbs.db /dolibarr_genesis.mp4 # Log files diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb index 27bc4ab2403..37929762bab 100644 Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 299cdf9a6c3..247f66b5acf 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -223,7 +223,7 @@ if ($action == 'create') print ''.$langs->trans("Date").''; $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 ""; print ''; @@ -236,7 +236,7 @@ if ($action == 'create') print ''; print ''.$langs->trans('AccountToDebit').''; print ''; - $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 ''; // Number diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 9ebc3a4c307..f246342a17e 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -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 .= ' ('.$obj->name.')'; + } $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 .= ' - '.$langs->trans("Draft").''; + } 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 .= ' - '.$langs->trans("Closed").''; + } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { $disabled = 1; $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); + $titletoshow .= ' - '.$langs->trans("LinkedToAnotherCompany").''; } $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 .= ''; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 07b67e30062..2b239a90d98 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -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 = ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ab8b2f6e089..c146f1f9a47 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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', diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 3c8a79a9249..d7c7c53f8de 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -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); diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 164afc753e7..b0fb03f2709 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -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) { diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 3e2a9b37278..f11fa826fac 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -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); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 24ac982896e..a4a37f22a31 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -433,7 +433,7 @@ $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; //$nav .= ' '; $nav .= ' '; -$picto = 'calendarweek'; +$picto = 'clock'; print '
id > 0 ? '?id='.$project->id : '').'">'; print ''; @@ -447,7 +447,7 @@ print ''; print ''; $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 '
'; @@ -476,6 +476,7 @@ print '
'; $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; +print img_picto('', 'projecttask'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); print '
'; print ' '; @@ -500,22 +501,22 @@ $moreforfilter = ''; // If the user can view user other than himself $moreforfilter .= '
'; -$moreforfilter .= '
'.$langs->trans('User').'
'; +$moreforfilter .= '
'; $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 .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; - $moreforfilter .= '
'.$langs->trans('Project').'
'; - $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= img_picto($langs->trans('Project'), 'project').''; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= '
'.$langs->trans('ThirdParty').'
'; - $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').''; $moreforfilter .= '
'; } diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 4904e2379f0..9a95f8abf79 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -361,7 +361,7 @@ $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; //$nav.=' '; $nav .= ' '; -$picto = 'calendarweek'; +$picto = 'clock'; print ''; print ''; @@ -372,7 +372,7 @@ print ''; print ''; $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 '
'; @@ -400,6 +400,7 @@ print '
'; $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; +print img_picto('', 'projecttask'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1); print '
'; print ' '; @@ -425,22 +426,22 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter .= '
'; -$moreforfilter .= '
'.$langs->trans('User').'
'; +$moreforfilter .= '
'; $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 .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; - $moreforfilter .= '
'.$langs->trans('Project').'
'; - $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= img_picto($langs->trans('Project'), 'project').''; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= '
'.$langs->trans('ThirdParty').'
'; - $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').''; $moreforfilter .= '
'; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 4f8fbb8d865..c29486302af 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -451,7 +451,7 @@ $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; //$nav .= ' '; $nav .= ' '; -$picto = 'calendarweek'; +$picto = 'clock'; print ''; print ''; @@ -464,7 +464,7 @@ print ''; print ''; $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 '
'; @@ -492,6 +492,7 @@ print '
'; $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; +print img_picto('', 'projecttask'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); print '
'; print ' '; @@ -555,22 +556,22 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter .= '
'; -$moreforfilter .= '
'.$langs->trans('User').'
'; +$moreforfilter .= '
'; $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 .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; - $moreforfilter .= '
'.$langs->trans('Project').'
'; - $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= img_picto($langs->trans('Project'), 'project').''; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= '
'.$langs->trans('ThirdParty').'
'; - $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').''; $moreforfilter .= '
'; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 653083bed04..364cb30633a 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -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"); diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 9588951307a..66b04527772 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -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; } } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index cb92be401c1..5cca624d11f 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -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 ''."\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 ''; } // Author - if (!empty($arrayfields['author']['checked'])) print ''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth150').''; + if (!empty($arrayfields['author']['checked'])) print ''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250').''; // Note if (!empty($arrayfields['t.note']['checked'])) print ''; // Duration diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ec748d95e94..d7ae96cde94 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -818,7 +818,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) if (!empty($arrayfields['typent.code']['checked'])) { print ''; - 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 ''; } // Staff diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d2277cadf68..1aac46933f2 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -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); diff --git a/scripts/emailings/reset-invalid-emails.php b/scripts/emailings/reset-invalid-emails.php index bc35f0f4240..8730d66b96d 100755 --- a/scripts/emailings/reset-invalid-emails.php +++ b/scripts/emailings/reset-invalid-emails.php @@ -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); }