Uniformize presentation

This commit is contained in:
aspangaro 2016-08-10 07:40:40 +02:00
parent dd905debb4
commit a1d1396919
12 changed files with 160 additions and 46 deletions

View File

@ -120,7 +120,7 @@ if ($id > 0 && empty($object->id))
if ($object->id > 0)
{
$title=$langs->trans("ThirdParty")." - ".$langs->trans('SupplierCard');
$title=$langs->trans("ThirdParty")." - ".$langs->trans('Supplier');
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('Supplier');
$help_url='';
llxHeader('',$title, $help_url);

View File

@ -69,11 +69,21 @@ if ($id > 0 || ! empty($ref))
{
$result = $object->fetch($id, $ref);
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
llxHeader("", $langs->trans("CardProduct".$object->type), $help_url);
llxHeader('', $title, $helpurl);
/*
* En mode visu

View File

@ -811,12 +811,19 @@ if (empty($reshook))
* View
*/
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
if (isset($_GET['type'])) $title = $langs->trans('CardProduct'.GETPOST('type'));
else $title = $langs->trans('ProductServiceCard');
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
llxHeader('', $title, $helpurl);

View File

@ -133,10 +133,6 @@ else if($action==='save_composed_product')
* View
*/
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
$product_fourn = new ProductFournisseur($db);
$productstatic = new Product($db);
$form = new Form($db);
@ -177,10 +173,22 @@ if ($action == 'search')
$resql = $db->query($sql);
}
//print $sql;
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('AssociatedProducts');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('AssociatedProducts');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
llxHeader("", $langs->trans("CardProduct".$object->type), $helpurl);
llxHeader('', $title, $helpurl);
$head=product_prepare_head($object);
$titre=$langs->trans("CardProduct".$object->type);

View File

@ -166,11 +166,21 @@ if ($action=='filemerge')
$form = new Form($db);
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Documents');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Documents');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
llxHeader("", $langs->trans("CardProduct".$object->type), $help_url);
llxHeader('', $title, $helpurl);
if ($object->id)

View File

@ -274,19 +274,26 @@ if (empty($reshook))
* view
*/
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('BuyingPrices');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('BuyingPrices');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
llxHeader('', $title, $helpurl);
$form = new Form($db);
if ($id > 0 || $ref)
{
if ($action <> 're-edit')
{
llxHeader("", $langs->trans("CardProduct".$object->type), $helpurl);
}
if ($result)
{
if ($action == 'ask_remove_pf') {
@ -365,7 +372,7 @@ if ($id > 0 || $ref)
print '<table class="border" width="100%">';
// Supplier
print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("Supplier").'</td><td>';
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Supplier").'</td><td>';
if ($rowid)
{
$supplier=new Fournisseur($db);

View File

@ -56,11 +56,21 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
* View
*/
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Info');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Info');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
$title=$langs->trans("Product");
llxHeader('', $title, $helpurl);
$form=new Form($b);

View File

@ -619,11 +619,21 @@ if (! empty($id) || ! empty($ref))
$object->fetch($id, $ref);
}
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('SellingPrices');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('SellingPrices');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
llxHeader("", $langs->trans("CardProduct" . $object->type), $hepl_url);
llxHeader('', $title, $helpurl);
$head = product_prepare_head($object);
$titre = $langs->trans("CardProduct" . $object->type);

View File

@ -94,7 +94,22 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
else
{
$result = $object->fetch($id,$ref);
llxHeader("",$langs->trans("CardProduct".$object->type));
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Statistics');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Statistics');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
llxHeader('', $title, $helpurl);
}

View File

@ -90,7 +90,21 @@ if ($id > 0 || ! empty($ref))
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
llxHeader("","",$langs->trans("CardProduct".$product->type));
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Referers');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Referers');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
llxHeader('', $title, $helpurl);
if ($result > 0)
{

View File

@ -407,8 +407,21 @@ if ($id > 0 || $ref)
$object->load_stock();
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
llxHeader("",$langs->trans("CardProduct".$object->type),$help_url);
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Stock');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Stock');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
llxHeader('', $title, $helpurl);
if ($result > 0)
{

View File

@ -163,11 +163,21 @@ $result = $object->fetch($id,$ref);
* View
*/
$helpurl='';
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
$title = $langs->trans('ProductServiceCard');
$helpurl = '';
$shortlabel = dol_trunc($object->label,16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT))
{
$title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Translation');
$helpurl='EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE))
{
$title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Translation');
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
}
llxHeader("", $langs->trans("Translation"), $help_url);
llxHeader('', $title, $helpurl);
$form = new Form($db);
$formadmin=new FormAdmin($db);