diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index c21049a5c76..0110d9db789 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2016 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -62,9 +62,9 @@ print ''.$langs->trans('HideProductCombinations').' print $form->selectyesno("PRODUIT_ATTRIBUTES_HIDECHILD",$conf->global->PRODUIT_ATTRIBUTES_HIDECHILD,1).''; print ''.$langs->trans('CombinationsSeparator').''; if(isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { - $separator = $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR; + $separator = $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR; } else { - $separator = "_"; + $separator = "_"; } print ''; print ''; @@ -74,4 +74,3 @@ print ''; // End of page llxFooter(); $db->close(); - diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 3f298ae93e6..9f3dafdc153 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2016 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -50,7 +51,7 @@ if ($_POST) { $object->label = $label; if ($object->update($user) < 1) { - setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), $object->errors, 'errors'); } else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2)); @@ -79,7 +80,7 @@ if ($_POST) { if ($objectval->update($user) > 0) { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), null, 'errors'); + setEventMessage($langs->trans('CoreErrorMessage'), $objectval->errors, 'errors'); } } } @@ -99,7 +100,7 @@ if ($confirm == 'yes') { if ($res < 1 || ($object->delete() < 1)) { $db->rollback(); - setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), $object->errors, 'errors'); header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); } else { $db->commit(); @@ -113,7 +114,7 @@ if ($confirm == 'yes') { if ($objectval->fetch($valueid) > 0) { if ($objectval->delete() < 1) { - setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), $objectval->errors, 'errors'); } else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 636824d1980..62c5386d65d 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -1,6 +1,7 @@ - * Copyright (C) 2017 Laurent Destailleur +/* Copyright (C) 2016 Marcos García + * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * * 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 @@ -449,7 +450,7 @@ if (! empty($id) || ! empty($ref)) if($valueid > 0) { print ''."\n"; } - + print dol_fiche_head(); ?> diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index c3fbc39b82c..0e491be448d 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2016 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -49,7 +50,7 @@ if ($_POST) { } exit; } else { - setEventMessage($langs->trans('ErrorRecordAlreadyExists'), 'errors'); + setEventMessages($langs->trans('ErrorRecordAlreadyExists'), $prodattr->errors, 'errors'); } } } diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index 74da8a8043e..8213148327d 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Frédéric France * * 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 @@ -70,7 +71,7 @@ if ($action == 'add') header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id); exit(); } else { - setEventMessages($langs->trans('ErrorCreatingProductAttributeValue'), null, 'errors'); + setEventMessages($langs->trans('ErrorCreatingProductAttributeValue'), $objectval->errors, 'errors'); } } } diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index b5498aa78ef..3083c5e67ca 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2016 Marcos García + * Copyright (C) 2018 Frédéric France * * 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 @@ -103,7 +103,7 @@ if ($_POST) { $res = 1; - foreach (cartesianArray($adapted_values) as $currcomb) + foreach (cartesianArray($adapted_values) as $currcomb) { $res = $combination->createProductCombination($product, $currcomb, $sanitized_values, $price_var_percent); if ($res < 0) { @@ -146,17 +146,17 @@ if (! empty($id) || ! empty($ref)) { { $showbarcode=empty($conf->barcode->enabled)?0:1; if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; - + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'combinations', $titre, 0, $picto); - + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter=" fk_product_type = ".$object->type; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); - + dol_fiche_end(); }