diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index 061b98d1e9c..dbf446d2112 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -36,7 +36,7 @@ if ($action == 'print_file' and $user->rights->printing->read) $list = $objectprint->listDrivers($db, 10); if (! empty($list)) { $errorprint=0; - $printed=0; + $printerfound=0; foreach ($list as $driver) { require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; $langs->load($driver); @@ -46,27 +46,35 @@ if ($action == 'print_file' and $user->rights->printing->read) if (! empty($conf->global->{$printer->active})) { + $printerfound++; + $subdir=(GETPOST('printer', 'alpha')=='expedition'?'sending':''); $module = GETPOST('printer', 'alpha'); if ($module =='commande_fournisseur') { $module = 'fournisseur'; $subdir = 'commande'; } - $ret = $printer->print_file(GETPOST('file', 'alpha'), $module, $subdir); - if ($ret > 0) { - //print '
'.print_r($printer->errors, true).''; - setEventMessages($printer->error, $printer->errors, 'errors'); + try { + $ret = $printer->print_file(GETPOST('file', 'alpha'), $module, $subdir); + if ($ret > 0) { + //print '
'.print_r($printer->errors, true).''; + setEventMessages($printer->error, $printer->errors, 'errors'); + } + if ($ret==0) + { + //print '
'.print_r($printer->errors, true).''; + setEventMessages($printer->error, $printer->errors); + setEventMessages($langs->trans("FileWasSentToPrinter", basename(GETPOST('file'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); + } } - if ($ret==0) + catch(Exception $e) { - //print '
'.print_r($printer->errors, true).''; - setEventMessages($printer->error, $printer->errors); - setEventMessages($langs->trans("FileWasSentToPrinter", basename(GETPOST('file'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); - $printed++; + $ret = 1; + setEventMessages($e->getMessage(), null, 'errors'); } } } - if ($printed==0) setEventMessages($langs->trans("NoActivePrintingModuleFound"), null, 'warnings'); + if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound"), null, 'warnings'); } else { setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 9dba03c5978..b0249452a70 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2205,7 +2205,7 @@ table.borderplus { border: 1px solid #BBB; } .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { - height: 20px; + height: 22px; } div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { vertical-align: middle; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 546cff1d9c7..a4341ab317d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2292,7 +2292,7 @@ table.borderplus { } .border tbody tr, .border tbody tr td, div.tabBar table.border tr { - height: 20px; + height: 22px; } table.border td, div.border div div.tagtd { diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index ae921114d6b..a611767cf2f 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -1,5 +1,4 @@ * * This program is free software; you can redistribute it and/or modify @@ -28,10 +27,10 @@ $ref = GETPOST('ref'); $confirm = GETPOST('confirm'); $cancel = GETPOST('cancel'); -$prodattr = new ProductAttribute($db); -$prodattrval = new ProductAttributeValue($db); +$object = new ProductAttribute($db); +$objectval = new ProductAttributeValue($db); -if ($prodattr->fetch($id) < 1) { +if ($object->fetch($id) < 1) { dol_print_error($db, $langs->trans('ErrorRecordNotFound')); exit(); } @@ -47,10 +46,10 @@ if ($_POST) { if ($action == 'edit') { - $prodattr->label = $label; - $prodattr->ref = $ref; + $object->label = $label; + $object->ref = $ref; - if ($prodattr->update() < 1) { + if ($object->update() < 1) { setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); } else { setEventMessage($langs->trans('RecordSaved')); @@ -59,19 +58,19 @@ if ($_POST) { } } elseif ($action == 'edit_value') { - if ($prodattrval->fetch($valueid) > 0) { + if ($objectval->fetch($valueid) > 0) { - $prodattrval->ref = $ref; - $prodattrval->value = GETPOST('value'); + $objectval->ref = $ref; + $objectval->value = GETPOST('value'); - if ($prodattrval->update() > 0) { + if ($objectval->update() > 0) { setEventMessage($langs->trans('RecordSaved')); } else { setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); } } - header('Location: '.dol_buildpath('/variants/card.php?id='.$prodattr->id, 2)); + header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); exit(); } @@ -82,12 +81,12 @@ if ($confirm == 'yes') { $db->begin(); - $res = $prodattrval->deleteByFkAttribute($prodattr->id); + $res = $objectval->deleteByFkAttribute($object->id); - if ($res < 1 || ($prodattr->delete() < 1)) { + if ($res < 1 || ($object->delete() < 1)) { $db->rollback(); setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); - header('Location: '.dol_buildpath('/variants/card.php?id='.$prodattr->id, 2)); + header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); } else { $db->commit(); setEventMessage($langs->trans('RecordSaved')); @@ -97,15 +96,15 @@ if ($confirm == 'yes') { exit(); } elseif ($action == 'confirm_deletevalue') { - if ($prodattrval->fetch($valueid) > 0) { + if ($objectval->fetch($valueid) > 0) { - if ($prodattrval->delete() < 1) { + if ($objectval->delete() < 1) { setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); } else { setEventMessage($langs->trans('RecordSaved')); } - header('Location: '.dol_buildpath('/variants/card.php?id='.$prodattr->id, 2)); + header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); exit(); } } @@ -118,38 +117,50 @@ if ($confirm == 'yes') { $langs->load('products'); -$title = $langs->trans('ProductAttributeName', dol_htmlentities($prodattr->label)); +$title = $langs->trans('ProductAttributeName', dol_htmlentities($object->label)); $var = false; llxHeader('', $title); -print_fiche_titre($title); +//print_fiche_titre($title); -dol_fiche_head(); +$h=0; +$head[$h][0] = DOL_URL_ROOT.'/variants/card.php?id='.$object->id; +$head[$h][1] = $langs->trans("Card"); +$head[$h][2] = 'variant'; +$h++; + +dol_fiche_head($head, 'variant', $langs->trans('ProductAttributeName'), -1, 'generic'); if ($action == 'edit') { - print '