dolibarr 20.0.0
lines.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
3 * Copyright (C) 2013-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
4 * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
5 * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
6 * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
7 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
28require '../../main.inc.php';
29
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
32require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
33require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
34require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
37
38// Load translation files required by the page
39$langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "productbatch", "hrm"));
40
41$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
42
43$account_parent = GETPOST('account_parent');
44$changeaccount = GETPOST('changeaccount');
45// Search Getpost
46$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
47$search_login = GETPOST('search_login', 'alpha');
48$search_expensereport = GETPOST('search_expensereport', 'alpha');
49$search_label = GETPOST('search_label', 'alpha');
50$search_desc = GETPOST('search_desc', 'alpha');
51$search_amount = GETPOST('search_amount', 'alpha');
52$search_account = GETPOST('search_account', 'alpha');
53$search_vat = GETPOST('search_vat', 'alpha');
54$search_date_startday = GETPOSTINT('search_date_startday');
55$search_date_startmonth = GETPOSTINT('search_date_startmonth');
56$search_date_startyear = GETPOSTINT('search_date_startyear');
57$search_date_endday = GETPOSTINT('search_date_endday');
58$search_date_endmonth = GETPOSTINT('search_date_endmonth');
59$search_date_endyear = GETPOSTINT('search_date_endyear');
60$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
61$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
62
63// Load variable for pagination
64$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
65$sortfield = GETPOST('sortfield', 'aZ09comma');
66$sortorder = GETPOST('sortorder', 'aZ09comma');
67$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
68if (empty($page) || $page < 0) {
69 $page = 0;
70}
71$offset = $limit * $page;
72$pageprev = $page - 1;
73$pagenext = $page + 1;
74if (!$sortfield) {
75 $sortfield = "erd.date, erd.rowid";
76}
77if (!$sortorder) {
78 if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_DONE') > 0) {
79 $sortorder = "DESC";
80 } else {
81 $sortorder = "ASC";
82 }
83}
84
85// Security check
86if (!isModEnabled('accounting')) {
88}
89if ($user->socid > 0) {
91}
92if (!$user->hasRight('accounting', 'bind', 'write')) {
94}
95
96
97$formaccounting = new FormAccounting($db);
98
99
100/*
101 * Actions
102 */
103
104// Purge search criteria
105if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
106 $search_lineid = '';
107 $search_login = '';
108 $search_expensereport = '';
109 $search_label = '';
110 $search_desc = '';
111 $search_amount = '';
112 $search_account = '';
113 $search_vat = '';
114 $search_date_startday = '';
115 $search_date_startmonth = '';
116 $search_date_startyear = '';
117 $search_date_endday = '';
118 $search_date_endmonth = '';
119 $search_date_endyear = '';
120 $search_date_start = '';
121 $search_date_end = '';
122}
123
124if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) {
125 $error = 0;
126
127 if (!(GETPOSTINT('account_parent') >= 0)) {
128 $error++;
129 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
130 }
131
132 if (!$error) {
133 $db->begin();
134
135 $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
136 $sql1 .= " SET erd.fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0');
137 $sql1 .= ' WHERE erd.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
138
139 dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= '.$sql1);
140 $resql1 = $db->query($sql1);
141 if (!$resql1) {
142 $error++;
143 setEventMessages($db->lasterror(), null, 'errors');
144 }
145 if (!$error) {
146 $db->commit();
147 setEventMessages($langs->trans("Save"), null, 'mesgs');
148 } else {
149 $db->rollback();
150 setEventMessages($db->lasterror(), null, 'errors');
151 }
152
153 $account_parent = ''; // Protection to avoid to mass apply it a second time
154 }
155}
156
157if (GETPOST('sortfield') == 'erd.date, erd.rowid') {
158 $value = (GETPOST('sortorder') == 'asc,asc' ? 0 : 1);
159 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
160 $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $value, 'yesno', 0, '', $conf->entity);
161}
162
163
164/*
165 * View
166 */
167
168$form = new Form($db);
169$formother = new FormOther($db);
170
171$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
172
173llxHeader('', $langs->trans("ExpenseReportsVentilation").' - '.$langs->trans("Dispatched"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy accountancy-expensereport page-lines');
174
175print '<script type="text/javascript">
176 $(function () {
177 $(\'#select-all\').click(function(event) {
178 // Iterate each checkbox
179 $(\':checkbox\').each(function() {
180 this.checked = true;
181 });
182 });
183 $(\'#unselect-all\').click(function(event) {
184 // Iterate each checkbox
185 $(\':checkbox\').each(function() {
186 this.checked = false;
187 });
188 });
189 });
190 </script>';
191
192/*
193 * Expense reports lines
194 */
195$sql = "SELECT er.ref, er.rowid as erid,";
196$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
197$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
198$sql .= " u.rowid as userid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
199$sql .= " aa.label, aa.labelshort, aa.account_number";
200$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
201$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
202$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
203$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as f ON f.id = erd.fk_c_type_fees";
204$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = er.fk_user_author";
205$sql .= " WHERE erd.fk_code_ventilation > 0";
206$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
207$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
208// Add search filter like
209if (strlen($search_lineid)) {
210 $sql .= natural_search("fd.rowid", $search_lineid, 1);
211}
212if (strlen(trim($search_login))) {
213 $sql .= natural_search("u.login", $search_login);
214}
215if (strlen(trim($search_expensereport))) {
216 $sql .= natural_search("er.ref", $search_expensereport);
217}
218if (strlen(trim($search_label))) {
219 $sql .= natural_search("f.label", $search_label);
220}
221if (strlen(trim($search_desc))) {
222 $sql .= natural_search("erd.comments", $search_desc);
223}
224if (strlen(trim($search_amount))) {
225 $sql .= natural_search("erd.total_ht", $search_amount, 1);
226}
227if (strlen(trim($search_account))) {
228 $sql .= natural_search("aa.account_number", $search_account);
229}
230if (strlen(trim($search_vat))) {
231 $sql .= natural_search("erd.tva_tx", price2num($search_vat), 1);
232}
233if ($search_date_start) {
234 $sql .= " AND erd.date >= '".$db->idate($search_date_start)."'";
235}
236if ($search_date_end) {
237 $sql .= " AND erd.date <= '".$db->idate($search_date_end)."'";
238}
239$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
240
241$sql .= $db->order($sortfield, $sortorder);
242
243// Count total nb of records
244$nbtotalofrecords = '';
245if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
246 $result = $db->query($sql);
247 $nbtotalofrecords = $db->num_rows($result);
248 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
249 $page = 0;
250 $offset = 0;
251 }
252}
253
254$sql .= $db->plimit($limit + 1, $offset);
255
256dol_syslog("accountancy/expensereport/lines.php", LOG_DEBUG);
257$result = $db->query($sql);
258if ($result) {
259 $num_lines = $db->num_rows($result);
260 $i = 0;
261
262 $param = '';
263 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
264 $param .= '&contextpage='.urlencode($contextpage);
265 }
266 if ($limit > 0 && $limit != $conf->liste_limit) {
267 $param .= '&limit='.((int) $limit);
268 }
269 if ($search_login) {
270 $param .= '&search_login='.urlencode($search_login);
271 }
272 if ($search_expensereport) {
273 $param .= "&search_expensereport=".urlencode($search_expensereport);
274 }
275 if ($search_label) {
276 $param .= "&search_label=".urlencode($search_label);
277 }
278 if ($search_desc) {
279 $param .= "&search_desc=".urlencode($search_desc);
280 }
281 if ($search_account) {
282 $param .= "&search_account=".urlencode($search_account);
283 }
284 if ($search_vat) {
285 $param .= "&search_vat=".urlencode($search_vat);
286 }
287 if ($search_date_startday) {
288 $param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
289 }
290 if ($search_date_startmonth) {
291 $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
292 }
293 if ($search_date_startyear) {
294 $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
295 }
296 if ($search_date_endday) {
297 $param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
298 }
299 if ($search_date_endmonth) {
300 $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
301 }
302 if ($search_date_endyear) {
303 $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
304 }
305
306 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
307 print '<input type="hidden" name="action" value="ventil">';
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="sortfield" value="'.$sortfield.'">';
314 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
315 print '<input type="hidden" name="page" value="'.$page.'">';
316
317 // @phan-suppress-next-line PhanPluginSuspiciousParamOrder
318 print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
319 print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneExpenseReport").'</span><br>';
320
321 print '<br>'.$langs->trans("ChangeAccount").' <div class="inline-block paddingbottom">';
322 print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
323 print '<input type="submit" class="button small smallpaddingimp valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
324
325 $moreforfilter = '';
326
327 print '<div class="div-table-responsive">';
328 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
329
330 print '<tr class="liste_titre_filter">';
331 print '<td class="liste_titre"><input type="text" class="flat maxwidth40" name="search_lineid" value="'.dol_escape_htmltag($search_lineid).'"></td>';
332 print '<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
333 print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
334 if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) {
335 print '<td class="liste_titre"></td>';
336 }
337 print '<td class="liste_titre center">';
338 print '<div class="nowrapfordate">';
339 print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
340 print '</div>';
341 print '<div class="nowrapfordate">';
342 print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
343 print '</div>';
344 print '</td>';
345 print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
346 print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
347 print '<td class="liste_titre right"><input type="text" class="flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
348 print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" placeholder="%" value="'.dol_escape_htmltag($search_vat).'"></td>';
349 print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
350 print '<td class="liste_titre center">';
351 $searchpicto = $form->showFilterButtons();
352 print $searchpicto;
353 print '</td>';
354 print "</tr>\n";
355
356 print '<tr class="liste_titre">';
357 print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
358 print_liste_field_titre("Employees", $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder);
359 print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
360 if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) {
361 print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
362 }
363 print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
364 print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
365 print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
366 print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
367 print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'center ');
368 print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
369 $checkpicto = $form->showCheckAddButtons();
370 print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
371 print "</tr>\n";
372
373 $expensereportstatic = new ExpenseReport($db);
374 $accountingaccountstatic = new AccountingAccount($db);
375 $userstatic = new User($db);
376
377 $i = 0;
378 while ($i < min($num_lines, $limit)) {
379 $objp = $db->fetch_object($result);
380
381 $expensereportstatic->ref = $objp->ref;
382 $expensereportstatic->id = $objp->erid;
383
384 $userstatic->id = $objp->userid;
385 $userstatic->ref = $objp->label;
386 $userstatic->login = $objp->login;
387 $userstatic->status = $objp->statut;
388 $userstatic->email = $objp->email;
389 $userstatic->gender = $objp->gender;
390 $userstatic->firstname = $objp->firstname;
391 $userstatic->lastname = $objp->lastname;
392 $userstatic->employee = $objp->employee;
393 $userstatic->photo = $objp->photo;
394
395 $accountingaccountstatic->rowid = $objp->fk_compte;
396 $accountingaccountstatic->label = $objp->label;
397 $accountingaccountstatic->labelshort = $objp->labelshort;
398 $accountingaccountstatic->account_number = $objp->account_number;
399
400 print '<tr class="oddeven">';
401
402 // Line id
403 print '<td>'.$objp->rowid.'</td>';
404
405 // Login
406 print '<td class="nowraponall">';
407 print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
408 print '</td>';
409
410 // Ref Expense report
411 print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
412
413 // Date validation
414 if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) {
415 print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
416 }
417
418 print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
419
420 // Fees label
421 print '<td class="tdoverflow">'.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'</td>';
422
423 // Fees description -- Can be null
424 print '<td>';
425 $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
426 $trunclength = getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION', 32);
427 print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
428 print '</td>';
429
430 // Amount without taxes
431 print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
432
433 // Vat rate
434 print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
435
436 // Accounting account affected
437 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($accountingaccountstatic->label).'">';
438 print '<a class="editfielda reposition marginleftonly marginrightonly" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
439 print img_edit();
440 print '</a> ';
441 print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
442 print '</td>';
443
444 print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
445
446 print "</tr>";
447 $i++;
448 }
449 if ($num_lines == 0) {
450 $colspan = 10;
451 if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) {
452 $colspan++;
453 }
454 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
455 }
456
457 print "</table>";
458 print "</div>";
459
460 if ($nbtotalofrecords > $limit) {
461 print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
462 }
463
464 print '</form>';
465} else {
466 print $db->lasterror();
467}
468
469// End of page
470llxFooter();
471$db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage accounting accounts.
Class to manage Trips and Expenses.
const STATUS_CLOSED
Classified paid.
Class to manage generation of HTML components for accounting management.
Class to manage generation of HTML components Only common components must be here.
Class permettant la generation de composants html autre Only common components are here.
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.