Gestion generique de la navigation Fiche suivante-Precedente
This commit is contained in:
parent
be77c626a0
commit
22e59a51e1
@ -46,6 +46,8 @@ accessforbidden();
|
|||||||
|
|
||||||
llxHeader("","",$langs->trans("BarCode"));
|
llxHeader("","",$langs->trans("BarCode"));
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||||
@ -61,12 +63,7 @@ print '<table class="border" width="100%">';
|
|||||||
// Reference
|
// Reference
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||||
$product->load_previous_next_ref();
|
print $html->showrefnav($product,'ref');
|
||||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
|
||||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
|
||||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
|
||||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -91,10 +91,8 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fiche produit
|
* Fiche produit
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -163,26 +163,8 @@ if ($id || $ref)
|
|||||||
|
|
||||||
// Reference
|
// Reference
|
||||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
|
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
|
||||||
|
print $html->showrefnav($product,'ref');
|
||||||
// Suivant/précédent
|
print '</td></tr>';
|
||||||
$product->load_previous_next_ref();
|
|
||||||
$previous_ref = $product->ref_previous?'<a href="?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
|
||||||
$next_ref = $product->ref_next?'<a href="?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
|
||||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
|
||||||
print '<a href="?id='.$product->id.'">'.$product->ref.'</a>';
|
|
||||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
if ($product->is_photo_available($conf->produit->dir_output))
|
|
||||||
{
|
|
||||||
// Photo
|
|
||||||
print '<td valign="middle" align="center" rowspan="'.$nblignes.'">';
|
|
||||||
$nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Libelle
|
// Libelle
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
||||||
|
|||||||
@ -109,6 +109,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
dolibarr_fiche_head($head, 'stock', $titre);
|
dolibarr_fiche_head($head, 'stock', $titre);
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
|
||||||
print($mesg);
|
print($mesg);
|
||||||
|
|
||||||
@ -117,12 +118,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
// Reference
|
// Reference
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
|
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
|
||||||
$product->load_previous_next_ref();
|
print $html->showrefnav($product,'ref');
|
||||||
$previous_ref = $product->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
|
||||||
$next_ref = $product->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
|
||||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'">'.$product->ref.'</a>';
|
|
||||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -134,29 +134,18 @@ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
|||||||
|
|
||||||
llxHeader("","",$langs->trans("Translation"));
|
llxHeader("","",$langs->trans("Translation"));
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
|
||||||
$head=product_prepare_head($product, $user);
|
$head=product_prepare_head($product, $user);
|
||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
if ( $_GET["action"] != 'edit') dolibarr_fiche_head($head, 'translation', $titre);
|
dolibarr_fiche_head($head, 'translation', $titre);
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Reference
|
// Reference
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||||
if ($_GET["action"] != 'edit')
|
print $html->showrefnav($product,'ref');
|
||||||
{
|
|
||||||
$product->load_previous_next_ref();
|
|
||||||
$previous_ref = $product->ref_previous?'<a href="?ref='.$product->ref_previous.'">'.img_previous().'</a>':'';
|
|
||||||
$next_ref = $product->ref_next?'<a href="?ref='.$product->ref_next.'">'.img_next().'</a>':'';
|
|
||||||
if ($previous_ref || $next_ref) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
|
||||||
print '<a href="?id='.$product->id.'">'.$product->ref.'</a>';
|
|
||||||
if ($previous_ref || $next_ref) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_ref.'</td><td class="nobordernopadding" align="center" width="20">'.$next_ref.'</td></tr></table>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a href="?id='.$product->id.'">'.$product->ref.'</a>';
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user