Skip to content

Commit

Permalink
FIX missing hide "new" button where "product" or "service" module is
Browse files Browse the repository at this point in the history
disable
  • Loading branch information
hregis committed Mar 24, 2024
1 parent 9c60453 commit 5378c85
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion htdocs/product/agenda.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
$picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
print dol_get_fiche_head($head, 'agenda', $titre, -1, $picto);

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = "fk_product_type = ".((int) $object->type);

$shownav = 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/composition/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
* Product card
*/
if ($user->rights->produit->lire || $user->hasRight('service', 'lire')) {
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';

$shownav = 1;
if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
}


$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = "fk_product_type = ".((int) $object->type);

$shownav = 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/fournisseurs.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@

print dol_get_fiche_head($head, 'suppliers', $titre, -1, $picto);

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = "fk_product_type = ".((int) $object->type);

$shownav = 1;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/product/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,11 +848,11 @@
$params['forcenohideoftext'] = 1;
}

if ($type === "" || $type == Product::TYPE_PRODUCT) {
if ((isModEnabled('product') && $type === "") || $type == Product::TYPE_PRODUCT) {
$label = 'NewProduct';
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params);
}
if ($type === "" || $type == Product::TYPE_SERVICE) {
if ((isModEnabled('service') && $type === "") || $type == Product::TYPE_SERVICE) {
$label = 'NewService';
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=1', '', $perm, $params);
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/note.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

print dol_get_fiche_head($head, 'note', $titre, -1, $picto);

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = "fk_product_type = ".((int) $object->type);

$shownav = 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/price.php
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@

print dol_get_fiche_head($head, 'price', $titre, -1, $picto);

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter = "fk_product_type = ".((int) $object->type);

$shownav = 1;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stats/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

print dol_get_fiche_head($head, 'stats', $titre, -1, $picto);

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';

dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', '', '', '', 0, '', '', 1);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stats/facture.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';

$shownav = 1;
if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@

dol_htmloutput_events();

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';

$shownav = 1;
if ($user->socid && !in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/traduction.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@

print dol_get_fiche_head($head, 'translation', $titre, 0, $picto);

$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';

$shownav = 1;
if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
Expand Down

0 comments on commit 5378c85

Please sign in to comment.