golden hour
/home/phakp/public_html/erp/core
⬆️ Go Up
Upload
File/Folder
Size
Actions
actions_addupdatedelete.inc.php
17.21 KB
Del
OK
actions_builddoc.inc.php
5.55 KB
Del
OK
actions_changeselectedfields.inc.php
1.57 KB
Del
OK
actions_comments.inc.php
2.55 KB
Del
OK
actions_dellink.inc.php
2.58 KB
Del
OK
actions_extrafields.inc.php
12.31 KB
Del
OK
actions_fetchobject.inc.php
1.87 KB
Del
OK
actions_lineupdown.inc.php
2.56 KB
Del
OK
actions_linkedfiles.inc.php
12.29 KB
Del
OK
actions_massactions.inc.php
59.67 KB
Del
OK
actions_printing.inc.php
3.29 KB
Del
OK
actions_sendmails.inc.php
18.35 KB
Del
OK
actions_setmoduleoptions.inc.php
5.35 KB
Del
OK
actions_setnotes.inc.php
3.63 KB
Del
OK
ajax
-
Del
OK
antispamimage.php
1.9 KB
Del
OK
bookmarks_page.php
6.11 KB
Del
OK
boxes
-
Del
OK
class
-
Del
OK
commonfieldsinexport.inc.php
2.01 KB
Del
OK
customreports.php
33.5 KB
Del
OK
data
-
Del
OK
datepicker.php
9.51 KB
Del
OK
db
-
Del
OK
doxygen.php
1.71 KB
Del
OK
extrafieldsinexport.inc.php
2.87 KB
Del
OK
filemanagerdol
-
Del
OK
get_info.php
8.05 KB
Del
OK
get_menudiv.php
7.67 KB
Del
OK
js
-
Del
OK
lib
-
Del
OK
login
-
Del
OK
menus
-
Del
OK
modules
-
Del
OK
multicompany_page.php
5.23 KB
Del
OK
photos_resize.php
22.83 KB
Del
OK
search.php
4.95 KB
Del
OK
search_page.php
4.93 KB
Del
OK
tools.php
1.56 KB
Del
OK
tpl
-
Del
OK
triggers
-
Del
OK
website.inc.php
5.11 KB
Del
OK
Edit: actions_printing.inc.php
<?php /* Copyright (C) 2014-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr> * * 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 * along with this program. If not, see <https://www.gnu.org/licenses/>. * or see https://www.gnu.org/ */ /** * \file htdocs/core/actions_printing.inc.php * \brief Code for actions print_file to print file with calling trigger */ // $action must be defined // $db, $user, $conf, $langs must be defined // Filename to print must be provided into 'file' parameter // Print file if ($action == 'print_file' && $user->rights->printing->read) { $langs->load("printing"); require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; $objectprint = new PrintingDriver($db); $list = $objectprint->listDrivers($db, 10); $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); if (!empty($list)) { $errorprint = 0; $printerfound = 0; foreach ($list as $driver) { foreach ($dirmodels as $dir) { if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) { $classfile = dol_buildpath($dir, 0).$driver.'.modules.php'; break; } } require_once $classfile; $classname = 'printing_'.$driver; $printer = new $classname($db); $langs->load($printer::LANGFILE); //print '<pre>'.print_r($printer, true).'</pre>'; if (!empty($conf->global->{$printer->active})) { $printerfound++; $subdir = ''; $module = GETPOST('printer', 'alpha'); switch ($module) { case 'livraison': $subdir = 'receipt'; $module = 'expedition'; break; case 'expedition': $subdir = 'sending'; break; case 'commande_fournisseur': $module = 'fournisseur'; $subdir = 'commande'; break; } try { $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); if ($ret > 0) { //print '<pre>'.print_r($printer->errors, true).'</pre>'; setEventMessages($printer->error, $printer->errors, 'errors'); } if ($ret == 0) { //print '<pre>'.print_r($printer->errors, true).'</pre>'; setEventMessages($printer->error, $printer->errors); setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); } } catch (Exception $e) { $ret = 1; setEventMessages($e->getMessage(), null, 'errors'); } } } if ($printerfound == 0) { setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); } } else { setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); } $action = ''; }
Save