dolibarr  17.0.4
subaccount.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
4  * Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
26 // Load Dolibarr environment
27 require '../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
30 
31 // Load translation files required by the page
32 $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "hrm", "errors"));
33 
34 $mesg = '';
35 $action = GETPOST('action', 'aZ09');
36 $cancel = GETPOST('cancel', 'alpha');
37 $id = GETPOST('id', 'int');
38 $rowid = GETPOST('rowid', 'int');
39 $massaction = GETPOST('massaction', 'aZ09');
40 $optioncss = GETPOST('optioncss', 'alpha');
41 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'accountingsubaccountlist'; // To manage different context of search
42 
43 $search_subaccount = GETPOST('search_subaccount', 'alpha');
44 $search_label = GETPOST('search_label', 'alpha');
45 $search_type = GETPOST('search_type', 'int');
46 
47 // Security check
48 if ($user->socid > 0) {
50 }
51 if (!$user->hasRight('accounting', 'chartofaccount')) {
53 }
54 
55 // Load variable for pagination
56 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
57 $sortfield = GETPOST('sortfield', 'aZ09comma');
58 $sortorder = GETPOST('sortorder', 'aZ09comma');
59 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
60 if (empty($page) || $page == -1) {
61  $page = 0;
62 } // If $page is not defined, or '' or -1
63 $offset = $limit * $page;
64 $pageprev = $page - 1;
65 $pagenext = $page + 1;
66 if (!$sortfield) {
67  $sortfield = "label";
68 }
69 if (!$sortorder) {
70  $sortorder = "ASC";
71 }
72 
73 $arrayfields = array(
74  'subaccount'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
75  'label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
76  'type'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
77  'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1)
78 );
79 
80 if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
81  unset($arrayfields['reconcilable']);
82 }
83 
84 /*
85  * Actions
86  */
87 
88 if (GETPOST('cancel', 'alpha')) {
89  $action = 'list'; $massaction = '';
90 }
91 if (!GETPOST('confirmmassaction', 'alpha')) {
92  $massaction = '';
93 }
94 
95 $parameters = array();
96 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
97 if ($reshook < 0) {
98  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
99 }
100 
101 if (empty($reshook)) {
102  if (!empty($cancel)) {
103  $action = '';
104  }
105 
106  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
107 
108  if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
109  $search_subaccount = "";
110  $search_label = "";
111  $search_type = "";
112  $search_array_options = array();
113  }
114 }
115 
116 
117 /*
118  * View
119  */
120 
121 $form = new Form($db);
122 
123 $help_url = '';
124 $title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger');
125 
126 llxHeader('', $title, $help_url);
127 
128 // Customer
129 $sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity";
130 $sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
131 $sql .= " WHERE sa.entity IN (".getEntity('societe').")";
132 $sql .= " AND sa.code_compta <> ''";
133 //print $sql;
134 if (strlen(trim($search_subaccount))) {
135  $lengthpaddingaccount = 0;
136  if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
137  $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
138  }
139  $search_subaccount_tmp = $search_subaccount;
140  $weremovedsomezero = 0;
141  if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
142  for ($i = 0; $i < $lengthpaddingaccount; $i++) {
143  if (preg_match('/0$/', $search_subaccount_tmp)) {
144  $weremovedsomezero++;
145  $search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
146  }
147  }
148  }
149 
150  //var_dump($search_subaccount); exit;
151  if ($search_subaccount_tmp) {
152  if ($weremovedsomezero) {
153  $search_subaccount_tmp_clean = $search_subaccount_tmp;
154  $search_subaccount_clean = $search_subaccount;
155  $startchar = '%';
156  if (strpos($search_subaccount_tmp, '^') === 0) {
157  $startchar = '';
158  $search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
159  $search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
160  }
161  $sql .= " AND (sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
162  $sql .= " OR sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
163  } else {
164  $sql .= natural_search("sa.code_compta", $search_subaccount_tmp);
165  }
166  }
167 }
168 if (strlen(trim($search_label))) {
169  $sql .= natural_search("sa.nom", $search_label);
170 }
171 if (!empty($search_type) && $search_type >= 0) {
172  $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
173 }
174 
175 // Supplier
176 $sql .= " UNION ";
177 $sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity FROM ".MAIN_DB_PREFIX."societe sa";
178 $sql .= " WHERE sa.entity IN (".getEntity('societe').")";
179 $sql .= " AND sa.code_compta_fournisseur <> ''";
180 //print $sql;
181 if (strlen(trim($search_subaccount))) {
182  $lengthpaddingaccount = 0;
183  if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
184  $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
185  }
186  $search_subaccount_tmp = $search_subaccount;
187  $weremovedsomezero = 0;
188  if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
189  for ($i = 0; $i < $lengthpaddingaccount; $i++) {
190  if (preg_match('/0$/', $search_subaccount_tmp)) {
191  $weremovedsomezero++;
192  $search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
193  }
194  }
195  }
196 
197  //var_dump($search_subaccount); exit;
198  if ($search_subaccount_tmp) {
199  if ($weremovedsomezero) {
200  $search_subaccount_tmp_clean = $search_subaccount_tmp;
201  $search_subaccount_clean = $search_subaccount;
202  $startchar = '%';
203  if (strpos($search_subaccount_tmp, '^') === 0) {
204  $startchar = '';
205  $search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
206  $search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
207  }
208  $sql .= " AND (sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
209  $sql .= " OR sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
210  } else {
211  $sql .= natural_search("sa.code_compta_fournisseur", $search_subaccount_tmp);
212  }
213  }
214 }
215 if (strlen(trim($search_label))) {
216  $sql .= natural_search("sa.nom", $search_label);
217 }
218 if (!empty($search_type) && $search_type >= 0) {
219  $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
220 }
221 
222 // User
223 $sql .= " UNION ";
224 $sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity FROM ".MAIN_DB_PREFIX."user u";
225 $sql .= " WHERE u.entity IN (".getEntity('user').")";
226 $sql .= " AND u.accountancy_code <> ''";
227 //print $sql;
228 if (strlen(trim($search_subaccount))) {
229  $lengthpaddingaccount = 0;
230  if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
231  $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
232  }
233  $search_subaccount_tmp = $search_subaccount;
234  $weremovedsomezero = 0;
235  if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
236  for ($i = 0; $i < $lengthpaddingaccount; $i++) {
237  if (preg_match('/0$/', $search_subaccount_tmp)) {
238  $weremovedsomezero++;
239  $search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
240  }
241  }
242  }
243 
244  //var_dump($search_subaccount); exit;
245  if ($search_subaccount_tmp) {
246  if ($weremovedsomezero) {
247  $search_subaccount_tmp_clean = $search_subaccount_tmp;
248  $search_subaccount_clean = $search_subaccount;
249  $startchar = '%';
250  if (strpos($search_subaccount_tmp, '^') === 0) {
251  $startchar = '';
252  $search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
253  $search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
254  }
255  $sql .= " AND (u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
256  $sql .= " OR u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
257  } else {
258  $sql .= natural_search("u.accountancy_code", $search_subaccount_tmp);
259  }
260  }
261 }
262 if (strlen(trim($search_label))) {
263  $sql .= natural_search("u.lastname", $search_label);
264 }
265 if (!empty($search_type) && $search_type >= 0) {
266  $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
267 }
268 
269 $sql .= $db->order($sortfield, $sortorder);
270 
271 // Count total nb of records
272 $nbtotalofrecords = '';
273 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
274  $resql = $db->query($sql);
275  $nbtotalofrecords = $db->num_rows($resql);
276  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
277  $page = 0;
278  $offset = 0;
279  }
280 }
281 
282 $sql .= $db->plimit($limit + 1, $offset);
283 
284 dol_syslog('accountancy/admin/subaccount.php:: $sql='.$sql);
285 $resql = $db->query($sql);
286 
287 if ($resql) {
288  $num = $db->num_rows($resql);
289 
290  $param = '';
291  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
292  $param .= '&contextpage='.urlencode($contextpage);
293  }
294  if ($limit > 0 && $limit != $conf->liste_limit) {
295  $param .= '&limit='.urlencode($limit);
296  }
297  if ($search_subaccount) {
298  $param .= '&search_subaccount='.urlencode($search_subaccount);
299  }
300  if ($search_label) {
301  $param .= '&search_label='.urlencode($search_label);
302  }
303  if ($optioncss != '') {
304  $param .= '&optioncss='.urlencode($optioncss);
305  }
306 
307  print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
308  if ($optioncss != '') {
309  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
310  }
311  print '<input type="hidden" name="token" value="'.newToken().'">';
312  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
313  print '<input type="hidden" name="action" value="list">';
314  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
315  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
316  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
317 
318  print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
319 
320  print '<div class="info">'.$langs->trans("WarningCreateSubAccounts").'</div>';
321 
322  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
323  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
324 
325  $moreforfilter = '';
326  $massactionbutton = '';
327 
328  print '<div class="div-table-responsive">';
329  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
330 
331  // Line for search fields
332  print '<tr class="liste_titre_filter">';
333  if (!empty($arrayfields['subaccount']['checked'])) {
334  print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_subaccount" value="'.$search_subaccount.'"></td>';
335  }
336  if (!empty($arrayfields['label']['checked'])) {
337  print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
338  }
339  if (!empty($arrayfields['type']['checked'])) {
340  print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
341  }
342  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
343  if (!empty($arrayfields['reconcilable']['checked'])) {
344  print '<td class="liste_titre">&nbsp;</td>';
345  }
346  }
347  print '<td class="liste_titre maxwidthsearch">';
348  $searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
349  print $searchpicto;
350  print '</td>';
351  print '</tr>';
352 
353  print '<tr class="liste_titre">';
354  if (!empty($arrayfields['subaccount']['checked'])) {
355  print_liste_field_titre($arrayfields['subaccount']['label'], $_SERVER["PHP_SELF"], "subaccount", "", $param, '', $sortfield, $sortorder);
356  }
357  if (!empty($arrayfields['label']['checked'])) {
358  print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], "label", "", $param, '', $sortfield, $sortorder);
359  }
360  if (!empty($arrayfields['type']['checked'])) {
361  print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'center ');
362  }
363  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
364  if (!empty($arrayfields['reconcilable']['checked'])) {
365  print_liste_field_titre($arrayfields['reconcilable']['label'], $_SERVER["PHP_SELF"], 'reconcilable', '', $param, '', $sortfield, $sortorder, 'center ');
366  }
367  }
368  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
369  print "</tr>\n";
370 
371  $totalarray = array();
372  $totalarray['nbfield'] = 0;
373  $i = 0;
374  while ($i < min($num, $limit)) {
375  $obj = $db->fetch_object($resql);
376 
377  print '<tr class="oddeven">';
378 
379  // Account number
380  if (!empty($arrayfields['subaccount']['checked'])) {
381  print "<td>";
382  print length_accounta($obj->subaccount);
383  print "</td>\n";
384  if (!$i) {
385  $totalarray['nbfield']++;
386  }
387  }
388 
389  // Subaccount label
390  if (!empty($arrayfields['label']['checked'])) {
391  print "<td>";
392  print $obj->label;
393  print "</td>\n";
394  if (!$i) {
395  $totalarray['nbfield']++;
396  }
397  }
398 
399  // Type
400  if (!empty($arrayfields['type']['checked'])) {
401  print '<td class="center">';
402  $s = '';
403  // Customer
404  if ($obj->type == 1) {
405  $s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
406  } elseif ($obj->type == 2) {
407  // Supplier
408  $s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
409  } elseif ($obj->type == 3) {
410  // User
411  $s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">'.$langs->trans("Employee").'</a>';
412  }
413  print $s;
414  print '</td>';
415  if (!$i) {
416  $totalarray['nbfield']++;
417  }
418  }
419 
420  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
421  // Activated or not reconciliation on accounting account
422  if (!empty($arrayfields['reconcilable']['checked'])) {
423  print '<td class="center">';
424  if (empty($obj->reconcilable)) {
425  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
426  print img_picto($langs->trans("Disabled"), 'switch_off');
427  print '</a>';
428  } else {
429  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
430  print img_picto($langs->trans("Activated"), 'switch_on');
431  print '</a>';
432  }
433  print '</td>';
434  if (!$i) {
435  $totalarray['nbfield']++;
436  }
437  }
438  }
439 
440  // Action
441  print '<td class="center">';
442  $e = '';
443  // Customer
444  if ($obj->type == 1) {
445  $e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
446  } elseif ($obj->type == 2) {
447  // Supplier
448  $e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
449  } elseif ($obj->type == 3) {
450  // User
451  $e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
452  }
453  print $e;
454  print '</td>'."\n";
455  if (!$i) {
456  $totalarray['nbfield']++;
457  }
458 
459  print '</tr>'."\n";
460  $i++;
461  }
462 
463  $db->free($resql);
464 
465  $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
466  $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
467  print $hookmanager->resPrint;
468 
469  print "</table>";
470  print "</div>";
471 
472  print '</form>';
473 } else {
474  dol_print_error($db);
475 }
476 
477 // End of page
478 llxFooter();
479 $db->close();
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
Class to manage generation of HTML components Only common components must be here.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:745
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$nbtotalofrecords
Count total nb of records.
Definition: list.php:329
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.