dolibarr/htdocs/printing/index.php

87 lines
2.4 KiB
PHP
Raw Permalink Normal View History

2014-12-05 18:23:54 +01:00
<?php
/* Copyright (C) 2014-2024 Frédéric France <frederic.france@free.fr>
2018-09-13 11:13:32 +02:00
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
2014-12-05 18:23:54 +01:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2014-12-05 18:23:54 +01:00
*/
/**
* \file htdocs/printing/index.php
* \ingroup printing
* \brief Printing
*/
2022-09-07 20:08:59 +02:00
// Load Dolibarr environment
2014-12-05 18:23:54 +01:00
require '../main.inc.php';
2015-10-31 23:05:15 +01:00
include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
2014-12-05 18:23:54 +01:00
add baseline exclude for phpstan (#31632) * add baseline exclude for phpstan * update * update * update * update * update * merge * restore one filter * delete old errors * fix * fix * fix * $moreforfilter can t be empty * fix * enable check * refresh baseline * add phpdoc * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
2018-05-26 17:57:30 +02:00
// Load translation files required by the page
2016-07-27 19:36:17 +02:00
$langs->load("printing");
2021-03-19 12:15:46 +01:00
if (!$user->admin) {
accessforbidden();
}
2016-07-27 19:36:17 +02:00
/*
* Actions
*/
// None
/*
* View
*/
2018-09-13 11:13:32 +02:00
llxHeader("", $langs->trans("Printing"));
2014-12-05 18:23:54 +01:00
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');
2014-12-05 18:23:54 +01:00
2015-11-05 10:11:39 +01:00
print $langs->trans("DirectPrintingJobsDesc").'<br><br>';
2014-12-05 18:23:54 +01:00
// List Jobs from printing modules
2015-10-31 23:05:15 +01:00
$object = new PrintingDriver($db);
$result = $object->listDrivers($db, 10);
2018-09-13 11:13:32 +02:00
foreach ($result as $driver) {
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
$classname = 'printing_'.$driver;
$langs->load($driver);
$printer = new $classname($db);
'@phan-var-force PrintingDriver $printer';
$keyforprinteractive = $printer->active;
2022-07-24 19:58:11 +02:00
if ($keyforprinteractive && getDolGlobalString($keyforprinteractive)) {
//$printer->listJobs('commande');
$result = $printer->listJobs();
print $printer->resprint;
2018-07-26 18:05:20 +02:00
if ($result > 0) {
setEventMessages($printer->error, $printer->errors, 'errors');
}
}
2015-10-31 23:05:15 +01:00
}
2014-12-05 18:23:54 +01:00
2018-08-14 09:55:58 +02:00
// End of page
2014-12-05 18:23:54 +01:00
llxFooter();
$db->close();