dolibarr  17.0.3
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
3  * Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 // Load Dolibarr environment
26 require '../main.inc.php';
27 include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
28 
29 // Load translation files required by the page
30 $langs->load("printing");
31 
32 if (!$user->admin) {
34 }
35 
36 
37 /*
38  * Actions
39  */
40 
41 // None
42 
43 
44 /*
45  * View
46  */
47 
48 llxHeader("", $langs->trans("Printing"));
49 
50 print_barre_liste($langs->trans("Printing"), 0, $_SERVER["PHP_SELF"], '', '', '', '<a class="button" href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Refresh").'</a>', 0, 0, 'title_setup.png');
51 
52 print $langs->trans("DirectPrintingJobsDesc").'<br><br>';
53 
54 // List Jobs from printing modules
55 $object = new PrintingDriver($db);
56 $result = $object->listDrivers($db, 10);
57 foreach ($result as $driver) {
58  require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
59  $classname = 'printing_'.$driver;
60  $langs->load($driver);
61  $printer = new $classname($db);
62  $keyforprinteractive = $printer->active;
63  if ($keyforprinteractive && getDolGlobalString($keyforprinteractive)) {
64  //$printer->listJobs('commande');
65  $result = $printer->listJobs();
66  print $printer->resprint;
67 
68  if ($result > 0) {
69  setEventMessages($printer->error, $printer->errors, 'errors');
70  }
71  }
72 }
73 
74 // End of page
75 llxFooter();
76 $db->close();
llxFooter
llxFooter()
Footer empty.
Definition: index.php:71
print_barre_liste
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.
Definition: functions.lib.php:5413
llxHeader
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:82
PrintingDriver
Parent class of emailing target selectors modules.
Definition: modules_printing.php:32
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8466
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
Definition: security.lib.php:1125