dolibarr  19.0.0-dev
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 WHERE d.entity IN (".getEntity('donation').")";
139 if ($search_status != '' && $search_status != '-4') {
140  $sql .= " AND d.fk_statut IN (".$db->sanitize($search_status).")";
141 }
142 if (trim($search_ref) != '') {
143  $sql .= natural_search('d.ref', $search_ref);
144 }
145 if (trim($search_all) != '') {
146  $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
147 }
148 if (trim($search_company) != '') {
149  $sql .= natural_search('d.societe', $search_company);
150 }
151 if (trim($search_name) != '') {
152  $sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name);
153 }
154 if ($search_amount) {
155  $sql .= natural_search('d.amount', $search_amount, 1);
156 }
157 
158 // Count total nb of records
159 $nbtotalofrecords = '';
160 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
161  /* The fast and low memory method to get and count full list converts the sql into a sql count */
162  $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
163  $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
164  $resql = $db->query($sqlforcount);
165  if ($resql) {
166  $objforcount = $db->fetch_object($resql);
167  $nbtotalofrecords = $objforcount->nbtotalofrecords;
168  } else {
169  dol_print_error($db);
170  }
171 
172  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
173  $page = 0;
174  $offset = 0;
175  }
176  $db->free($resql);
177 }
178 
179 // Complete request and execute it with limit
180 $sql .= $db->order($sortfield, $sortorder);
181 if ($limit) {
182  $sql .= $db->plimit($limit + 1, $offset);
183 }
184 
185 $resql = $db->query($sql);
186 if (!$resql) {
187  dol_print_error($db);
188  exit;
189 }
190 
191 $num = $db->num_rows($resql);
192 
193 // Direct jump if only one record found
194 if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
195  $obj = $db->fetch_object($resql);
196  $id = $obj->rowid;
197  header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
198  exit;
199 }
200 
201 
202 // Output page
203 // --------------------------------------------------------------------
204 
205 llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
206 
207 // Example : Adding jquery code
208 // print '<script type="text/javascript">
209 // jQuery(document).ready(function() {
210 // function init_myfunc()
211 // {
212 // jQuery("#myid").removeAttr(\'disabled\');
213 // jQuery("#myid").attr(\'disabled\',\'disabled\');
214 // }
215 // init_myfunc();
216 // jQuery("#mybutton").click(function() {
217 // init_myfunc();
218 // });
219 // });
220 // </script>';
221 
222 $arrayofselected = is_array($toselect) ? $toselect : array();
223 
224 $param = '';
225 if (!empty($mode)) {
226  $param .= '&mode='.urlencode($mode);
227 }
228 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
229  $param .= '&contextpage='.urlencode($contextpage);
230 }
231 if ($limit > 0 && $limit != $conf->liste_limit) {
232  $param .= '&limit='.((int) $limit);
233 }
234 if ($optioncss != '') {
235  $param .= '&optioncss='.urlencode($optioncss);
236 }
237 if ($search_status && $search_status != -1) {
238  $param .= '&search_status='.urlencode($search_status);
239 }
240 if ($search_ref) {
241  $param .= '&search_ref='.urlencode($search_ref);
242 }
243 if ($search_company) {
244  $param .= '&search_company='.urlencode($search_company);
245 }
246 if ($search_name) {
247  $param .= '&search_name='.urlencode($search_name);
248 }
249 if ($search_amount) {
250  $param .= '&search_amount='.urlencode($search_amount);
251 }
252 
253 // List of mass actions available
254 $arrayofmassactions = array(
255  //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
256  //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
257  //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
258  //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
259 );
260 if (!empty($permissiontodelete)) {
261  $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
262 }
263 if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
264  $arrayofmassactions = array();
265 }
266 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
267 
268 
269 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
270 if ($optioncss != '') {
271  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
272 }
273 print '<input type="hidden" name="token" value="'.newToken().'">';
274 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
275 print '<input type="hidden" name="action" value="list">';
276 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
277 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
278 print '<input type="hidden" name="page" value="'.$page.'">';
279 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
280 print '<input type="hidden" name="page_y" value="">';
281 print '<input type="hidden" name="mode" value="'.$mode.'">';
282 print '<input type="hidden" name="type" value="'.$type.'">';
283 
284 $newcardbutton = '';
285 $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'));
286 $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'));
287 if ($user->rights->don->creer) {
288  $newcardbutton .= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
289 }
290 
291 print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_donation', 0, $newcardbutton, '', $limit, 0, 0, 1);
292 
293 if ($search_all) {
294  $setupstring = '';
295  foreach ($fieldstosearchall as $key => $val) {
296  $fieldstosearchall[$key] = $langs->trans($val);
297  $setupstring .= $key."=".$val.";";
298  }
299  print '<!-- Search done like if DONATION_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
300  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
301 }
302 
303 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
304 $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
305 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
306 
307 print '<div class="div-table-responsive">';
308 print '<table class="tagtable nobottomiftotal liste'.(!empty($moreforfilter) ? " listwithfilterbefore" : "").'">'."\n";
309 
310 // Fields title search
311 // --------------------------------------------------------------------
312 print '<tr class="liste_titre_filter">';
313 // Action column
314 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
315  print '<td class="liste_titre center maxwidthsearch">';
316  $searchpicto = $form->showFilterButtons('left');
317  print $searchpicto;
318  print '</td>';
319 }
320 print '<td class="liste_titre">';
321 print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'">';
322 print '</td>';
323 if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
324  print '<td class="liste_titre">';
325  print '<input class="flat" size="10" type="text" name="search_thirdparty" value="'.$search_thirdparty.'">';
326  print '</td>';
327 } else {
328  print '<td class="liste_titre">';
329  print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">';
330  print '</td>';
331 }
332 print '<td class="liste_titre">';
333 print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">';
334 print '</td>';
335 print '<td class="liste_titre left">';
336 print '&nbsp;';
337 print '</td>';
338 if (isModEnabled('project')) {
339  print '<td class="liste_titre right">';
340  print '&nbsp;';
341  print '</td>';
342 }
343 print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
344 print '<td class="liste_titre right parentonrightofpage">';
345 $liststatus = array(
346  Don::STATUS_DRAFT=>$langs->trans("DonationStatusPromiseNotValidated"),
347  Don::STATUS_VALIDATED=>$langs->trans("DonationStatusPromiseValidated"),
348  Don::STATUS_PAID=>$langs->trans("DonationStatusPaid"),
349  Don::STATUS_CANCELED=>$langs->trans("Canceled")
350 );
351 print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'search_status maxwidth100 onrightofpage');
352 print '</td>';
353 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
354  print '<td class="liste_titre center maxwidthsearch">';
355  $searchpicto = $form->showFilterButtons();
356  print $searchpicto;
357  print '</td>';
358 }
359 print '</tr>'."\n";
360 
361 $totalarray = array();
362 $totalarray['nbfield'] = 0;
363 
364 // Fields title label
365 // --------------------------------------------------------------------
366 print '<tr class="liste_titre">';
367 // Action column
368 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
370  $totalarray['nbfield']++;
371 }
372 print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", $param, "", $sortfield, $sortorder);
373 $totalarray['nbfield']++;
374 if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
375  print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "d.fk_soc", "", $param, "", $sortfield, $sortorder);
376  $totalarray['nbfield']++;
377 } else {
378  print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "d.societe", "", $param, "", $sortfield, $sortorder);
379  $totalarray['nbfield']++;
380 }
381 print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder);
382 $totalarray['nbfield']++;
383 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center ');
384 $totalarray['nbfield']++;
385 if (isModEnabled('project')) {
386  $langs->load("projects");
387  print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder);
388  $totalarray['nbfield']++;
389 }
390 print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "d.amount", "", $param, '', $sortfield, $sortorder, 'right ');
391 $totalarray['nbfield']++;
392 print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
393 $totalarray['nbfield']++;
394 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
396  $totalarray['nbfield']++;
397 }
398 print '</tr>'."\n";
399 
400 $i = 0;
401 $savnbfield = $totalarray['nbfield'];
402 $totalarray = array();
403 $totalarray['nbfield'] = 0;
404 $imaxinloop = ($limit ? min($num, $limit) : $num);
405 while ($i < $imaxinloop) {
406  $obj = $db->fetch_object($resql);
407 
408  $donationstatic->setVarsFromFetchObj($obj);
409 
410  $company = new Societe($db);
411  $result = $company->fetch($obj->socid);
412 
413  if ($mode == 'kanban') {
414  if ($i == 0) {
415  print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
416  print '<div class="box-flex-container kanban">';
417  }
418  // Output Kanban
419  $donationstatic->amount = $obj->amount;
420  $donationstatic->date = $obj->datedon;
421  $donationstatic->labelStatus = $obj->status;
422  $donationstatic->id = $obj->rowid;
423  $donationstatic->ref = $obj->rowid;
424 
425  if (!empty($obj->socid) && $company->id > 0) {
426  $donationstatic->societe = $company->getNomUrl(1);
427  } else {
428  $donationstatic->societe = $obj->societe;
429  }
430 
431  $object = $donationstatic;
432 
433  $selected = -1;
434  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
435  $selected = 0;
436  if (in_array($object->id, $arrayofselected)) {
437  $selected = 1;
438  }
439  }
440  print $donationstatic->getKanbanView('', array('selected' => $selected));
441  if ($i == ($imaxinloop - 1)) {
442  print '</div>';
443  print '</td></tr>';
444  }
445  } else {
446  print '<tr class="oddeven">';
447  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
448  print '<td></td>';
449  }
450  $donationstatic->id = $obj->rowid;
451  $donationstatic->ref = $obj->rowid;
452  $donationstatic->lastname = $obj->lastname;
453  $donationstatic->firstname = $obj->firstname;
454  print "<td>".$donationstatic->getNomUrl(1)."</td>";
455  if (!empty($conf->global->DONATION_USE_THIRDPARTIES)) {
456  if (!empty($obj->socid) && $company->id > 0) {
457  print "<td>".$company->getNomUrl(1)."</td>";
458  } else {
459  print "<td>".$obj->societe."</td>";
460  }
461  } else {
462  print "<td>".$obj->societe."</td>";
463  }
464  print "<td>".$donationstatic->getFullName($langs)."</td>";
465  print '<td class="center">'.dol_print_date($db->jdate($obj->datedon), 'day').'</td>';
466  if (isModEnabled('project')) {
467  print "<td>";
468  if ($obj->pid) {
469  $projectstatic->id = $obj->pid;
470  $projectstatic->ref = $obj->ref;
471  $projectstatic->id = $obj->pid;
472  $projectstatic->public = $obj->public;
473  $projectstatic->title = $obj->title;
474  print $projectstatic->getNomUrl(1);
475  } else {
476  print '&nbsp;';
477  }
478  print "</td>\n";
479  }
480  print '<td class="right"><span class="amount">'.price($obj->amount).'</span></td>';
481  print '<td class="right">'.$donationstatic->LibStatut($obj->status, 5).'</td>';
482  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
483  print '<td></td>';
484  }
485  print "</tr>";
486  }
487  $i++;
488 }
489 print "</table>";
490 print '</div>';
491 print "</form>\n";
492 $db->free($resql);
493 
494 
495 llxFooter();
496 $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.
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.