Debug v18

This commit is contained in:
Laurent Destailleur 2023-03-02 19:40:28 +01:00
parent 81da38eb7f
commit 54bb784138
30 changed files with 622 additions and 568 deletions

View File

@ -1014,7 +1014,8 @@ print "</tr>\n";
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $maxinloop) {
$obj = $db->fetch_object($resql);
$datefin = $db->jdate($obj->datefin);

View File

@ -502,7 +502,8 @@ print "</tr>\n";
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($result);
$subscription->ref = $obj->crowid;
@ -546,7 +547,7 @@ while ($i < min($num, $limit)) {
}
// Output Kanban
print $subscription->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -1723,7 +1723,7 @@ if ($resql) {
$objectstatic->author = $userstatic->getNomUrl(1);
$objectstatic->fk_project = $projectstatic->getNomUrl(1);
print $objectstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -574,6 +574,7 @@ $total = array();
$found = 0;
$i = 0;
$lastcurrencycode = '';
$imaxinloop = ($limit ? min($num, $limit) : $num);
foreach ($accounts as $key => $type) {
if ($i >= $limit) {
@ -600,7 +601,7 @@ foreach ($accounts as $key => $type) {
}
// Output Kanban
print $objecttmp->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

File diff suppressed because it is too large Load Diff

View File

@ -1928,7 +1928,7 @@ if ($resql) {
$userstatic->fetch($obj->fk_user_author);
$facturestatic->fk_user_author = $userstatic->getNomUrl(1);
print $facturestatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -28,15 +28,19 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php';
// Load translation files required by the page
$langs->load("compta");
$limit = GETPOST('limit', 'int');
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'tax', '', '', 'charges');
$ltt = GETPOST("localTaxType", 'int');
$mode = GETPOST('mode', 'alpha');
/*
* View
*/
@ -80,8 +84,9 @@ if ($result) {
print '<td class="nowrap" align="left">'.$langs->trans("DatePayment").'</td>';
print "<td align=\"right\">".$langs->trans("PayedByThisPayment")."</td>";
print "</tr>\n";
$var = 1;
while ($i < $num) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($result);
$localtax_static->label = $obj->label;
@ -100,7 +105,7 @@ if ($result) {
}
// Output Kanban
print $localtax_static->getKanbanView('');
if ($i == ($num - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -226,7 +226,8 @@ if ($resql) {
print "</tr>\n";
if ($num > 0) {
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$objp = $db->fetch_object($resql);
$checkdepositstatic->id = $objp->rowid;
@ -247,7 +248,7 @@ if ($resql) {
}
// Output Kanban
print $checkdepositstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -265,7 +265,8 @@ if ($result) {
print "</tr>\n";
if ($num) {
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($result);
$bon->id = $obj->rowid;
@ -285,9 +286,8 @@ if ($result) {
print '<div class="box-flex-container kanban">';
}
// Output Kanban
print $bon->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -239,7 +239,6 @@ if ($result) {
print '<div class="box-flex-container kanban">';
}
// Output Kanban
print $directdebitorder->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
print '</div>';

View File

@ -594,7 +594,8 @@ $i = 0;
$totalarray = $TLoadedUsers = array();
$totalarray['nbfield'] = 0;
$totalarray['val']['totalttcfield'] = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
$chargesociale_static->id = $obj->rowid;
@ -617,10 +618,9 @@ while ($i < min($num, $limit)) {
print '<div class="box-flex-container kanban">';
}
// Output Kanban
$chargesociale_static->fk_project = $projectstatic->getNomUrl();
print $chargesociale_static->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -475,7 +475,8 @@ $totalarray = array();
$totalarray['nbfield'] = 0;
$total = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
$tva_static->id = $obj->rowid;
@ -492,9 +493,8 @@ while ($i < min($num, $limit)) {
print '<div class="box-flex-container kanban">';
}
// Output Kanban
print $tva_static->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -990,7 +990,6 @@ while ($i < $imaxinloop) {
print '<tr><td colspan="'.$savnbfield.'">';
print '<div class="box-flex-container kanban">';
}
// Output Kanban
$contracttmp->societe = $socstatic->getNomUrl();
$contracttmp->date_contrat = $obj->date_contrat;

View File

@ -289,7 +289,8 @@ if ($resql) {
}
print "</tr>\n";
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$objp = $db->fetch_object($resql);
$donationstatic->setVarsFromFetchObj($objp);
$company = new Societe($db);
@ -314,7 +315,7 @@ if ($resql) {
}
print $donationstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -732,6 +732,8 @@ if ($resql) {
$totalarray['val']['d.total_tva'] = 0;
$totalarray['val']['d.total_ttc'] = 0;
$totalarray['totalizable'] = array();
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
@ -756,14 +758,12 @@ if ($resql) {
$expensereportstatic->fk_user_author = $usertmp->getNomUrl(1);
// Output Kanban
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
if ($massactionbutton || $massaction) {
$selected = 0;
if ($massactionbutton || $massaction) {
$selected = 0;
print $expensereportstatic->getKanbanView('');
}
print $expensereportstatic->getKanbanView('');
}
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -477,7 +477,8 @@ $i = 0;
$savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$objp = $db->fetch_object($resql);
$paymentexpensereportstatic->id = $objp->rowid;
@ -504,7 +505,7 @@ while ($i < min($num, $limit)) {
}
// Output Kanban
print $paymentexpensereportstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -714,9 +714,8 @@ while ($i < $imaxinloop) {
$objectstatic->duration = $obj->duree;
$objectstatic->socid = $companystatic->getNomUrl(1, '', 44);
print $objectstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -1686,7 +1686,7 @@ if ($resql) {
$objectstatic->socid = $thirdpartytmp->getNomUrl('supplier', 0, 0, -1);
// Output Kanban
print $objectstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -1359,7 +1359,8 @@ if ($num > 0) {
$totalarray['val']['f.total_localtax1']=0;
$totalarray['val']['f.total_ttc']=0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
$datelimit = $db->jdate($obj->datelimite);
@ -1423,7 +1424,7 @@ if ($num > 0) {
$facturestatic->total_ht = $obj->total_ht;
$facturestatic->date = $obj->datef;
print $facturestatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -790,7 +790,8 @@ if ($resql) {
$totalarray = array();
$totalarray['nbfield'] = 0;
$totalduration = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
// Leave request
@ -852,7 +853,7 @@ if ($resql) {
$arraydata = array('user'=>$userstatic, 'labeltype'=>$labeltypeleavetoshow);
print $holidaystatic->getKanbanView('', $arraydata);
}
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -567,7 +567,8 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen

View File

@ -544,7 +544,8 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$imaxiloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen
@ -570,7 +571,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
print $object->getKanbanView('');
}
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -270,7 +270,8 @@ if ($resql) {
// --------------------------------------------------------------------
$i = 0;
$totalarray = array();
while ($i < ($limit ? min($num, $limit) : $num)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen
@ -294,7 +295,7 @@ if ($resql) {
$loan_static->totalpaid = $obj->paid;
print $loan_static->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -596,7 +596,8 @@ $bom = new Bom($db);
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen
@ -619,7 +620,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// Output Kanban
print $object->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -619,7 +619,8 @@ $i = 0;
$warehouse = new Entrepot($db);
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen

View File

@ -66,7 +66,7 @@ $pagenext = $page + 1;
$object = new RecruitmentCandidature($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('recruitmentcandidaturelist')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -102,6 +102,13 @@ foreach ($object->fields as $key => $val) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}
/*$parameters = array('fieldstosearchall'=>$fieldstosearchall);
$reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$fieldstosearchall = $hookmanager->resArray['fieldstosearchall'];
} elseif ($reshook == 0) {
$fieldstosearchall = array_merge($fieldstosearchall, $hookmanager->resArray['fieldstosearchall']);
}*/
// Definition of array of fields for columns
$arrayfields = array();
@ -226,6 +233,9 @@ $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);
$sqlfields = $sql; // $sql fields to remove for count total
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
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)";
@ -279,7 +289,7 @@ if (!empty($id)) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
/* If a group by is required
@ -304,7 +314,8 @@ $sql = preg_replace('/,\s*$/', '', $sql);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
$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);
@ -313,7 +324,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
dol_print_error($db);
}
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
@ -500,7 +511,7 @@ 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) {
if ($skey != '') {
$param .= '&search_'.$key.'[]='.urlencode($skey);
@ -581,7 +592,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_
$moreforfilter.= '</div>';*/
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$moreforfilter .= $hookmanager->resPrint;
} else {
@ -604,10 +615,10 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
// Fields title search
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
print '<tr class="liste_titre_filter">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="liste_titre maxwidthsearch">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch center">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print '</td>';
@ -621,13 +632,13 @@ 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 '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 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'])) {
@ -652,11 +663,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="liste_titre maxwidthsearch">';
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
@ -669,8 +680,9 @@ $totalarray['nbfield'] = 0;
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
foreach ($object->fields as $key => $val) {
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
@ -680,12 +692,12 @@ 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';
}
$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";
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
$totalarray['nbfield']++;
}
}
@ -693,13 +705,13 @@ foreach ($object->fields as $key => $val) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$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
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
$totalarray['nbfield']++;
print '</tr>'."\n";
@ -707,7 +719,7 @@ print '</tr>'."\n";
$needToFetchEachLine = 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)) {
if ($val && preg_match('/\$object/', $val)) {
$needToFetchEachLine++; // There is at least one compute field that use $object
}
}
@ -739,14 +751,11 @@ while ($i < $imaxinloop) {
$recuitment->fetch($obj->fk_recruitmentjobposition);
$object->fk_recruitmentjobposition = $recuitment->getNomUrl();
$object->phone = $obj->phone;
// Output Kanban
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
if ($massactionbutton || $massaction) {
$selected = 0;
}
// Output Kanban
print $object->getKanbanView('');
if ($massactionbutton || $massaction) {
$selected = 0;
}
// Output Kanban
print $object->getKanbanView('');
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
@ -756,7 +765,7 @@ while ($i < $imaxinloop) {
$j = 0;
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
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;
@ -766,6 +775,9 @@ while ($i < $imaxinloop) {
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
foreach ($object->fields as $key => $val) {
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
@ -787,7 +799,7 @@ while ($i < $imaxinloop) {
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '');
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
if (preg_match('/tdoverflow/', $cssforfield)) {
print ' title="'.dol_escape_htmltag($object->$key).'"';
}
@ -821,10 +833,10 @@ while ($i < $imaxinloop) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
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;
@ -834,9 +846,9 @@ while ($i < $imaxinloop) {
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}
if (!$i) {
$totalarray['nbfield']++;
if (!$i) {
$totalarray['nbfield']++;
}
}
print '</tr>'."\n";

View File

@ -593,13 +593,11 @@ while ($i < $imaxinloop) {
print '<tr><td colspan="'.$savnbfield.'">';
print '<div class="box-flex-container kanban">';
}
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
if ($massactionbutton || $massaction) {
$selected = 0;
}
// Output Kanban
print $object->getKanbanView('');
if ($massactionbutton || $massaction) {
$selected = 0;
}
// Output Kanban
print $object->getKanbanView('');
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';

View File

@ -537,7 +537,8 @@ $totalarray = array();
$totalarray['nbfield'] = 0;
$totalarray['val'] = array();
$totalarray['val']['totalttcfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen
@ -574,7 +575,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
// Output Kanban
print $salstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -534,7 +534,7 @@ $i = 0;
$total = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break;
@ -544,8 +544,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// Store properties in $object
$object->setVarsFromFetchObj($obj);
$userstatic->id = $obj->uid;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
@ -570,18 +568,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$paymentsalstatic->fk_bank = $accountlinestatic->getNomUrl(1);
$paymentsalstatic->fk_user_author = $userstatic->getNomUrl(1);
if ($mode == 'kanban') {
if ($i == 0) {
print '<tr><td colspan="12">';
print '<div class="box-flex-container kanban">';
}
// Output Kanban
print $paymentsalstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}

View File

@ -965,7 +965,9 @@ if ($resql) {
$totalarray['val']['sp.total_ht'] = 0;
$totalarray['val']['sp.total_tva'] = 0;
$totalarray['val']['sp.total_ttc'] = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
$objectstatic->id = $obj->rowid;
@ -992,7 +994,7 @@ if ($resql) {
$objectstatic->user_author_id = $userstatic->getNomUrl(1);
$objectstatic->delivery_date = $obj->dp;
print $objectstatic->getKanbanView('');
if ($i == (min($num, $limit) - 1)) {
if ($i == ($imaxinloop - 1)) {
print '</div>';
print '</td></tr>';
}