dolibarr  16.0.5
setup.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
4  * Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
5  * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 require '../../main.inc.php'; // Load $user and permissions
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
32 require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php";
33 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
34 
35 // If socid provided by ajax company selector
36 if (!empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) {
37  $_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
38  $_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
39  $_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
40 }
41 
42 // Security check
43 if (!$user->admin) {
45 }
46 
47 $langs->loadLangs(array("admin", "cashdesk"));
48 
49 global $db, $mysoc;
50 
51 $sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
52 $sql .= " WHERE entity IN (".getEntity('c_paiement').")";
53 $sql .= " AND active = 1";
54 $sql .= " ORDER BY libelle";
55 $resql = $db->query($sql);
56 $paiements = array();
57 if ($resql) {
58  while ($obj = $db->fetch_object($resql)) {
59  array_push($paiements, $obj);
60  }
61 }
62 
63 $action = GETPOST('action', 'aZ09');
64 
65 
66 /*
67  * Actions
68  */
69 
70 $error = 0;
71 
72 if ($action == 'set') {
73  $db->begin();
74 
75  $res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
76  $res = dolibarr_set_const($db, "TAKEPOS_SUPPLEMENTS_CATEGORY", GETPOST('TAKEPOS_SUPPLEMENTS_CATEGORY', 'alpha'), 'chaine', 0, '', $conf->entity);
77  $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity);
78  $res = dolibarr_set_const($db, "TAKEPOS_SORTPRODUCTFIELD", GETPOST('TAKEPOS_SORTPRODUCTFIELD', 'alpha'), 'chaine', 0, '', $conf->entity);
79  $res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
80  $res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity);
81  $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
82  if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
83  $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity);
84  $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity);
85  }
86  if (isModEnabled('barcode')) {
87  $res = dolibarr_set_const($db, 'TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT', GETPOST('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT', 'alpha'), 'chaine', 0, '', $conf->entity);
88  }
89 
90  dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
91 
92  if (!($res > 0)) {
93  $error++;
94  }
95 
96  if (!$error) {
97  $db->commit();
98  } else {
99  $db->rollback();
100  }
101 } elseif ($action == 'updateMask') {
102  $maskconst = GETPOST('maskconst', 'alpha');
103  $maskvalue = GETPOST('maskvalue', 'alpha');
104  if ($maskconst) {
105  $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
106  }
107  if (!($res > 0)) {
108  $error++;
109  }
110 } elseif ($action == 'setrefmod') {
111  $value = GETPOST('value', 'alpha');
112  dolibarr_set_const($db, "TAKEPOS_REF_ADDON", $value, 'chaine', 0, '', $conf->entity);
113 }
114 
115 if ($action != '') {
116  if (!$error) {
117  setEventMessage($langs->trans('SetupSaved'));
118  } else {
119  setEventMessages($langs->trans('Error'), null, 'errors');
120  }
121 }
122 
123 
124 /*
125  * View
126  */
127 
128 $form = new Form($db);
129 $formproduct = new FormProduct($db);
130 
131 $help_url = 'EN:Module_Point_of_sale_(TakePOS)';
132 
133 llxHeader('', $langs->trans("CashDeskSetup"), $help_url);
134 
135 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
136 print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
138 print dol_get_fiche_head($head, 'setup', 'TakePOS', -1, 'cash-register');
139 
140 // Numbering modules
141 $now = dol_now();
142 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
143 
144 print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', '');
145 
146 print '<table class="noborder centpercent">';
147 print '<tr class="liste_titre">';
148 print '<td>'.$langs->trans("Name")."</td>\n";
149 print '<td>'.$langs->trans("Description")."</td>\n";
150 print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
151 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
152 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
153 print '</tr>'."\n";
154 
155 clearstatcache();
156 
157 foreach ($dirmodels as $reldir) {
158  $dir = dol_buildpath($reldir."core/modules/takepos/");
159 
160  if (is_dir($dir)) {
161  $handle = opendir($dir);
162  if (is_resource($handle)) {
163  $var = true;
164 
165  while (($file = readdir($handle)) !== false) {
166  if (substr($file, 0, 16) == 'mod_takepos_ref_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
167  $file = substr($file, 0, dol_strlen($file) - 4);
168 
169  require_once $dir.$file.'.php';
170 
171  $module = new $file;
172 
173  // Show modules according to features level
174  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
175  continue;
176  }
177  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
178  continue;
179  }
180 
181  if ($module->isEnabled()) {
182  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
183  print $module->info();
184  print '</td>';
185 
186  // Show example of numbering module
187  print '<td class="nowrap">';
188  $tmp = $module->getExample();
189  if (preg_match('/^Error/', $tmp)) {
190  $langs->load("errors");
191  print '<div class="error">'.$langs->trans($tmp).'</div>';
192  } elseif ($tmp == 'NotConfigured') {
193  print $langs->trans($tmp);
194  } else {
195  print $tmp;
196  }
197  print '</td>'."\n";
198 
199  print '<td class="center">';
200  if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") {
201  print img_picto($langs->trans("Activated"), 'switch_on');
202  } else {
203  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setrefmod&token='.newToken().'&value='.urlencode($file).'">';
204  print img_picto($langs->trans("Disabled"), 'switch_off');
205  print '</a>';
206  }
207  print '</td>';
208 
209  // example for next value
210  $invoice = new Facture($db);
211  $invoice->date = $now;
212  $invoice->module_source = 'takepos';
213  $invoice->pos_source = 1;
214 
215  // Info
216  $htmltooltip = '';
217  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
218  $nextval = $module->getNextValue($mysoc, $invoice);
219  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
220  $htmltooltip .= ''.$langs->trans("NextValue").': ';
221  if ($nextval) {
222  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
223  $nextval = $langs->trans($nextval);
224  }
225  $htmltooltip .= $nextval.'<br>';
226  } else {
227  $htmltooltip .= $langs->trans($module->error).'<br>';
228  }
229  }
230 
231  print '<td align="center">';
232  print $form->textwithpicto('', $htmltooltip, 1, 0);
233  print '</td>';
234 
235  print "</tr>\n";
236  }
237  }
238  }
239  closedir($handle);
240  }
241  }
242 }
243 print "</table><br>\n";
244 
245 print '<br>';
246 
247 // Mode
248 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
249 print '<input type="hidden" name="token" value="'.newToken().'">';
250 print '<input type="hidden" name="action" value="set">';
251 
252 print '<div class="div-table-responsive-no-min">';
253 print '<table class="noborder centpercent">';
254 
255 print '<tr class="liste_titre">';
256 print '<td class="notitlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
257 print "</tr>\n";
258 
259 // Terminals
260 print '<tr class="oddeven"><td>';
261 print $langs->trans("NumberOfTerminals");
262 print '<td colspan="2">';
263 print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="' . (empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '1' : $conf->global->TAKEPOS_NUM_TERMINALS) . '">';
264 print "</td></tr>\n";
265 
266 // Services
267 if (isModEnabled('service')) {
268  print '<tr class="oddeven"><td>';
269  print $langs->trans("CashdeskShowServices");
270  print '<td colspan="2">';
271  print ajax_constantonoff("CASHDESK_SERVICES", array(), $conf->entity, 0, 0, 1, 0);
272  //print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
273  print "</td></tr>\n";
274 }
275 
276 // Root category for products
277 print '<tr class="oddeven"><td>';
278 print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
279 print '<td colspan="2">';
280 print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
281 print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
282 print "</td></tr>\n";
283 
284 // Sort product
285 print '<tr class="oddeven"><td>';
286 print $langs->trans("SortProductField");
287 print '<td colspan="2">';
288 $prod = new Product($db);
289 $array = array('rowid' => 'ID', 'ref' => 'Ref', 'label' => 'Label', 'datec' => 'DateCreation', 'tms' => 'DateModification');
290 print $form->selectarray('TAKEPOS_SORTPRODUCTFIELD', $array, (empty($conf->global->TAKEPOS_SORTPRODUCTFIELD) ? 'rowid' : $conf->global->TAKEPOS_SORTPRODUCTFIELD), 0, 0, 0, '', 1);
291 print "</td></tr>\n";
292 
293 print '<tr class="oddeven"><td>';
294 print $langs->trans('TakeposGroupSameProduct');
295 print '<td colspan="2">';
296 print ajax_constantonoff("TAKEPOS_GROUP_SAME_PRODUCT", array(), $conf->entity, 0, 0, 1, 0);
297 print "</td></tr>\n";
298 
299 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
300 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
301 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
302 foreach ($substitutionarray as $key => $val) {
303  $htmltext .= $key.'<br>';
304 }
305 $htmltext .= '</i>';
306 
307 // Payment numpad
308 print '<tr class="oddeven"><td>';
309 print $langs->trans("Paymentnumpad");
310 print '<td colspan="2">';
311 $array = array(0=>$langs->trans("Numberspad"), 1=>$langs->trans("BillsCoinsPad"));
312 print $form->selectarray('TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD) ? '0' : $conf->global->TAKEPOS_NUMPAD), 0);
313 print "</td></tr>\n";
314 
315 // Numpad use payment icons
316 /*print '<tr class="oddeven"><td>';
317 print $langs->trans('TakeposNumpadUsePaymentIcon');
318 print '<td colspan="2">';
319 print ajax_constantonoff("TAKEPOS_NUMPAD_USE_PAYMENT_ICON", array(), $conf->entity, 0, 0, 1, 0);
320 print "</td></tr>\n";
321 */
322 
323 // Direct Payment
324 print '<tr class="oddeven"><td>';
325 print $langs->trans('DirectPaymentButton');
326 print '<td colspan="2">';
327 print ajax_constantonoff("TAKEPOS_DIRECT_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
328 //print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1);
329 print "</td></tr>\n";
330 
331 // Head Bar
332 /*print '<tr class="oddeven"><td>';
333 print $langs->trans('HeadBar');
334 print '<td colspan="2">';
335 print $form->selectyesno("TAKEPOS_HEAD_BAR", $conf->global->TAKEPOS_HEAD_BAR, 1);
336 print "</td></tr>\n";
337 */
338 
339 // Email template for send invoice
340 print '<tr class="oddeven"><td>';
341 print $langs->trans('EmailTemplate');
342 print '<td colspan="2">';
343 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
344 $formmail = new FormMail($db);
345 $nboftemplates = $formmail->fetchAllEMailTemplate('facture_send', $user, null, -1); // We set lang=null to get in priority record with no lang
346 //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
347 $arrayofmessagename = array();
348 if (is_array($formmail->lines_model)) {
349  foreach ($formmail->lines_model as $modelmail) {
350  //var_dump($modelmail);
351  $moreonlabel = '';
352  if (!empty($arrayofmessagename[$modelmail->label])) {
353  $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
354  }
355  $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->topic)).$moreonlabel;
356  }
357 }
358 //var_dump($arraydefaultmessage);
359 //var_dump($arrayofmessagename);
360 print $form->selectarray('TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE, 'None', 1, 0, '', 0, 0, 0, '', '', 1);
361 print "</td></tr>\n";
362 
363 // Control cash box at opening pos
364 print '<tr class="oddeven"><td>';
365 print $langs->trans('ControlCashOpening');
366 print '<td colspan="2">';
367 print ajax_constantonoff("TAKEPOS_CONTROL_CASH_OPENING", array(), $conf->entity, 0, 0, 1, 0);
368 print "</td></tr>\n";
369 
370 // Gift receipt
371 print '<tr class="oddeven"><td>';
372 print $langs->trans('GiftReceiptButton');
373 print '<td colspan="2">';
374 print ajax_constantonoff("TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
375 print "</td></tr>\n";
376 
377 // Delayed Pay Button
378 print '<tr class="oddeven"><td>';
379 print $langs->trans('AllowDelayedPayment');
380 print '<td colspan="2">';
381 print ajax_constantonoff("TAKEPOS_DELAYED_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
382 print "</td></tr>\n";
383 
384 // Show price without vat
385 print '<tr class="oddeven"><td>';
386 print $langs->trans('ShowPriceHT');
387 print '<td colspan="2">';
388 print ajax_constantonoff("TAKEPOS_SHOW_HT", array(), $conf->entity, 0, 0, 1, 0);
389 print "</td></tr>\n";
390 
391 // Barcode rule to insert product
392 if (isModEnabled('barcode')) {
393  print '<tr class="oddeven"><td>';
394  print $form->textwithpicto($langs->trans("TakeposBarcodeRuleToInsertProduct"), $langs->trans("TakeposBarcodeRuleToInsertProductDesc"));
395  print '<td colspan="2">';
396  print '<input type="text" name="TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT" value="' . (getDolGlobalString('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT')) . '">';
397  print "</td></tr>\n";
398 }
399 
400 // Numbering module
401 //print '<tr class="oddeven"><td>';
402 //print $langs->trans("BillsNumberingModule");
403 //print '<td colspan="2">';
404 //$array = array(0=>$langs->trans("Default"), "terminal"=>$langs->trans("ByTerminal"));
405 //$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
406 //foreach ($dirmodels as $reldir)
407 //{
408 // $dir = dol_buildpath($reldir."core/modules/facture/");
409 // if (is_dir($dir))
410 // {
411 // $handle = opendir($dir);
412 // if (is_resource($handle))
413 // {
414 // while (($file = readdir($handle)) !== false)
415 // {
416 // if (!is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS'))
417 // {
418 // $filebis = $file;
419 // $classname = preg_replace('/\.php$/', '', $file);
420 // // For compatibility
421 // if (!is_file($dir.$filebis))
422 // {
423 // $filebis = $file."/".$file.".modules.php";
424 // $classname = "mod_facture_".$file;
425 // }
426 // // Check if there is a filter on country
427 // preg_match('/\-(.*)_(.*)$/', $classname, $reg);
428 // if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue;
429 //
430 // $classname = preg_replace('/\-.*$/', '', $classname);
431 // if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/', $filebis) || preg_match('/mod_/', $classname)) && substr($filebis, dol_strlen($filebis) - 3, 3) == 'php')
432 // {
433 // // Charging the numbering class
434 // require_once $dir.$filebis;
435 //
436 // $module = new $classname($db);
437 //
438 // // Show modules according to features level
439 // if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
440 // if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
441 //
442 // if ($module->isEnabled())
443 // {
444 // $array[preg_replace('/\-.*$/', '', preg_replace('/\.php$/', '', $file))] = preg_replace('/\-.*$/', '', preg_replace('/mod_facture_/', '', preg_replace('/\.php$/', '', $file)));
445 // }
446 // }
447 // }
448 // }
449 // closedir($handle);
450 // }
451 // }
452 //}
453 //
454 //print $form->selectarray('TAKEPOS_ADDON', $array, (empty($conf->global->TAKEPOS_ADDON) ? '0' : $conf->global->TAKEPOS_ADDON), 0);
455 //print "</td></tr>\n";
456 
457 print '</table>';
458 print '</div>';
459 
460 
461 // Sumup options
462 if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
463  print '<br>';
464 
465  print '<div class="div-table-responsive-no-min">';
466  print '<table class="noborder centpercent">';
467 
468  print '<tr class="liste_titre">';
469  print '<td class="titlefield">'.$langs->trans("Sumup").'</td><td>'.$langs->trans("Value").'</td>';
470  print "</tr>\n";
471 
472  print '<tr class="oddeven"><td>';
473  print $langs->trans("SumupAffiliate");
474  print '<td colspan="2">';
475  print '<input type="text" name="TAKEPOS_SUMUP_AFFILIATE" value="'.$conf->global->TAKEPOS_SUMUP_AFFILIATE.'"></input>';
476  print "</td></tr>\n";
477  print '<tr class="oddeven"><td>';
478  print $langs->trans("SumupAppId");
479  print '<td colspan="2">';
480  print '<input type="text" name="TAKEPOS_SUMUP_APPID" value="'.$conf->global->TAKEPOS_SUMUP_APPID.'"></input>';
481  print "</td></tr>\n";
482 
483  print '</table>';
484  print '</div>';
485 }
486 
487 print '<br>';
488 
489 print $form->buttonsSaveCancel("Save", '');
490 
491 print "</form>\n";
492 
493 llxFooter();
494 $db->close();
ajax_combobox
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1')
Convert a html select field into an ajax combobox.
Definition: ajax.lib.php:438
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
Facture
Class to manage invoices.
Definition: facture.class.php:60
$help_url
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:116
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
takepos_admin_prepare_head
takepos_admin_prepare_head()
Prepare array with list of tabs.
Definition: takepos.lib.php:30
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
setEventMessage
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
Definition: functions.lib.php:8108
ajax_constantonoff
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='')
On/off button for constant.
Definition: ajax.lib.php:573
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3747
FormProduct
Class with static methods for building HTML components related to products Only components common to ...
Definition: html.formproduct.class.php:30
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
dolibarr_set_const
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).
Definition: admin.lib.php:627
Product
Class to manage products or services.
Definition: product.class.php:46
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4211
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
pdf_getSubstitutionArray
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition: pdf.lib.php:737
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
FormMail
Classe permettant la generation du formulaire html d'envoi de mail unitaire Usage: $formail = new For...
Definition: html.formmail.class.php:38
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
Definition: functions.lib.php:93
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59