index.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /**
  19. * \file htdocs/printing/index.php
  20. * \ingroup printing
  21. * \brief Printing
  22. */
  23. require '../main.inc.php';
  24. include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php';
  25. // Load translation files required by the page
  26. $langs->load("printing");
  27. if (!$user->admin) {
  28. accessforbidden();
  29. }
  30. /*
  31. * Actions
  32. */
  33. // None
  34. /*
  35. * View
  36. */
  37. llxHeader("", $langs->trans("Printing"));
  38. 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');
  39. print $langs->trans("DirectPrintingJobsDesc").'<br><br>';
  40. // List Jobs from printing modules
  41. $object = new PrintingDriver($db);
  42. $result = $object->listDrivers($db, 10);
  43. foreach ($result as $driver) {
  44. require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
  45. $classname = 'printing_'.$driver;
  46. $langs->load($driver);
  47. $printer = new $classname($db);
  48. $keyforprinteractive = $printer->active;
  49. if ($keyforprinteractive && $conf->global->$keyforprinteractive) {
  50. //$printer->listJobs('commande');
  51. $result = $printer->listJobs();
  52. print $printer->resprint;
  53. if ($result > 0) {
  54. setEventMessages($printer->error, $printer->errors, 'errors');
  55. }
  56. }
  57. }
  58. // End of page
  59. llxFooter();
  60. $db->close();