dolibarr  18.0.6
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
6  * Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
28 // Load Dolibarr environment
29 require '../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
31 if (isModEnabled('project')) {
32  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
33 }
34 
35 // Load translation files required by the page
36 $langs->loadLangs(array('companies', 'donations'));
37 
38 $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
39 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
40 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'sclist';
41 
42 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
43 $sortfield = GETPOST('sortfield', 'aZ09comma');
44 $sortorder = GETPOST('sortorder', 'aZ09comma');
45 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
46 $type = GETPOST('type', 'aZ');
47 $mode = GETPOST('mode', 'alpha');
48 if (empty($page) || $page == -1) {
49  $page = 0;
50 } // If $page is not defined, or '' or -1
51 $offset = $limit * $page;
52 $pageprev = $page - 1;
53 $pagenext = $page + 1;
54 if (!$sortorder) {
55  $sortorder = "DESC";
56 }
57 if (!$sortfield) {
58  $sortfield = "d.datedon";
59 }
60 
61 $search_status = (GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-4";
62 $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
63 $search_ref = GETPOST('search_ref', 'alpha');
64 $search_company = GETPOST('search_company', 'alpha');
65 $search_thirdparty = GETPOST('search_thirdparty', 'alpha');
66 $search_name = GETPOST('search_name', 'alpha');
67 $search_amount = GETPOST('search_amount', 'alpha');
68 $optioncss = GETPOST('optioncss', 'alpha');
69 $moreforfilter = GETPOST('moreforfilter', 'alpha');
70 
71 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
72  $search_all = "";
73  $search_ref = "";
74  $search_company = "";
75  $search_thirdparty = "";
76  $search_name = "";
77  $search_amount = "";
78  $search_status = '';
79 }
80 
81 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
82 $hookmanager->initHooks(array('donationlist'));
83 
84 
85 // List of fields to search into when doing a "search in all"
86 $fieldstosearchall = array(
87  'd.rowid'=>'Id',
88  'd.ref'=>'Ref',
89  'd.lastname'=>'Lastname',
90  'd.firstname'=>'Firstname',
91 );
92 
93 // Security check
94 $result = restrictedArea($user, 'don');
95 
96 $permissiontoread = $user->hasRight('don', 'read');
97 $permissiontoadd = $user->hasRight('don', 'write');
98 $permissiontodelete = $user->hasRight('don', 'delete');
99 
100 
101 /*
102  * Actions
103  */
104 
105 if (GETPOST('cancel', 'alpha')) {
106  $action = 'list';
107  $massaction = '';
108 }
109 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
110  $massaction = '';
111 }
112 
113 
114 
115 /*
116  * View
117  */
118 
119 $form = new Form($db);
120 $donationstatic = new Don($db);
121 if (isModEnabled('project')) {
122  $projectstatic = new Project($db);
123 }
124 
125 $title = $langs->trans("Donations");
126 $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
127 
128 
129 // Build and execute select
130 // --------------------------------------------------------------------
131 $sql = "SELECT d.rowid, d.datedon, d.fk_soc as socid, d.firstname, d.lastname, d.societe,";
132 $sql .= " d.amount, d.fk_statut as status,";
133 $sql .= " p.rowid as pid, p.ref, p.title, p.public";
134 
135 $sqlfields = $sql; // $sql fields to remove for count total
136 
137 $sql .= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
138 $sql .= " ON p.rowid = d.fk_projet";
139 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe AS s ON s.rowid = d.fk_soc";
140 $sql .= " WHERE d.entity IN (". getEntity('donation') . ")";
141 
142 if ($search_status != '' && $search_status != '-4') {
143  $sql .= " AND d.fk_statut IN (".$db->sanitize($search_status).")";
144 }
145 if (trim($search_ref) != '') {
146  $sql .= natural_search(['d.ref', "d.rowid"], $search_ref);
147 }
148 if (trim($search_all) != '') {
149  $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
150 }
151 if (trim($search_company) != '') {
152  $sql .= natural_search('d.societe', $search_company);
153 }
154 if (trim($search_thirdparty) != '') {
155  $sql .= natural_search("s.nom", $search_thirdparty);
156 }
157 if (trim($search_name) != '') {
158  $sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name);
159 }
160 if ($search_amount) {
161  $sql .= natural_search('d.amount', $search_amount, 1);
162 }
163 
164 // Count total nb of records
165 $nbtotalofrecords = '';
166 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
167  /* The fast and low memory method to get and count full list converts the sql into a sql count */
168  $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
169  $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
170  $resql = $db->query($sqlforcount);
171  if ($resql) {
172  $objforcount = $db->fetch_object($resql);
173  $nbtotalofrecords = $objforcount->nbtotalofrecords;
174  } else {
175  dol_print_error($db);
176  }
177 
178  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
179  $page = 0;
180  $offset = 0;
181  }
182  $db->free($resql);
183 }
184 
185 // Complete request and execute it with limit
186 $sql .= $db->order($sortfield, $sortorder);
187 if ($limit) {
188  $sql .= $db->plimit($limit + 1, $offset);
189 }
190 
191 $resql = $db->query($sql);
192 if (!$resql) {
193  dol_print_error($db);
194  exit;
195 }
196 
197 $num = $db->num_rows($resql);
198 
199 // Direct jump if only one record found
200 if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
201  $obj = $db->fetch_object($resql);
202  $id = $obj->rowid;
203  header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
204  exit;
205 }
206 
207 
208 // Output page
209 // --------------------------------------------------------------------
210 
211 llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
212 
213 // Example : Adding jquery code
214 // print '<script type="text/javascript">
215 // jQuery(document).ready(function() {
216 // function init_myfunc()
217 // {
218 // jQuery("#myid").removeAttr(\'disabled\');
219 // jQuery("#myid").attr(\'disabled\',\'disabled\');
220 // }
221 // init_myfunc();
222 // jQuery("#mybutton").click(function() {
223 // init_myfunc();
224 // });
225 // });
226 // </script>';
227 
228 $arrayofselected = is_array($toselect) ? $toselect : array();
229 
230 $param = '';
231 if (!empty($mode)) {
232  $param .= '&mode='.urlencode($mode);
233 }
234 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
235  $param .= '&contextpage='.urlencode($contextpage);
236 }
237 if ($limit > 0 && $limit != $conf->liste_limit) {
238  $param .= '&limit='.((int) $limit);
239 }
240 if ($optioncss != '') {
241  $param .= '&optioncss='.urlencode($optioncss);
242 }
243 if ($search_status && $search_status != -1) {
244  $param .= '&search_status='.urlencode($search_status);
245 }
246 if ($search_ref) {
247  $param .= '&search_ref='.urlencode($search_ref);
248 }
249 if ($search_company) {
250  $param .= '&search_company='.urlencode($search_company);
251 }
252 if ($search_name) {
253  $param .= '&search_name='.urlencode($search_name);
254 }
255 if ($search_amount) {
256  $param .= '&search_amount='.urlencode($search_amount);
257 }
258 
259 // List of mass actions available
260 $arrayofmassactions = array(
261  //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
262  //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
263  //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
264  //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
265 );
266 if (!empty($permissiontodelete)) {
267  $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
268 }
269 if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
270  $arrayofmassactions = array();
271 }
272 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
273 
274 
275 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
276 if ($optioncss != '') {
277  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
278 }
279 print '<input type="hidden" name="token" value="'.newToken().'">';
280 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
281 print '<input type="hidden" name="action" value="list">';
282 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
283 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
284 print '<input type="hidden" name="page" value="'.$page.'">';
285 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
286 print '<input type="hidden" name="page_y" value="">';
287 print '<input type="hidden" name="mode" value="'.$mode.'">';
288 print '<input type="hidden" name="type" value="'.$type.'">';
289 
290 $newcardbutton = '';
291 $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
292 $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
293 if ($user->rights->don->creer) {
294  $newcardbutton .= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
295 }
296 
297 print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_donation', 0, $newcardbutton, '', $limit, 0, 0, 1);
298 
299 if ($search_all) {
300  $setupstring = '';
301  foreach ($fieldstosearchall as $key => $val) {
302  $fieldstosearchall[$key] = $langs->trans($val);
303  $setupstring .= $key."=".$val.";";
304  }
305  print '<!-- Search done like if DONATION_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
306  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
307 }
308 
309 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
310 $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
311 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
312 
313 print '<div class="div-table-responsive">';
314 print '<table class="tagtable nobottomiftotal liste'.(!empty($moreforfilter) ? " listwithfilterbefore" : "").'">'."\n";
315 
316 // Fields title search
317 // --------------------------------------------------------------------
318 print '<tr class="liste_titre_filter">';
319 // Action column
320 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
321  print '<td class="liste_titre center maxwidthsearch">';
322  $searchpicto = $form->showFilterButtons('left');
323  print $searchpicto;
324  print '</td>';
325 }
326 print '<td class="liste_titre">';
327 print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'">';
328 print '</td>';
329 if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
330  print '<td class="liste_titre">';
331  print '<input class="flat" size="10" type="text" name="search_thirdparty" value="'.$search_thirdparty.'">';
332  print '</td>';
333 } else {
334  print '<td class="liste_titre">';
335  print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">';
336  print '</td>';
337 }
338 print '<td class="liste_titre">';
339 print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">';
340 print '</td>';
341 print '<td class="liste_titre left">';
342 print '&nbsp;';
343 print '</td>';
344 if (isModEnabled('project')) {
345  print '<td class="liste_titre right">';
346  print '&nbsp;';
347  print '</td>';
348 }
349 print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
350 print '<td class="liste_titre right parentonrightofpage">';
351 $liststatus = array(
352  Don::STATUS_DRAFT=>$langs->trans("DonationStatusPromiseNotValidated"),
353  Don::STATUS_VALIDATED=>$langs->trans("DonationStatusPromiseValidated"),
354  Don::STATUS_PAID=>$langs->trans("DonationStatusPaid"),
355  Don::STATUS_CANCELED=>$langs->trans("Canceled")
356 );
357 print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'search_status maxwidth100 onrightofpage');
358 print '</td>';
359 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
360  print '<td class="liste_titre center maxwidthsearch">';
361  $searchpicto = $form->showFilterButtons();
362  print $searchpicto;
363  print '</td>';
364 }
365 print '</tr>'."\n";
366 
367 $totalarray = array();
368 $totalarray['nbfield'] = 0;
369 
370 // Fields title label
371 // --------------------------------------------------------------------
372 print '<tr class="liste_titre">';
373 // Action column
374 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
376  $totalarray['nbfield']++;
377 }
378 print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", $param, "", $sortfield, $sortorder);
379 $totalarray['nbfield']++;
380 if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
381  print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "d.fk_soc", "", $param, "", $sortfield, $sortorder);
382  $totalarray['nbfield']++;
383 } else {
384  print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "d.societe", "", $param, "", $sortfield, $sortorder);
385  $totalarray['nbfield']++;
386 }
387 print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder);
388 $totalarray['nbfield']++;
389 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center ');
390 $totalarray['nbfield']++;
391 if (isModEnabled('project')) {
392  $langs->load("projects");
393  print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder);
394  $totalarray['nbfield']++;
395 }
396 print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "d.amount", "", $param, '', $sortfield, $sortorder, 'right ');
397 $totalarray['nbfield']++;
398 print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
399 $totalarray['nbfield']++;
400 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
402  $totalarray['nbfield']++;
403 }
404 print '</tr>'."\n";
405 
406 $i = 0;
407 $savnbfield = $totalarray['nbfield'];
408 $totalarray = array();
409 $totalarray['nbfield'] = 0;
410 $imaxinloop = ($limit ? min($num, $limit) : $num);
411 while ($i < $imaxinloop) {
412  $obj = $db->fetch_object($resql);
413 
414  $donationstatic->setVarsFromFetchObj($obj);
415 
416  $company = new Societe($db);
417  $result = $company->fetch($obj->socid);
418 
419  if ($mode == 'kanban') {
420  if ($i == 0) {
421  print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
422  print '<div class="box-flex-container kanban">';
423  }
424  // Output Kanban
425  $donationstatic->amount = $obj->amount;
426  $donationstatic->date = $obj->datedon;
427  $donationstatic->labelStatus = $obj->status;
428  $donationstatic->id = $obj->rowid;
429  $donationstatic->ref = $obj->rowid;
430 
431  if (!empty($obj->socid) && $company->id > 0) {
432  $donationstatic->societe = $company->getNomUrl(1);
433  } else {
434  $donationstatic->societe = $obj->societe;
435  }
436 
437  $object = $donationstatic;
438 
439  $selected = -1;
440  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
441  $selected = 0;
442  if (in_array($object->id, $arrayofselected)) {
443  $selected = 1;
444  }
445  }
446  print $donationstatic->getKanbanView('', array('selected' => $selected));
447  if ($i == ($imaxinloop - 1)) {
448  print '</div>';
449  print '</td></tr>';
450  }
451  } else {
452  print '<tr class="oddeven">';
453  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
454  print '<td></td>';
455  }
456  $donationstatic->id = $obj->rowid;
457  $donationstatic->ref = $obj->rowid;
458  $donationstatic->lastname = $obj->lastname;
459  $donationstatic->firstname = $obj->firstname;
460  print "<td>".$donationstatic->getNomUrl(1)."</td>";
461  if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
462  if (!empty($obj->socid) && $company->id > 0) {
463  print "<td>".$company->getNomUrl(1)."</td>";
464  } else {
465  print "<td>".$obj->societe."</td>";
466  }
467  } else {
468  print "<td>".$obj->societe."</td>";
469  }
470  print "<td>".$donationstatic->getFullName($langs)."</td>";
471  print '<td class="center">'.dol_print_date($db->jdate($obj->datedon), 'day').'</td>';
472  if (isModEnabled('project')) {
473  print "<td>";
474  if ($obj->pid) {
475  $projectstatic->id = $obj->pid;
476  $projectstatic->ref = $obj->ref;
477  $projectstatic->id = $obj->pid;
478  $projectstatic->public = $obj->public;
479  $projectstatic->title = $obj->title;
480  print $projectstatic->getNomUrl(1);
481  } else {
482  print '&nbsp;';
483  }
484  print "</td>\n";
485  }
486  print '<td class="right"><span class="amount">'.price($obj->amount).'</span></td>';
487  print '<td class="right">'.$donationstatic->LibStatut($obj->status, 5).'</td>';
488  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
489  print '<td></td>';
490  }
491  print "</tr>";
492  }
493  $i++;
494 }
495 print "</table>";
496 print '</div>';
497 print "</form>\n";
498 $db->free($resql);
499 
500 
501 llxFooter();
502 $db->close();
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 donations.
Definition: don.class.php:40
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
if(isModEnabled('facture') && $user->hasRight('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') && $user->hasRight('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)) $sql
Social contributions to pay.
Definition: index.php:746
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...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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 dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.