2
0
forked from Wavyzz/dolibarr

Fix all short tables must use the setup for the number of rows

This commit is contained in:
Laurent Destailleur
2024-04-03 15:30:10 +02:00
parent 3fa5e017e6
commit fffe74246c
23 changed files with 280 additions and 96 deletions

View File

@@ -44,8 +44,9 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$max = 5;
$now = dol_now(); $now = dol_now();
$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
/* /*
@@ -137,9 +138,6 @@ if ($user->hasRight('bookcal', 'availabilities', 'read') && isModEnabled('bookca
print '</div><div class="fichetwothirdright">'; print '</div><div class="fichetwothirdright">';
$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject // Last modified myobject
if (isModEnabled('bookcal')) { if (isModEnabled('bookcal')) {

View File

@@ -64,7 +64,7 @@ if (isset($user->socid) && $user->socid > 0) {
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
$now = dol_now(); $now = dol_now();
@@ -479,6 +479,7 @@ if ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO
$companystatic->name_alias = $obj->name_alias; $companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client; $companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta; $companystatic->code_compta = $obj->code_compta;
$companystatic->code_compta_client = $obj->code_compta;
$companystatic->client = $obj->client; $companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur; $companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
@@ -705,6 +706,189 @@ if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) {
} }
/*
* Last modified proposals
*/
if (isModEnabled('proposal')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
$sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")";
$sql .= " AND c.fk_soc = s.rowid";
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
if (!$user->hasRight('societe', 'client', 'voir')) {
$search_sale = $user->id;
}
// Search on sale representative
if ($search_sale && $search_sale != '-1') {
if ($search_sale == -2) {
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc)";
} elseif ($search_sale > 0) {
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
}
}
// Search on socid
if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
$sql .= " ORDER BY c.tms DESC";
$sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
startSimpleTable($langs->trans("LastModifiedProposals", $max), "comm/propal/list.php", "sortfield=p.tms&sortorder=DESC", 2, -1, 'propal');
if ($num) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
$propalstatic->id = $obj->rowid;
$propalstatic->ref = $obj->ref;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->socname;
$companystatic->client = $obj->client;
$companystatic->canvas = $obj->canvas;
$companystatic->email = $obj->email;
$companystatic->code_compta = $obj->code_compta;
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print '<tr class="oddeven">';
print '<td class="nowrap">';
print '<table class="nobordernopadding">';
print '<tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>';
print '<td width="16" class="nobordernopadding nowrap"></td>';
print '<td width="16" class="nobordernopadding right">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
print '</tr>';
print '</table>';
print '</td>';
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
$datem = $db->jdate($obj->datem);
print '<td class="center" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
print dol_print_date($datem, 'day', 'tzuserrel');
print '</td>';
print '<td class="right">'.$propalstatic->LibStatut($obj->status, 3).'</td>';
print '</tr>';
$i++;
}
}
finishSimpleTable(true);
$db->free($resql);
} else {
dol_print_error($db);
}
}
/*
* Latest modified orders
*/
if (isModEnabled('order')) {
$commandestatic = new Commande($db);
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
$sql .= " s.nom as name, s.rowid as socid";
$sql .= ", s.client";
$sql .= ", s.code_client";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->hasRight('societe', 'client', 'voir')) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity('commande').")";
//$sql.= " AND c.fk_statut > 2";
if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->hasRight('societe', 'client', 'voir')) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$sql .= " ORDER BY c.tms DESC";
$sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
startSimpleTable($langs->trans("LastModifiedOrders", $max), "commande/list.php", "sortfield=c.tms&sortorder=DESC", 2, -1, 'order');
if ($num) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td width="20%" class="nowrap">';
$commandestatic->id = $obj->rowid;
$commandestatic->ref = $obj->ref;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->code_client = $obj->code_client;
$companystatic->canvas = $obj->canvas;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1);
print '</td>';
print '<td width="16" class="nobordernopadding nowrap">';
print '&nbsp;';
print '</td>';
print '<td width="16" class="nobordernopadding hideonsmartphone right">';
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->commande->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
print '<td class="nowrap">';
print $companystatic->getNomUrl(1, 'company', 16);
print '</td>';
$datem = $db->jdate($obj->datem);
print '<td class="center" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
print dol_print_date($datem, 'day', 'tzuserrel');
print '</td>';
print '<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).'</td>';
print '</tr>';
$i++;
}
}
finishSimpleTable(true);
} else {
dol_print_error($db);
}
}
/* /*
* Last suppliers * Last suppliers
*/ */

