Look and feel v14
This commit is contained in:
parent
8e632d08b8
commit
84219689a6
@ -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
|
||||
|
||||
@ -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 '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.value']['checked'])) {
|
||||
// Qty
|
||||
print '<td class="liste_titre right">';
|
||||
@ -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 '<td>';
|
||||
/*
|
||||
* $productstatic->id=$objp->rowid;
|
||||
* $productstatic->ref=$objp->produit;
|
||||
* $productstatic->type=$objp->type;
|
||||
* print $productstatic->getNomUrl(1,'',16);
|
||||
*/
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($productstatic->label).'">';
|
||||
print $productstatic->label;
|
||||
print "</td>\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 '<td class="tdoverflowmax100aaa">'.$objp->label.'</td>';
|
||||
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($objp->label).'">'.$objp->label.'</td>';
|
||||
}
|
||||
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 '<td class="nowraponall">'.$origin.'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
print '<td>';
|
||||
if ($objp->fk_project != 0) {
|
||||
print $movement->get_origin($objp->fk_project, 'project');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.value']['checked'])) {
|
||||
// Qty
|
||||
print '<td class="right">';
|
||||
|
||||
@ -1841,6 +1841,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</form>';
|
||||
} 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 ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $object->barcode;
|
||||
print showValueWithClipboardCPButton($object->barcode);
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -209,7 +209,7 @@ if ($result || empty($id)) {
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<div class="center"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></div>';
|
||||
print '</form>';
|
||||
print '</form><br>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -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 '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.value']['checked'])) {
|
||||
// Qty
|
||||
print '<td class="liste_titre right">';
|
||||
@ -990,13 +987,6 @@ if ($resql) {
|
||||
print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
// 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 '<td><a href="'
|
||||
.DOL_URL_ROOT.'/product/stock/movement_card.php?id='.urlencode($objp->entrepot_id)
|
||||
.'&search_inventorycode='.urlencode($objp->inventorycode)
|
||||
.'&search_type_mouvement='.urlencode($objp->type_mouvement)
|
||||
.'">'.$objp->inventorycode.'</a></td>';
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?search_inventorycode='.urlencode('^'.$objp->inventorycode.'$').'&search_type_mouvement='.urlencode($objp->type_mouvement).'">'.$objp->inventorycode.'</a></td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.label']['checked'])) {
|
||||
// Label of movement
|
||||
print '<td class="tdoverflowmax100aaa">'.$objp->label.'</td>';
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).'">'.$objp->label.'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.type_mouvement']['checked'])) {
|
||||
// Type of movement
|
||||
@ -1214,6 +1200,14 @@ if ($resql) {
|
||||
// Origin of movement
|
||||
print '<td class="nowraponall">'.$origin.'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
print '<td>';
|
||||
if ($objp->fk_project != 0) {
|
||||
print $movement->get_origin($objp->fk_project, 'project');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.value']['checked'])) {
|
||||
// Qty
|
||||
print '<td class="right">';
|
||||
@ -1231,14 +1225,6 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
print '<td align="right">';
|
||||
if ($objp->fk_project != 0) {
|
||||
print $movement->get_origin($objp->fk_project, 'project');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
|
||||
@ -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<div class=\"tabsAction\">\n";
|
||||
print "\n".'<div class="tabsAction">'."\n";
|
||||
|
||||
if ($action == '') {
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||
@ -208,7 +213,7 @@ if ($action == '') {
|
||||
}
|
||||
}
|
||||
|
||||
print "\n</div>\n";
|
||||
print "\n".'</div>'."\n";
|
||||
|
||||
|
||||
|
||||
@ -222,9 +227,12 @@ if ($action == 'edit') {
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
if (!empty($object->multilangs)) {
|
||||
$i = 0;
|
||||
foreach ($object->multilangs as $key => $value) {
|
||||
$i++;
|
||||
|
||||
$s = picto_from_langcode($key);
|
||||
print "<br>".($s ? $s.' ' : '')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"')."</a><br>";
|
||||
print ($i > 1 ? "<br>" : "").($s ? $s.' ' : '').' <div class="inline-block"><b>'.$langs->trans('Language_'.$key).'</b></div><div class="inline-block floatright"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom marginrightonly"').'</a></div>';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
@ -254,9 +262,12 @@ if ($action == 'edit') {
|
||||
print '</form>';
|
||||
} elseif ($action != 'add') {
|
||||
if (!empty($object->multilangs)) {
|
||||
$i = 0;
|
||||
foreach ($object->multilangs as $key => $value) {
|
||||
$i++;
|
||||
|
||||
$s = picto_from_langcode($key);
|
||||
print ($s ? $s.' ' : '')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').'</a>';
|
||||
print ($i > 1 ? "<br>" : "").($s ? $s.' ' : '').' <div class="inline-block"><b>'.$langs->trans('Language_'.$key).'</b></div><div class="inline-block floatright"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom marginrightonly"').'</a></div>';
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
@ -295,7 +306,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
|
||||
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
|
||||
print $formadmin->select_language(GETPOST('forcelangprod'), 'forcelangprod', 0, $object->multilangs, 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user