From 3e273d40042a7fd9f3769a25da155566d9dbc238 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Jan 2023 15:11:15 +0100 Subject: [PATCH] Debug v17 --- htdocs/accountancy/expensereport/list.php | 1 - htdocs/accountancy/journal/bankjournal.php | 12 +- htdocs/compta/accounting-files.php | 5 + htdocs/compta/stats/byratecountry.php | 4 +- htdocs/compta/stats/casoc.php | 14 +- htdocs/compta/stats/index.php | 12 +- .../class/conferenceorbooth.class.php | 10 +- .../conferenceorbooth_list.php | 204 ++++++++++++------ htdocs/holiday/list.php | 23 +- htdocs/holiday/month_report.php | 75 ++++--- htdocs/hrm/class/establishment.class.php | 31 +-- .../knowledgerecord_list.php | 2 +- .../modulebuilder/template/myobject_list.php | 1 + .../recruitmentcandidature_agenda.php | 1 + .../recruitmentjobposition_agenda.php | 9 +- htdocs/user/agenda_extsites.php | 30 +++ htdocs/user/perms.php | 17 ++ 17 files changed, 311 insertions(+), 140 deletions(-) diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 9cfbd940875..25b86a8d527 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -443,7 +443,6 @@ if ($result) { $expensereport_static->id = $objp->erid; $userstatic->id = $objp->userid; - $userstatic->ref = $objp->label; $userstatic->login = $objp->login; $userstatic->statut = $objp->statut; $userstatic->email = $objp->email; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 699002395ab..c23392cada0 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -349,7 +349,11 @@ if ($result) { $societestatic->email = $tabcompany[$obj->rowid]['email']; $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); if ($compta_soc) { - $tabtp[$obj->rowid][$compta_soc] += $amounttouse; + if (empty($tabtp[$obj->rowid][$compta_soc])) { + $tabtp[$obj->rowid][$compta_soc] = $amounttouse; + } else { + $tabtp[$obj->rowid][$compta_soc] += $amounttouse; + } } } elseif ($links[$key]['type'] == 'user') { $userstatic->id = $links[$key]['url_id']; @@ -510,7 +514,11 @@ if ($result) { } } - $tabbq[$obj->rowid][$compta_bank] += $amounttouse; + if (empty($tabbq[$obj->rowid][$compta_bank])) { + $tabbq[$obj->rowid][$compta_bank] = $amounttouse; + } else { + $tabbq[$obj->rowid][$compta_bank] += $amounttouse; + } // If no links were found to know the amount on thirdparty, we try to guess it. // This may happens on bank entries without the links lines to 'company'. diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 2f2f5816ae1..af8d626eba1 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -376,6 +376,9 @@ if (($action == 'searchfiles' || $action == 'dl')) { $nofile['country_code'] = $objd->country_code; $nofile['vatnum'] = $objd->vatnum; $nofile['sens'] = $objd->sens; + $nofile['currency'] = $objd->currency; + $nofile['link'] = ''; + $nofile['name'] = ''; $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; } else { @@ -396,6 +399,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $file['country_code'] = $objd->country_code; $file['vatnum'] = $objd->vatnum; $file['sens'] = $objd->sens; + $file['currency'] = $objd->currency; // Save record into array (only the first time it is found) if (empty($filesarray[$file['item'].'_'.$file['id']])) { @@ -415,6 +419,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name'], 'modulepart' => $modulepart, 'subdir' => $subdir, + 'currency' => $file['currency'] ); //var_dump($file['item'].'_'.$file['id']); //var_dump($filesarray[$file['item'].'_'.$file['id']]['files']); diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index fb8ad4de1a5..b9dd6c7429d 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -461,9 +461,9 @@ if ($modecompta == 'CREANCES-DETTES') { $j -= 12; } $monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT); - print ''.price($totalpermonth[$j]).''; + print ''.price(empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]).''; } - print ''.price($totalpermonth['total']).''; + print ''.price(empty($totalpermonth['total']) ? 0 : $totalpermonth['total']).''; print ''; } else { print $db->lasterror(); // Show last sql error diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index d24e5a5452a..b499ca17c71 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -406,12 +406,16 @@ if ($modecompta == "RECETTES-DEPENSES") { while ($i < $num) { $obj = $db->fetch_object($result); - $amount[$obj->rowid] += $obj->amount_ttc; + if (empty($amount[$obj->socid])) { + $amount[$obj->socid] = $obj->amount_ttc; + } else { + $amount[$obj->socid] += $obj->amount_ttc; + } - $name[$obj->rowid] = $obj->name; - $address_zip[$obj->rowid] = $obj->zip; - $address_town[$obj->rowid] = $obj->town; - $address_pays[$obj->rowid] = getCountry($obj->fk_pays); + $name[$obj->socid] = $obj->name; + $address_zip[$obj->socid] = ''; + $address_town[$obj->socid] = ''; + $address_pays[$obj->socid] = 0; $catotal += $obj->amount_ttc; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 058fba33177..7d70bc10527 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -577,7 +577,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { // Montant total HT if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''; - print ($total_ht[$annee] ?price($total_ht[$annee]) : "0"); + print (empty($total_ht[$annee]) ? '0' : price($total_ht[$annee])); print ""; } else { print ' '; @@ -587,7 +587,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { // Total amount if (!empty($total[$annee]) || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''; - print ($total[$annee] ?price($total[$annee]) : "0"); + print (empty($total[$annee]) ? '0' : price($total[$annee])); print ""; } else { print ' '; @@ -595,19 +595,19 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { // Pourcentage total if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) { - if ($total[$annee - 1] && $total[$annee]) { + if (!empty($total[$annee - 1]) && !empty($total[$annee])) { $percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100); print ''; print ($percent >= 0 ? "+$percent" : "$percent").'%'; print ''; } - if ($total[$annee - 1] && !$total[$annee]) { + if (!empty($total[$annee - 1]) && empty($total[$annee])) { print '-100%'; } - if (!$total[$annee - 1] && $total[$annee]) { + if (empty($total[$annee - 1]) && !empty($total[$annee])) { print '+'.$langs->trans('Inf').'%'; } - if (!$total[$annee - 1] && !$total[$annee]) { + if (empty($total[$annee - 1]) && empty($total[$annee])) { print '+0%'; } } else { diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 556443a25e8..db0928efc7d 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -104,12 +104,12 @@ class ConferenceOrBooth extends ActionComm */ public $fields = array( 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"OrganizationEvenLabelName", 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'csslist'=>'left', 'comment'=>"Id"), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"OrganizationEvenLabelName", 'showoncombobox'=>'1', 'autofocusoncreate'=>1), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500', 'csslist'=>'width100'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500', 'csslist'=>'width100'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), - 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), + 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width100'), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',), 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index dd7bfd93a47..1dd77122384 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -25,17 +25,14 @@ // Load Dolibarr environment require '../main.inc.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; global $dolibarr_main_url_root; @@ -56,6 +53,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) $id = GETPOST('id', 'int'); $projectid = GETPOST('projectid', 'int'); @@ -67,8 +65,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -120,11 +119,11 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1, 1, '1'); + $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -235,9 +234,11 @@ if (empty($reshook)) { $form = new Form($db); $now = dol_now(); -$title = $langs->trans('ListOfConferencesOrBooths'); //$help_url="EN:Module_ConferenceOrBooth|FR:Module_ConferenceOrBooth_FR|ES:Módulo_ConferenceOrBooth"; $help_url = ''; +$title = $langs->trans('ListOfConferencesOrBooths'); +$morejs = array(); +$morecss = array(); if ($projectid > 0 || $projectref) { $project = new Project($db); @@ -524,9 +525,13 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); +//$sql .= ", COUNT(rc.rowid) as anotherfield"; + +$sqlfields = $sql; // $sql fields to remove for count total + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.id = ef.fk_object)"; +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as cact ON cact.id=t.fk_action AND cact.module LIKE '%@eventorganization'"; // Add table from hooks @@ -554,17 +559,17 @@ foreach ($search as $key => $val) { $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; + $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; } } } @@ -582,35 +587,42 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= $db->order($sortfield, $sortorder); - // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $resql = $db->query($sql); - $nbtotalofrecords = $db->num_rows($resql); - if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } + $db->free($resql); } -// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - $num = $nbtotalofrecords; -} else { - if ($limit) { - $sql .= $db->plimit($limit + 1, $offset); - } - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); - $num = $db->num_rows($resql); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); } +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + // Direct jump if only one record found if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); @@ -622,6 +634,9 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -629,11 +644,17 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { + if (is_array($search[$key])) { foreach ($search[$key] as $skey) { - $param .= '&search_'.$key.'[]='.urlencode($skey); + if ($skey != '') { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } } - } else { + } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { + $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } } @@ -655,7 +676,7 @@ $arrayofmassactions = array( 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' ('.$langs->trans("ToSpeakers").')', //'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"), ); -if ($permissiontodelete) { +if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { @@ -672,8 +693,11 @@ print ''; print ''; print ''; +print ''; print ''; print ''; +print ''; + $title = $langs->trans("EventOrganizationConfOrBoothes"); @@ -683,7 +707,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort // Add code for pre mass action (confirmation or email presend form) -$topicmail = $projectstatic->title; +$topicmail = ''; $modelmail = "conferenceorbooth"; $objecttmp = new ConferenceOrBooth($db); $trackid = 'conferenceorbooth_'.$object->id; @@ -692,10 +716,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { + $setupstring = ''; foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); + $setupstring .= $key."=".$val.";"; } - print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; + print ''."\n"; + print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'."\n"; } $moreforfilter = ''; @@ -718,7 +745,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); @@ -729,9 +756,15 @@ print ''; +// Action column +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} foreach ($object->fields as $key => $val) { - $searchkey = (empty($search[$key]) ? '' : $search[$key]); - + $searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -739,17 +772,15 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; } @@ -769,16 +806,23 @@ $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} print ''."\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; // Fields title label // -------------------------------------------------------------------- print ''; +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -787,27 +831,32 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $key != 'ref' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label if (!empty($arrayfields['t.'.$key]['checked'])) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + $totalarray['nbfield']++; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} +$totalarray['nbfield']++; print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -819,8 +868,11 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a // Loop on record // -------------------------------------------------------------------- $i = 0; +$savnbfield = $totalarray['nbfield']; $totalarray = array(); -while ($i < ($limit ? min($num, $limit) : $num)) { +$totalarray['nbfield'] = 0; +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { break; // Should not happen @@ -830,10 +882,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $object->setVarsFromFetchObj($obj); // Show here line of result - print ''; - $totalarray['nbfield'] = 0; + $j = 0; + print ''; + // Action column + if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + } foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif ($key == 'status') { @@ -843,7 +907,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap left'; + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'ref', 'status'))) { @@ -852,7 +916,11 @@ while ($i < ($limit ? min($num, $limit) : $num)) { //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; + print ''; if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'ref') { @@ -885,15 +953,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column - print ''; } - print ''; if (!$i) { $totalarray['nbfield']++; } @@ -921,7 +991,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $searchkey, $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { - print $object->showInputField($val, $key, $searchkey, '', '', 'search_', 'maxwidth125', 1); - } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - print ''; + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status onrightofpage' : ''), 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1); } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
'; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -757,6 +788,12 @@ foreach ($object->fields as $key => $val) { print '
'; print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; + } elseif ($key == 'lang') { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + $formadmin = new FormAdmin($db); + print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2); + } else { + print ''; } print '
'; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($object->id, $arrayofselected)) { - $selected = 1; + if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print '
'."\n"; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 564fb8a2a96..dedfed07157 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -827,6 +827,9 @@ if ($resql) { print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } if (!empty($arrayfields['cp.ref']['checked'])) { print ''; @@ -849,8 +852,11 @@ if ($resql) { } } if (!empty($arrayfields['cp.fk_type']['checked'])) { - $labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']); - $labeltypeleavetoshow = empty($typeleaves[$obj->fk_type]['label']) ? $langs->trans("TypeWasDisabledOrRemoved", $obj->fk_type) : $labeltypeleavetoshow; + if (empty($typeleaves[$obj->fk_type])) { + $labeltypeleavetoshow = $langs->trans("TypeWasDisabledOrRemoved", $obj->fk_type); + } else { + $labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']); + } print ''; print $labeltypeleavetoshow; @@ -941,9 +947,9 @@ if ($resql) { print ''; } print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } print ''."\n"; @@ -954,6 +960,9 @@ if ($resql) { // Add a line for total if there is a total to show if (!empty($arrayfields['duration']['checked'])) { print ''; + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { if ($key == 'duration') { @@ -964,7 +973,9 @@ if ($resql) { } } // status - print ''; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } print ''; } } diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index a1a23715126..fe2d33ff78a 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -227,27 +227,34 @@ print '
'; $moreforfilter = ''; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ''; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; -print ''; +print '
'; -print ''; +print ''; + +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} // Filter: Ref if (!empty($arrayfields['cp.ref']['checked'])) { - print ''; } // Filter: Employee if (!empty($arrayfields['cp.fk_user']['checked'])) { - print ''; } // Filter: Type @@ -259,45 +266,50 @@ if (!empty($arrayfields['cp.fk_type']['checked'])) { $arraytypeleaves[$val['rowid']] = $labeltoshow; } - print ''; } if (!empty($arrayfields['cp.date_debut']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['cp.date_fin']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['used_days']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['date_start_month']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['date_end_month']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['used_days_month']['checked'])) { - print ''; + print ''; } // Filter: Description if (!empty($arrayfields['cp.description']['checked'])) { - print ''; } - // Action column -print ''; +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} print ''; print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} if (!empty($arrayfields['cp.ref']['checked'])) { print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', '', '', $sortfield, $sortorder); } @@ -331,11 +343,14 @@ if (!empty($arrayfields['used_days_month']['checked'])) { if (!empty($arrayfields['cp.description']['checked'])) { print_liste_field_titre($arrayfields['cp.description']['label'], $_SERVER["PHP_SELF"], 'cp.description', '', '', '', $sortfield, $sortorder); } -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} print ''; if ($num == 0) { - print ''; + print ''; } else { while ($obj = $db->fetch_object($resql)) { $user = new User($db); @@ -385,6 +400,10 @@ if ($num == 0) { $holidaystatic->ref = $obj->ref; print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } if (!empty($arrayfields['cp.ref']['checked'])) { print ''; @@ -430,8 +449,10 @@ if ($num == 0) { if (!empty($arrayfields['cp.description']['checked'])) { print ''; } - - print ''; + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } print ''; } } diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 6a37ba1e929..05bd8d47cf8 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -285,7 +285,7 @@ class Establishment extends CommonObject * Load an object from database * * @param int $id Id of record to load - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >=0 if OK */ public function fetch($id) { @@ -299,21 +299,24 @@ class Establishment extends CommonObject $result = $this->db->query($sql); if ($result) { $obj = $this->db->fetch_object($result); + if ($obj) { + $this->id = $obj->rowid; + $this->ref = $obj->ref; + $this->label = $obj->label; + $this->address = $obj->address; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->status = $obj->status; + $this->entity = $obj->entity; - $this->id = $obj->rowid; - $this->ref = $obj->ref; - $this->label = $obj->label; - $this->address = $obj->address; - $this->zip = $obj->zip; - $this->town = $obj->town; - $this->status = $obj->status; - $this->entity = $obj->entity; + $this->country_id = $obj->country_id; + $this->country_code = $obj->country_code; + $this->country = $obj->country; - $this->country_id = $obj->country_id; - $this->country_code = $obj->country_code; - $this->country = $obj->country; - - return 1; + return 1; + } else { + return 0; + } } else { $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index dffd3d63d7b..cafb5776cf7 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -501,7 +501,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 1135f6d9498..95442195ff9 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -492,6 +492,7 @@ print ''; print ''; print ''; print ''; +print ''; print ''; diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 04118f55572..3648b8ca13b 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -41,6 +41,7 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); $socid = GETPOST('socid', 'int'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index f2f4d37484b..fab164dcd2f 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -40,6 +40,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); @@ -79,7 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->recruitment->multidir_output[$object->entity]."/".$object->id; + $upload_dir = $conf->recruitment->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_addupdatedelete.inc.php @@ -163,11 +164,11 @@ if ($object->id > 0) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, 0, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { @@ -228,7 +229,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { - $param = '&id='.$object->id.'&socid='.$socid; + $param = '&id='.$object->id; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 4891480cc2d..c2b58c4e2a0 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -176,8 +176,38 @@ $morehtmlref .= ''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref); +print '
'; print '
'; +print '
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; + print ''; print ''; - print ''; + print ''; + print ''; print $form->select_dolusers($search_employee, "search_employee", 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth100'); - print ''; + print ''; + print ''; print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1); - print ''; + print ''; + print ''; print ''; - print ''; + print ''; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'.$langs->trans('None').'
'.$langs->trans('None').'
'.$holidaystatic->getNomUrl(1, 1).''.dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)).'
'; + +// Login +print ''; +if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; +} else { + print ''; +} +print ''."\n"; + +print '
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $addadmin = ''; + if (property_exists($object, 'admin')) { + if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) { + $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); + } elseif (!empty($object->admin)) { + $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); + } + } + print showValueWithClipboardCPButton($object->login).$addadmin; + print '
'; + +print '
'; + +print dol_get_fiche_end(); + print '
'; print ''.$langs->trans("AgendaExtSitesDesc")."
\n"; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index a65762b6183..1cd094d882d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -288,6 +288,23 @@ if (!empty($object->ldap_sid) && $object->statut == 0) { } print ''."\n"; +// Type +print ''; +$text = $langs->trans("Type"); +print $form->textwithpicto($text, $langs->trans("InternalExternalDesc")); +print ''; +$type = $langs->trans("Internal"); +if ($object->socid > 0) { + $type = $langs->trans("External"); +} +print ''; +print $type; +if ($object->ldap_sid) { + print ' ('.$langs->trans("DomainUser").')'; +} +print ''; +print ''."\n"; + print ''; print '';