} print '</form>'; } if ($mode == 'config' && $user->admin) { dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic'); print $langs->trans("PrintingDesc") . "<br><br>\n"; print '<table class="noborder" width="100%">' . "\n"; $var = true; print '<tr class="liste_titre">'; print '<th>' . $langs->trans("Description") . '</th>'; print '<th class="center">' . $langs->trans("Active") . '</th>'; print '<th class="center">' . $langs->trans("Setup") . '</th>'; print '<th class="center">' . $langs->trans("TargetedPrinter") . '</th>'; print "</tr>\n"; $object = new PrintingDriver($db); $result = $object->listDrivers($db, 10); 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); //print '<pre>'.print_r($printer, true).'</pre>'; $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td>' . img_picto('', $printer->picto) . ' ' . $langs->trans($printer->desc) . '</td>'; print '<td class="center">'; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff($printer->active); } else { if (empty($conf->global->{$printer->conf})) { print '<a href="' . $_SERVER['PHP_SELF'] . '?action=setvalue&varname=' . $printer->active . '&value=1">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
* along with this program. If not, see <http://www.gnu.org/licenses/>. * or see http://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' and $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); if (!empty($list)) { $errorprint = 0; $printed = 0; foreach ($list as $driver) { require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/' . $driver . '.modules.php'; $langs->load($driver); $classname = 'printing_' . $driver; $printer = new $classname($db); //print '<pre>'.print_r($printer, true).'</pre>'; if (!empty($conf->global->{$printer->active})) { $subdir = GETPOST('printer', 'alpha') == 'expedition' ? 'sending' : ''; $module = GETPOST('printer', 'alpha'); if ($module == 'commande_fournisseur') { $module = 'fournisseur'; $subdir = 'commande';