diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 88cb39bd7a948e10a45fa1974a2a5e9dabc262cd..90938242f5f30514632e6771b652d663f8c850e5 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -38,6 +38,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; $langs->load('bills'); $langs->load('compta'); @@ -1109,11 +1110,7 @@ else $author = new User($db); $author->fetch($object->user_author); - $head=array(); - $h=0; - $head[$h][0] = $_SERVER["PHP_SELF"].'?id='.$object->id; - $head[$h][1] = $langs->trans("CardBill"); - $head[$h][2] = 'card'; + $head=invoice_rec_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("RepeatableInvoice"),0,'bill'); // Add a div diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 6e5640d1e0af91e4cc7b2b437c1de09d49fda4db..564e909a2da96f83162646526f1aaad1831d2a46 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -157,4 +158,27 @@ function invoice_admin_prepare_head() } +function invoice_rec_prepare_head($object) +{ + global $db, $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?id='.$object->id; + $head[$h][1] = $langs->trans("CardBill"); + $head[$h][2] = 'card'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec'); + + complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec','remove'); + + return $head; +} +