diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang
index aa13c745c96..3ab83908ff5 100644
--- a/htdocs/langs/en_US/productbatch.lang
+++ b/htdocs/langs/en_US/productbatch.lang
@@ -1,7 +1,7 @@
# ProductBATCH language file - en_US - ProductBATCH
ManageLotSerial=Use lot/serial number
-ProductStatusOnBatch=Lot (required)
-ProductStatusOnSerial=Unique Serial Number (required)
+ProductStatusOnBatch=Yes (lot required)
+ProductStatusOnSerial=Yes (unique serial number required)
ProductStatusNotOnBatch=No (lot/serial not used)
ProductStatusOnBatchShort=Lot
ProductStatusOnSerialShort=Serial
diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php
index 98c78b948fb..59b4b07fe82 100644
--- a/htdocs/mrp/mo_movements.php
+++ b/htdocs/mrp/mo_movements.php
@@ -114,23 +114,24 @@ $objectlist = new MouvementStock($db);
// Definition of fields for list
$arrayfields = array(
- 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>1),
- 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1, 'position'=>2),
- 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100', 'position'=>10),
- 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1, 'position'=>15),
- 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>20),
- 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>21),
- 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>22),
- 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'position'=>30),
- 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0, 'position'=>40),
- 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1, 'position'=>42),
- 'm.label'=>array('label'=>$langs->trans("MovementLabel"), 'checked'=>1, 'position'=>45),
- 'm.type_mouvement'=>array('label'=>$langs->trans("TypeMovement"), 'checked'=>1, 'position'=>48),
- 'origin'=>array('label'=>$langs->trans("Origin"), 'enabled'=>0, 'checked'=>0, 'position'=>50),
- 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1, 'position'=>60),
- 'm.price'=>array('label'=>$langs->trans("UnitCost"), 'enabled'=>0, 'checked'=>0, 'position'=>62),
- //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
+ 'm.rowid'=>array('label'=>"Ref", 'checked'=>1, 'position'=>1),
+ 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2),
+ 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3),
+ 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5),
+ 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))),
+ 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))),
+ 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
+ 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it
+ 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120),
+ 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130),
+ 'm.label'=>array('label'=>"MovementLabel", 'checked'=>1, 'position'=>140),
+ 'm.type_mouvement'=>array('label'=>"TypeMovement", 'checked'=>0, 'position'=>150),
+ 'origin'=>array('label'=>"Origin", 'checked'=>1, 'position'=>155),
+ 'm.fk_projet'=>array('label'=>'Project', 'checked'=>0, 'position'=>180),
+ 'm.value'=>array('label'=>"Qty", 'checked'=>1, 'position'=>200),
+ 'm.price'=>array('label'=>"UnitPurchaseValue", 'checked'=>0, 'position'=>210)
+ //'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
+ //'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500)
);
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
unset($arrayfields['pl.eatby']);
@@ -678,6 +679,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
print '';
}
+ if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ // fk_project
+ print '
';
+ print ' ';
+ print ' ';
+ }
if (!empty($arrayfields['m.value']['checked'])) {
// Qty
print '';
@@ -757,6 +764,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (!empty($arrayfields['origin']['checked'])) {
print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
}
+ if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ print_liste_field_titre($arrayfields['m.fk_projet']['label'], $_SERVER["PHP_SELF"], "m.fk_projet", "", $param, '', $sortfield, $sortorder);
+ }
if (!empty($arrayfields['m.value']['checked'])) {
print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, '', $sortfield, $sortorder, 'right ');
}
@@ -837,13 +847,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
if (!empty($arrayfields['p.label']['checked'])) {
// Product label
- print ' ';
- /*
- * $productstatic->id=$objp->rowid;
- * $productstatic->ref=$objp->produit;
- * $productstatic->type=$objp->type;
- * print $productstatic->getNomUrl(1,'',16);
- */
+ print ' ';
print $productstatic->label;
print " \n";
}
@@ -884,7 +888,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
if (!empty($arrayfields['m.label']['checked'])) {
// Label of movement
- print ''.$objp->label.' ';
+ print ''.$objp->label.' ';
}
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
// Type of movement
@@ -907,6 +911,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Origin of movement
print ''.$origin.' ';
}
+ if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ // fk_project
+ print '';
+ if ($objp->fk_project != 0) {
+ print $movement->get_origin($objp->fk_project, 'project');
+ }
+ print ' ';
+ }
if (!empty($arrayfields['m.value']['checked'])) {
// Qty
print '';
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index a50eb7bede2..3eccae1e114 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1841,6 +1841,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
} else {
// Fiche en mode visu
+
$showbarcode = empty($conf->barcode->enabled) ? 0 : 1;
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
$showbarcode = 0;
@@ -1930,7 +1931,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
print '';
} else {
- print $object->barcode;
+ print showValueWithClipboardCPButton($object->barcode);
}
print ' '."\n";
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 548afb3037a..b8ddb6c8672 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1350,6 +1350,11 @@ class Product extends CommonObject
return -1;
}
} elseif (isset($this->multilangs[$key])) {
+ if (empty($this->multilangs["$key"]["label"])) {
+ $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
+ return -1;
+ }
+
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product=".$this->id;
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index b55976bface..a47bc79c84a 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -209,7 +209,7 @@ if ($result || empty($id)) {
print '';
print '';
print '
';
- print '';
+ print ' ';
print ' ';
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index b4d1c9a1fe8..38c49a44f4c 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -116,24 +116,24 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
$arrayfields = array(
- 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
- 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
- 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'),
- 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>0),
- 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))),
- 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled))),
- 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
- 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it
- 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
- 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
- 'm.label'=>array('label'=>$langs->trans("MovementLabel"), 'checked'=>1),
- 'm.type_mouvement'=>array('label'=>$langs->trans("TypeMovement"), 'checked'=>0),
- 'origin'=>array('label'=>$langs->trans("Origin"), 'checked'=>1),
- 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1),
- 'm.price'=>array('label'=>$langs->trans("UnitPurchaseValue"), 'checked'=>0),
- 'm.fk_projet'=>array('label'=>$langs->trans('Project'), 'checked'=>0)
- //'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- //'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
+ 'm.rowid'=>array('label'=>"Ref", 'checked'=>1, 'position'=>1),
+ 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2),
+ 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3),
+ 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5),
+ 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))),
+ 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))),
+ 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))),
+ 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!$id > 0)), // If we are on specific warehouse, we hide it
+ 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120),
+ 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130),
+ 'm.label'=>array('label'=>"MovementLabel", 'checked'=>1, 'position'=>140),
+ 'm.type_mouvement'=>array('label'=>"TypeMovement", 'checked'=>0, 'position'=>150),
+ 'origin'=>array('label'=>"Origin", 'checked'=>1, 'position'=>155),
+ 'm.fk_projet'=>array('label'=>'Project', 'checked'=>0, 'position'=>180),
+ 'm.value'=>array('label'=>"Qty", 'checked'=>1, 'position'=>200),
+ 'm.price'=>array('label'=>"UnitPurchaseValue", 'checked'=>0, 'position'=>210)
+ //'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
+ //'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500)
);
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
unset($arrayfields['pl.eatby']);
@@ -470,7 +470,6 @@ $warehousestatic = new Entrepot($db);
$movement = new MouvementStock($db);
$userstatic = new User($db);
$form = new Form($db);
-$formother = new FormOther($db);
$formproduct = new FormProduct($db);
if (!empty($conf->projet->enabled)) {
$formproject = new FormProjets($db);
@@ -574,20 +573,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
}
}
-if (empty($search_inventorycode)) {
- $sql .= $db->plimit($limit + 1, $offset);
-} else {
- $limit = 0;
-}
+$sql .= $db->plimit($limit + 1, $offset);
//print $sql;
$resql = $db->query($sql);
-if (!empty($search_inventorycode)) {
- $limit = $db->num_rows($resql);
-}
-
if ($resql) {
$product = new Product($db);
$object = new Entrepot($db);
@@ -978,6 +969,12 @@ if ($resql) {
print ' ';
print '';
}
+ if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ // fk_project
+ print '';
+ print ' ';
+ print ' ';
+ }
if (!empty($arrayfields['m.value']['checked'])) {
// Qty
print '';
@@ -990,13 +987,6 @@ if ($resql) {
print ' ';
print ' ';
}
- if (!empty($arrayfields['m.fk_projet']['checked'])) {
- // fk_project
- print '';
- print ' ';
- print ' ';
- }
-
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@@ -1063,15 +1053,15 @@ if ($resql) {
if (!empty($arrayfields['origin']['checked'])) {
print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder);
}
+ if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ print_liste_field_titre($arrayfields['m.fk_projet']['label'], $_SERVER["PHP_SELF"], "m.fk_projet", "", $param, '', $sortfield, $sortorder);
+ }
if (!empty($arrayfields['m.value']['checked'])) {
print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($arrayfields['m.price']['checked'])) {
print_liste_field_titre($arrayfields['m.price']['label'], $_SERVER["PHP_SELF"], "m.price", "", $param, '', $sortfield, $sortorder, 'right ');
}
- if (!empty($arrayfields['m.fk_projet']['checked'])) {
- print_liste_field_titre($arrayfields['m.fk_projet']['label'], $_SERVER["PHP_SELF"], "m.fk_projet", "", $param, 'align="right"', $sortfield, $sortorder);
- }
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -1183,15 +1173,11 @@ if ($resql) {
}
if (!empty($arrayfields['m.inventorycode']['checked'])) {
// Inventory code
- print ''.$objp->inventorycode.' ';
+ print 'inventorycode.'$').'&search_type_mouvement='.urlencode($objp->type_mouvement).'">'.$objp->inventorycode.' ';
}
if (!empty($arrayfields['m.label']['checked'])) {
// Label of movement
- print ''.$objp->label.' ';
+ print ''.$objp->label.' ';
}
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
// Type of movement
@@ -1214,6 +1200,14 @@ if ($resql) {
// Origin of movement
print ''.$origin.' ';
}
+ if (!empty($arrayfields['m.fk_projet']['checked'])) {
+ // fk_project
+ print '';
+ if ($objp->fk_project != 0) {
+ print $movement->get_origin($objp->fk_project, 'project');
+ }
+ print ' ';
+ }
if (!empty($arrayfields['m.value']['checked'])) {
// Qty
print '';
@@ -1231,14 +1225,6 @@ if ($resql) {
}
print ' ';
}
- if (!empty($arrayfields['m.fk_projet']['checked'])) {
- // fk_project
- print '';
- if ($objp->fk_project != 0) {
- print $movement->get_origin($objp->fk_project, 'project');
- }
- print ' ';
- }
// Action column
print '';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index d1d2289fb24..57f08f81866 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -61,30 +61,38 @@ if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) {
$object = new Product($db);
$object->fetch($id);
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
+ setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
+ $action = '';
}
// Add translation
-if ($action == 'vadd' &&
-$cancel != $langs->trans("Cancel") &&
-($user->rights->produit->creer || $user->rights->service->creer)) {
+if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
// update de l'objet
- if ($_POST["forcelangprod"] == $current_lang) {
- $object->label = $_POST["libelle"];
- $object->description = dol_htmlcleanlastbr($_POST["desc"]);
- $object->other = dol_htmlcleanlastbr($_POST["other"]);
+ if (GETPOST("forcelangprod") == $current_lang) {
+ $object->label = GETPOST("libelle");
+ $object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
+ $object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
+
$object->update($object->id, $user);
} else {
- $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
- $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
- $object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
+ $object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle");
+ $object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
+ $object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
}
- // sauvegarde en base
- if ($object->setMultiLangs($user) > 0) {
+ // save in database
+ if (GETPOST("forcelangprod")) {
+ $result = $object->setMultiLangs($user);
+ } else {
+ $object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language"));
+ $result = -1;
+ }
+
+ if ($result > 0) {
$action = '';
} else {
$action = 'add';
@@ -93,26 +101,25 @@ $cancel != $langs->trans("Cancel") &&
}
// Edit translation
-if ($action == 'vedit' &&
-$cancel != $langs->trans("Cancel") &&
-($user->rights->produit->creer || $user->rights->service->creer)) {
+if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet
if ($key == $current_lang) {
- $object->label = $_POST["libelle-".$key];
- $object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
- $object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
+ $object->label = GETPOST("libelle-".$key);
+ $object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
+ $object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
} else {
- $object->multilangs[$key]["label"] = $_POST["libelle-".$key];
- $object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
- $object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
+ $object->multilangs[$key]["label"] = GETPOST("libelle-".$key);
+ $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
+ $object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
}
}
- if ($object->setMultiLangs($user) > 0) {
+ $result = $object->setMultiLangs($user);
+ if ($result > 0) {
$action = '';
} else {
$action = 'edit';
@@ -121,15 +128,13 @@ $cancel != $langs->trans("Cancel") &&
}
// Delete translation
-if ($action == 'vdelete' &&
-$cancel != $langs->trans("Cancel") &&
-($user->rights->produit->creer || $user->rights->service->creer)) {
+if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$langtodelete = GETPOST('langdel', 'alpha');
-
- if ($object->delMultiLangs($langtodelete, $user) > 0) {
+ $result = $object->delMultiLangs($langtodelete, $user);
+ if ($result > 0) {
$action = '';
} else {
$action = 'edit';
@@ -197,7 +202,7 @@ print dol_get_fiche_end();
/* */
/* ************************************************************************** */
-print "\n\n";
+print "\n".'
'."\n";
if ($action == '') {
if ($user->rights->produit->creer || $user->rights->service->creer) {
@@ -208,7 +213,7 @@ if ($action == '') {
}
}
-print "\n
\n";
+print "\n".'
'."\n";
@@ -222,9 +227,12 @@ if ($action == 'edit') {
print ' ';
if (!empty($object->multilangs)) {
+ $i = 0;
foreach ($object->multilangs as $key => $value) {
+ $i++;
+
$s = picto_from_langcode($key);
- print " ".($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".'id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"')." ";
+ print ($i > 1 ? " " : "").($s ? $s.' ' : '').' '.$langs->trans('Language_'.$key).'
';
print '
';
print '';
@@ -254,9 +262,12 @@ if ($action == 'edit') {
print '';
} elseif ($action != 'add') {
if (!empty($object->multilangs)) {
+ $i = 0;
foreach ($object->multilangs as $key => $value) {
+ $i++;
+
$s = picto_from_langcode($key);
- print ($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".'id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').' ';
+ print ($i > 1 ? " " : "").($s ? $s.' ' : '').' '.$langs->trans('Language_'.$key).'
';
print '';
print '
';
@@ -295,7 +306,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
print '
';
print ''.$langs->trans('Language').' ';
- print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
+ print $formadmin->select_language(GETPOST('forcelangprod'), 'forcelangprod', 0, $object->multilangs, 1);
print ' ';
print ''.$langs->trans('Label').' ';
print ''.$langs->trans('Description').' ';
diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php
index 8cb51a152d4..a6da55bea60 100644
--- a/htdocs/theme/eldy/btn.inc.php
+++ b/htdocs/theme/eldy/btn.inc.php
@@ -66,9 +66,14 @@ span.butAction, span.butActionDelete {
.butAction {
background: var(--butactionbg);
color: #FFF !important;
- border-radius: 3px;
/* background: rgb(230, 232, 239); */
}
+.butActionRefused, .butAction, .butActionDelete {
+ border-radius: 3px;
+}
+.butActionRefused:last-child, .butAction:last-child, .butActionDelete:last-child {
+ margin-right: 0px !important;
+}
.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
text-decoration: none;
text-transform: uppercase;