View File

@@ -39,7 +39,7 @@ $hookmanager->initHooks(array('proposalindex'));
$langs->loadLangs(array('propal', 'companies')); $langs->loadLangs(array('propal', 'companies'));
$now = dol_now(); $now = dol_now();
$max = 5; $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
// Security check // Security check
$socid = GETPOSTINT('socid'); $socid = GETPOSTINT('socid');
@@ -160,10 +160,10 @@ print '<div class="fichetwothirdright">';
* Last modified proposals * Last modified proposals
*/ */
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as c,";
$sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")"; $sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")";
$sql .= " AND c.fk_soc = s.rowid"; $sql .= " AND c.fk_soc = s.rowid";
// If the internal user must only see his customers, force searching by him // If the internal user must only see his customers, force searching by him
@@ -190,7 +190,8 @@ $sql .= $db->plimit($max, 0);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
startSimpleTable($langs->trans("LastModifiedProposals", $max), "", "", 3);
startSimpleTable($langs->trans("LastModifiedProposals", $max), "comm/propal/list.php", "sortfield=p.tms&sortorder=DESC", 2, -1, 'propal');
if ($num) { if ($num) {
$i = 0; $i = 0;
@@ -213,7 +214,7 @@ if ($resql) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="20%" class="nowrap">'; print '<td class="nowrap">';
print '<table class="nobordernopadding">'; print '<table class="nobordernopadding">';
print '<tr class="nocellnopadd">'; print '<tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>'; print '<td width="96" class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>';
@@ -224,8 +225,13 @@ if ($resql) {
print '</td>'; print '</td>';
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'; $datem = $db->jdate($obj->datem);
print '<td class="center" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
print dol_print_date($datem, 'day', 'tzuserrel');
print '</td>';
print '<td class="right">'.$propalstatic->LibStatut($obj->status, 3).'</td>';
print '</tr>'; print '</tr>';

View File

@@ -1254,7 +1254,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) {
// Company type // Company type
if (!empty($arrayfields['typent.code']['checked'])) { if (!empty($arrayfields['typent.code']['checked'])) {
print '<td class="liste_titre maxwidth100onsmartphone" align="center">'; print '<td class="liste_titre maxwidth100onsmartphone" align="center">';
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, getDolGlobalString('SOCIETE_SORT_ON_TYPEENT', 'ASC'), 'maxwidth100', 1);
print ajax_combobox('search_type_thirdparty'); print ajax_combobox('search_type_thirdparty');
print '</td>'; print '</td>';
} }
@@ -1525,27 +1525,27 @@ if (!empty($arrayfields['state.nom']['checked'])) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['country.code_iso']['checked'])) { if (!empty($arrayfields['country.code_iso']['checked'])) {
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['typent.code']['checked'])) { if (!empty($arrayfields['typent.code']['checked'])) {
print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['p.date']['checked'])) { if (!empty($arrayfields['p.date']['checked'])) {
print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['p.fin_validite']['checked'])) { if (!empty($arrayfields['p.fin_validite']['checked'])) {
print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['p.date_livraison']['checked'])) { if (!empty($arrayfields['p.date_livraison']['checked'])) {
print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['p.date_signature']['checked'])) { if (!empty($arrayfields['p.date_signature']['checked'])) {
print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
if (!empty($arrayfields['ava.rowid']['checked'])) { if (!empty($arrayfields['ava.rowid']['checked'])) {

View File

@@ -56,9 +56,8 @@ if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables // Maximum elements of the tables
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxLatestEditCount = 5; $maxLatestEditCount = 5;
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
@@ -154,13 +153,11 @@ if (isModEnabled('order')) {
print '</div><div class="fichetwothirdright">'; print '</div><div class="fichetwothirdright">';
$max = 5;
/* /*
* Latest modified orders * Latest modified orders
*/ */
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
$sql .= " s.nom as name, s.rowid as socid"; $sql .= " s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
@@ -184,12 +181,10 @@ $sql .= $db->plimit($max, 0);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th colspan="4">'.$langs->trans("LastModifiedOrders", $max).'</th></tr>';
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
startSimpleTable($langs->trans("LastModifiedOrders", $max), "commande/list.php", "sortfield=c.tms&sortorder=DESC", 2, -1, 'order');
if ($num) { if ($num) {
$i = 0; $i = 0;
while ($i < $num) { while ($i < $num) {
@@ -228,24 +223,28 @@ if ($resql) {
print '<td class="nowrap">'; print '<td class="nowrap">';
print $companystatic->getNomUrl(1, 'company', 16); print $companystatic->getNomUrl(1, 'company', 16);
print '</td>'; print '</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>'; $datem = $db->jdate($obj->datem);
print '<td class="center" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
print dol_print_date($datem, 'day', 'tzuserrel');
print '</td>';
print '<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
} }
} }
print "</table></div><br>"; finishSimpleTable(true);
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
$max = 10;
/* /*
* Orders to process * Orders to process
*/ */
if (isModEnabled('order')) { if (isModEnabled('order')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
$sql .= ", s.canvas"; $sql .= ", s.canvas";
@@ -314,7 +313,7 @@ if (isModEnabled('order')) {
print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n"; print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>'; print '<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;
@@ -334,7 +333,7 @@ if (isModEnabled('order')) {
* Orders that are in process * Orders that are in process
*/ */
if (isModEnabled('order')) { if (isModEnabled('order')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
$sql .= ", s.canvas"; $sql .= ", s.canvas";
@@ -403,7 +402,7 @@ if (isModEnabled('order')) {
print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n"; print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>'; print '<td class="right">'.$commandestatic->LibStatut($obj->status, $obj->facture, 3).'</td>';
print '</tr>'; print '</tr>';
$i++; $i++;

View File

@@ -41,9 +41,8 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables // Maximum elements of the tables
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;

View File

@@ -67,9 +67,8 @@ if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables // Maximum elements of the tables
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxLatestEditCount = 5; $maxLatestEditCount = 5;
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;

View File

@@ -44,6 +44,8 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTI
$statut = GETPOST('statut') ? GETPOST('statut') : 1; $statut = GETPOST('statut') ? GETPOST('statut') : 1;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
// Security check // Security check
$socid = 0; $socid = 0;
$id = GETPOSTINT('id'); $id = GETPOSTINT('id');
@@ -58,6 +60,7 @@ $staticcontratligne = new ContratLigne($db);
$productstatic = new Product($db); $productstatic = new Product($db);
/* /*
* Action * Action
*/ */
@@ -315,7 +318,6 @@ print '</div><div class="fichetwothirdright">';
// Last modified contracts // Last modified contracts
$max = 5;
$sql = 'SELECT '; $sql = 'SELECT ';
$sql .= " sum(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,'; $sql .= " sum(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,';
$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,'; $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,';
@@ -353,7 +355,7 @@ if ($result) {
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastContracts", 5).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastContracts", $max).'</th>';
print '<th class="center">'.$langs->trans("DateModification").'</th>'; print '<th class="center">'.$langs->trans("DateModification").'</th>';
//print '<th class="left">'.$langs->trans("Status").'</th>'; //print '<th class="left">'.$langs->trans("Status").'</th>';
print '<th class="center" width="80" colspan="4">'.$langs->trans("Services").'</th>'; print '<th class="center" width="80" colspan="4">'.$langs->trans("Services").'</th>';

View File

@@ -582,10 +582,6 @@ class Conf extends stdClass
} elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) { } elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
// If this is a module constant (must be at end) // If this is a module constant (must be at end)
$modulename = strtolower($reg[1]); $modulename = strtolower($reg[1]);
$mapping = $this->deprecatedProperties();
if (array_key_exists($modulename, $mapping)) {
$modulename = $mapping[$modulename];
}
$this->modules[$modulename] = $modulename; // Add this module in list of enabled modules $this->modules[$modulename] = $modulename; // Add this module in list of enabled modules
// deprecated in php 8.2 // deprecated in php 8.2
@@ -594,7 +590,18 @@ class Conf extends stdClass
$this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir... $this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir...
} }
$this->$modulename->enabled = true; // TODO Remove this $this->$modulename->enabled = true; // TODO Remove this
//}
// Duplicate entry with the new name
$mapping = $this->deprecatedProperties();
if (array_key_exists($modulename, $mapping)) {
$newmodulename = $mapping[$modulename];
$this->modules[$newmodulename] = $newmodulename;
if (!isset($this->$newmodulename) || !is_object($this->$newmodulename)) {
$this->$newmodulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir...
}
$this->$newmodulename->enabled = true; // TODO Remove this
}
} }
} }
} }

View File

@@ -12641,14 +12641,14 @@ function getNonce()
* @param string $header The first left header of the table (automatic translated) * @param string $header The first left header of the table (automatic translated)
* @param string $link (optional) The link to a internal dolibarr page, when click on the number (without the first "/") * @param string $link (optional) The link to a internal dolibarr page, when click on the number (without the first "/")
* @param string $arguments (optional) Additional arguments for the link (e.g. "search_status=0") * @param string $arguments (optional) Additional arguments for the link (e.g. "search_status=0")
* @param integer $emptyRows (optional) The count of empty columns after the first column * @param integer $emptyColumns (optional) Number of empty columns to add after the first column
* @param integer $number (optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList" * @param integer $number (optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList"
* @param string $pictofulllist (optional) The picto to use for the full list link * @param string $pictofulllist (optional) The picto to use for the full list link
* @return void * @return void
* *
* @see finishSimpleTable() * @see finishSimpleTable()
*/ */
function startSimpleTable($header, $link = "", $arguments = "", $emptyRows = 0, $number = -1, $pictofulllist = '') function startSimpleTable($header, $link = "", $arguments = "", $emptyColumns = 0, $number = -1, $pictofulllist = '')
{ {
global $langs; global $langs;
@@ -12656,7 +12656,7 @@ function startSimpleTable($header, $link = "", $arguments = "", $emptyRows = 0,
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print $emptyRows < 1 ? '<th>' : '<th colspan="'.($emptyRows + 1).'">'; print ($emptyColumns < 1) ? '<th>' : '<th colspan="'.($emptyColumns + 1).'">';
print $langs->trans($header); print $langs->trans($header);

View File

@@ -1346,7 +1346,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le
*/ */
function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = 'none', $type_user = 0) function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = 'none', $type_user = 0)
{ {
global $user, $conf, $langs; global $user, $langs;
if ($mainmenu == 'commercial') { if ($mainmenu == 'commercial') {
$langs->load("companies"); $langs->load("companies");

View File

@@ -33,7 +33,8 @@ $langs->loadLangs(array("eventorganization"));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$max = 5; $NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$now = dol_now(); $now = dol_now();
// Security check // Security check
@@ -147,9 +148,6 @@ END MODULEBUILDER DRAFT MYOBJECT */
print '</div><div class="fichetwothirdright">'; print '</div><div class="fichetwothirdright">';
$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject // Last modified myobject
if (isModEnabled('eventorganization') && $user->rights->eventorganization->read) if (isModEnabled('eventorganization') && $user->rights->eventorganization->read)

View File

@@ -41,13 +41,6 @@ $hookmanager->initHooks(array('expensereportindex'));
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('companies', 'users', 'trips')); $langs->loadLangs(array('companies', 'users', 'trips'));
// Security check
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'expensereport', '', '');
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
@@ -66,7 +59,14 @@ if (!$sortfield) {
} }
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
// Security check
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'expensereport', '', '');
/* /*

View File

@@ -50,6 +50,7 @@ if ($user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
/* /*
@@ -68,9 +69,7 @@ print load_fiche_titre($langs->trans("InterventionsArea"), '', 'intervention');
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
/* // Statistics
* Statistics
*/
$sql = "SELECT count(f.rowid), f.fk_statut"; $sql = "SELECT count(f.rowid), f.fk_statut";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -217,8 +216,6 @@ if (isModEnabled('intervention')) {
print '</div><div class="fichetwothirdright">'; print '</div><div class="fichetwothirdright">';
$max = 5;
/* /*
* Last modified interventions * Last modified interventions
*/ */

View File

@@ -37,6 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("suppliers", "orders")); $langs->loadLangs(array("suppliers", "orders"));
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('orderssuppliersindex'));
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
// Security check // Security check
$orderid = GETPOST('orderid'); $orderid = GETPOST('orderid');
@@ -45,12 +51,6 @@ if ($user->socid) {
} }
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande'); $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('orderssuppliersindex'));
/* /*
* View * View
@@ -285,7 +285,6 @@ print '</div><div class="fichetwothirdright">';
/* /*
* Last modified orders * Last modified orders
*/ */
$max = 5;
$sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";

View File

@@ -38,9 +38,8 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid; $socid = $user->socid;
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables // Maximum elements of the tables
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500); $maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
$maxLatestEditCount = 5; $maxLatestEditCount = 5;
$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500); $maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);

View File

@@ -72,7 +72,7 @@ if (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') || !getDolGlobalString('MAIN_IN
$setupcompanynotcomplete = 1; $setupcompanynotcomplete = 1;
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
/* /*

View File

@@ -64,8 +64,7 @@ $langs->loadLangs(array("mymodule@mymodule"));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$now = dol_now(); $now = dol_now();
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Security check - Protection if external user // Security check - Protection if external user
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');

View File

@@ -42,7 +42,7 @@ $langs->loadLangs(array("companies", "mrp"));
// Security check // Security check
$result = restrictedArea($user, 'bom|mrp'); $result = restrictedArea($user, 'bom|mrp');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
/* /*

View File

@@ -78,7 +78,7 @@ if (GETPOST('addbox')) {
} }
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
/* /*

View File

@@ -50,6 +50,11 @@ if ($search_project_user == $user->id) {
$mine = 1; $mine = 1;
} }
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
// Security check // Security check
$socid = 0; $socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment. //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
@@ -57,11 +62,6 @@ if (!$user->hasRight('projet', 'lire')) {
accessforbidden(); accessforbidden();
} }
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* /*
* Actions * Actions

View File

@@ -35,7 +35,8 @@ $langs->loadLangs(array("recruitment", "boxes"));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$max = 5; $NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$now = dol_now(); $now = dol_now();
$socid = GETPOSTINT('socid'); $socid = GETPOSTINT('socid');
@@ -329,9 +330,6 @@ END MODULEBUILDER DRAFT MYOBJECT */
print '</div><div class="fichetwothirdright">'; print '</div><div class="fichetwothirdright">';
$NBMAX = getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT');
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Last modified job position // Last modified job position
if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) { if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) {
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications"; $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications";

View File

@@ -74,7 +74,7 @@ if (GETPOST('addbox')) {
} }
} }
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT'); $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
/* /*