dolibarr  16.0.5
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 require '../main.inc.php';
26 include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
27 
28 // Load translation files required by the page
29 $langs->load("printing");
30 
31 if (!$user->admin) {
33 }
34 
35 
36 /*
37  * Actions
38  */
39 
40 // None
41 
42 
43 /*
44  * View
45  */
46 
47 llxHeader("", $langs->trans("Printing"));
48 
49 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');
50 
51 print $langs->trans("DirectPrintingJobsDesc").'<br><br>';
52 
53 // List Jobs from printing modules
54 $object = new PrintingDriver($db);
55 $result = $object->listDrivers($db, 10);
56 foreach ($result as $driver) {
57  require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
58  $classname = 'printing_'.$driver;
59  $langs->load($driver);
60  $printer = new $classname($db);
61  $keyforprinteractive = $printer->active;
62  if ($keyforprinteractive && getDolGlobalString($keyforprinteractive)) {
63  //$printer->listJobs('commande');
64  $result = $printer->listJobs();
65  print $printer->resprint;
66 
67  if ($result > 0) {
68  setEventMessages($printer->error, $printer->errors, 'errors');
69  }
70  }
71 }
72 
73 // End of page
74 llxFooter();
75 $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:5257
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:80
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: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