40if ($action ==
'print_file' && $user->hasRight(
'printing',
'read')) {
41 $langs->load(
"printing");
42 require_once DOL_DOCUMENT_ROOT.
'/core/modules/printing/modules_printing.php';
44 $list = $objectprint->listDrivers($db, 10);
45 $dirmodels = array_merge(array(
'/core/modules/printing/'), (array) $conf->modules_parts[
'printing']);
48 foreach ($list as $driver) {
49 foreach ($dirmodels as $dir) {
50 if (file_exists(
dol_buildpath($dir, 0).$driver.
'.modules.php')) {
55 require_once $classfile;
56 $classname =
'printing_'.$driver;
57 $printer =
new $classname($db);
58 '@phan-var-force PrintingDriver $printer';
60 $langs->load(
'printing');
67 $module =
GETPOST(
'printer',
'alpha');
72 $module =
'expedition';
77 case 'commande_fournisseur':
78 $module =
'commande_fournisseur';
84 $filetoprint =
GETPOST(
'file',
'alpha');
85 if ($module ==
'facture') {
86 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
87 $refinvoice = preg_replace(
'/[\/\\\\].*$/',
'', $filetoprint);
89 $tmpinvoice->fetch(0, $refinvoice);
90 if ($tmpinvoice->id > 0) {
92 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"facture SET pos_print_counter = pos_print_counter + 1";
93 $sql .=
" WHERE rowid = ".((int) $tmpinvoice->id);
102 $ret = $printer->printFile($filetoprint, $module, $subdir);
110 setEventMessages($langs->transnoentitiesnoconv(
"FileWasSentToPrinter", basename(
GETPOST(
'file',
'alpha'))).
' '.$langs->transnoentitiesnoconv(
"ViaModule").
' '.$printer->name,
null);
118 if ($printerfound == 0) {
119 setEventMessages($langs->trans(
"NoActivePrintingModuleFound", $langs->transnoentities(
"Module64000Name")),
null,
'warnings');
Class to manage invoices.
Parent class of emailing target selectors modules.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.