Fix: more compatible with alternative path

Fix: uniformize code
This commit is contained in:
Regis Houssin
2010-12-19 11:05:07 +00:00
parent 749b9c333e
commit 17df30b7fa
19 changed files with 142 additions and 112 deletions

View File

@@ -63,9 +63,7 @@ function print_auguria_menu($db,$atarget,$type_user)
} }
else else
{ {
preg_match('/^([^<]+\.php)/i',$tabMenu[$i]['url'],$regs); dol_file_exists($tabMenu[$i]['url'],1);
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.$tabMenu[$i]['url'])) $url=DOL_URL_ROOT_ALT.$tabMenu[$i]['url'];
if (! preg_match('/\?/',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&'; else $url.='&';
if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
@@ -277,9 +275,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
} }
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser. // Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
preg_match('/^([^<]+\.php)/i',$menu_array[$i]['url'],$regs); dol_files_exists($menu_array[$i]['url'],1);
$url=DOL_URL_ROOT.$menu_array[$i]['url'];
if (DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.$regs[1])) $url=DOL_URL_ROOT_ALT.$menu_array[$i]['url'];
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url'])) if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
{ {

View File

@@ -453,8 +453,7 @@ function print_eldy_menu($db,$atarget,$type_user)
} }
else else
{ {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $url=dol_file_exists($tabMenu[$i]['url'],1);
if (DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.$tabMenu[$i]['url'])) $url=DOL_URL_ROOT_ALT.$tabMenu[$i]['url'];
if (! preg_match('/\?/',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&'; else $url.='&';
if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
@@ -1386,9 +1385,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
} }
// For external modules // For external modules
preg_match('/^([^<]+\.php)/i',$menu_array[$i]['url'],$regs); $url = dol_file_exists($menu_array[$i]['url'], 1);
$url=DOL_URL_ROOT.$menu_array[$i]['url'];
if (DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.$regs[1])) $url=DOL_URL_ROOT_ALT.$menu_array[$i]['url'];
// Menu niveau 0 // Menu niveau 0
if ($menu_array[$i]['level'] == 0) if ($menu_array[$i]['level'] == 0)

View File

@@ -122,7 +122,7 @@ function societe_prepare_head($objsoc)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$objsoc->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -79,7 +79,7 @@ function contact_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$object->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -24,33 +24,33 @@
\version $Id$ \version $Id$
*/ */
function contract_prepare_head($contrat) function contract_prepare_head($object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/contrat/fiche.php?id='.$contrat->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("ContractCard"); $head[$h][1] = $langs->trans("ContractCard");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$contrat->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans("ContractContacts"); $head[$h][1] = $langs->trans("ContractContacts");
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$contrat->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note"); $head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$contrat->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents"); $head[$h][1] = $langs->trans("Documents");
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$contrat->id; $head[$h][0] = DOL_URL_ROOT.'/contrat/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -65,7 +65,7 @@ function contract_prepare_head($contrat)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$contrat->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -27,7 +27,7 @@
* Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function fichinter_prepare_head($fichinter) function fichinter_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$langs->load("fichinter"); $langs->load("fichinter");
@@ -35,35 +35,35 @@ function fichinter_prepare_head($fichinter)
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fichinter/fiche.php?id='.$fichinter->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$fichinter->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('InterventionContact'); $head[$h][1] = $langs->trans('InterventionContact');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
if ($conf->use_preview_tabs) if ($conf->use_preview_tabs)
{ {
$head[$h][0] = DOL_URL_ROOT.'/fichinter/apercu.php?id='.$fichinter->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/apercu.php?id='.$object->id;
$head[$h][1] = $langs->trans('Preview'); $head[$h][1] = $langs->trans('Preview');
$head[$h][2] = 'preview'; $head[$h][2] = 'preview';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$fichinter->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$fichinter->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents"); $head[$h][1] = $langs->trans("Documents");
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/info.php?id='.$fichinter->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info'); $head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -78,7 +78,7 @@ function fichinter_prepare_head($fichinter)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$fichinter->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -24,28 +24,28 @@
* \version $Id$ * \version $Id$
*/ */
function facturefourn_prepare_head($fac) function facturefourn_prepare_head($object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Card'); $head[$h][1] = $langs->trans('Card');
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('BillContacts'); $head[$h][1] = $langs->trans('BillContacts');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id;
/*$filesdir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($fac->id,2).$fac->id; /*$filesdir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($fac->id,2).$fac->id;
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$listoffiles=dol_dir_list($filesdir,'files',1); $listoffiles=dol_dir_list($filesdir,'files',1);
@@ -54,7 +54,7 @@ function facturefourn_prepare_head($fac)
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/info.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/info.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Info'); $head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -69,7 +69,7 @@ function facturefourn_prepare_head($fac)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$fac->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;
@@ -80,13 +80,13 @@ function facturefourn_prepare_head($fac)
} }
function ordersupplier_prepare_head($commande) function ordersupplier_prepare_head($object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("OrderCard"); $head[$h][1] = $langs->trans("OrderCard");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@@ -94,23 +94,23 @@ function ordersupplier_prepare_head($commande)
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
{ {
$langs->load("stocks"); $langs->load("stocks");
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
$head[$h][1] = $langs->trans("OrderDispatch"); $head[$h][1] = $langs->trans("OrderDispatch");
$head[$h][2] = 'dispatch'; $head[$h][2] = 'dispatch';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('OrderContact'); $head[$h][1] = $langs->trans('OrderContact');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Notes"); $head[$h][1] = $langs->trans("Notes");
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id;
/*$filesdir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref); /*$filesdir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref);
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$listoffiles=dol_dir_list($filesdir,'files',1); $listoffiles=dol_dir_list($filesdir,'files',1);
@@ -119,7 +119,7 @@ function ordersupplier_prepare_head($commande)
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$object->id;
$head[$h][1] = $langs->trans("OrderFollow"); $head[$h][1] = $langs->trans("OrderFollow");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -134,7 +134,7 @@ function ordersupplier_prepare_head($commande)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$commande->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -74,6 +74,43 @@ function dol_include_once($relpath)
return $res; return $res;
} }
/**
* Make an require_once using default root and alternate root if it fails.
* @param relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...)
* @return int Result
*/
function dol_require_once($relpath)
{
$res=@require_once(DOL_DOCUMENT_ROOT.$relpath);
if (! $res && defined('DOL_DOCUMENT_ROOT_ALT')) $res=@require_once(DOL_DOCUMENT_ROOT_ALT.$relpath);
return $res;
}
/**
* Make an file_exists using default root and alternate root if it fails.
* @param path Relative or absolute path to file (Ie: mydir/myfile, ../myfile, ...)
* @return int Result
*/
function dol_file_exists($path,$absolute=0)
{
$res='';
if ($absolute)
{
preg_match('/^([^<]+\.php)/i',$path,$regs);
$path = (! empty($regs[1]) ? $regs[1] : $path);
$res=DOL_URL_ROOT.$path;
if (defined('DOL_URL_ROOT_ALT') && ! file_exists(DOL_DOCUMENT_ROOT.$path)) $url=DOL_URL_ROOT_ALT.$path;
}
else
{
$res = DOL_DOCUMENT_ROOT.$path;
if (defined('DOL_DOCUMENT_ROOT_ALT') && ! file_exists(DOL_DOCUMENT_ROOT.$path)) $res = DOL_DOCUMENT_ROOT_ALT.$path;
}
return $res;
}
/** /**
* Create a clone of instance of object (new instance with same properties) * Create a clone of instance of object (new instance with same properties)
* This function works for both PHP4 and PHP5. * This function works for both PHP4 and PHP5.

View File

@@ -26,25 +26,25 @@
* Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function facture_prepare_head($fac) function facture_prepare_head($object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$object->id;
$head[$h][1] = $langs->trans('CardBill'); $head[$h][1] = $langs->trans('CardBill');
$head[$h][2] = 'compta'; $head[$h][2] = 'compta';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('BillContacts'); $head[$h][1] = $langs->trans('BillContacts');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
if ($conf->use_preview_tabs) if ($conf->use_preview_tabs)
{ {
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Preview'); $head[$h][1] = $langs->trans('Preview');
$head[$h][2] = 'preview'; $head[$h][2] = 'preview';
$h++; $h++;
@@ -53,18 +53,18 @@ function facture_prepare_head($fac)
//if ($fac->mode_reglement_code == 'PRE') //if ($fac->mode_reglement_code == 'PRE')
if ($conf->prelevement->enabled) if ($conf->prelevement->enabled)
{ {
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id;
$head[$h][1] = $langs->trans('StandingOrders'); $head[$h][1] = $langs->trans('StandingOrders');
$head[$h][2] = 'standingorders'; $head[$h][2] = 'standingorders';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id;
/*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref); /*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref);
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$listoffiles=dol_dir_list($filesdir,'files',1); $listoffiles=dol_dir_list($filesdir,'files',1);
@@ -73,7 +73,7 @@ function facture_prepare_head($fac)
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$object->id;
$head[$h][1] = $langs->trans('Info'); $head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -88,7 +88,7 @@ function facture_prepare_head($fac)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$fac->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -25,14 +25,14 @@
* Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function member_prepare_head($member) function member_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$member->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("MemberCard"); $head[$h][1] = $langs->trans("MemberCard");
$head[$h][2] = 'general'; $head[$h][2] = 'general';
$h++; $h++;
@@ -41,7 +41,7 @@ function member_prepare_head($member)
{ {
$langs->load("ldap"); $langs->load("ldap");
$head[$h][0] = DOL_URL_ROOT.'/adherents/ldap.php?id='.$member->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/ldap.php?id='.$object->id;
$head[$h][1] = $langs->trans("LDAPCard"); $head[$h][1] = $langs->trans("LDAPCard");
$head[$h][2] = 'ldap'; $head[$h][2] = 'ldap';
$h++; $h++;
@@ -49,7 +49,7 @@ function member_prepare_head($member)
if ($user->rights->adherent->cotisation->lire) if ($user->rights->adherent->cotisation->lire)
{ {
$head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$member->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Subscriptions"); $head[$h][1] = $langs->trans("Subscriptions");
$head[$h][2] = 'subscription'; $head[$h][2] = 'subscription';
$h++; $h++;
@@ -58,23 +58,23 @@ function member_prepare_head($member)
// Show category tab // Show category tab
if ($conf->categorie->enabled && $user->rights->categorie->lire) if ($conf->categorie->enabled && $user->rights->categorie->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$member->id.'&type=3'; $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3';
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category'; $head[$h][2] = 'category';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$member->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note"); $head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$member->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents"); $head[$h][1] = $langs->trans("Documents");
$head[$h][2] = 'document'; $head[$h][2] = 'document';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$member->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -89,7 +89,7 @@ function member_prepare_head($member)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$member->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -27,7 +27,7 @@
* \version $Id$ * \version $Id$
*/ */
function commande_prepare_head($commande) function commande_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
if ($conf->expedition->enabled) $langs->load("sendings"); if ($conf->expedition->enabled) $langs->load("sendings");
@@ -38,7 +38,7 @@ function commande_prepare_head($commande)
if ($conf->commande->enabled && $user->rights->commande->lire) if ($conf->commande->enabled && $user->rights->commande->lire)
{ {
$head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("OrderCard"); $head[$h][1] = $langs->trans("OrderCard");
$head[$h][2] = 'order'; $head[$h][2] = 'order';
$h++; $h++;
@@ -47,7 +47,7 @@ function commande_prepare_head($commande)
if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) if (($conf->expedition_bon->enabled && $user->rights->expedition->lire)
|| ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire))
{ {
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings"); if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings");
if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings"); if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings");
$head[$h][1] = $text; $head[$h][1] = $text;
@@ -66,18 +66,18 @@ function commande_prepare_head($commande)
*/ */
if ($conf->use_preview_tabs) if ($conf->use_preview_tabs)
{ {
$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$object->id;
$head[$h][1] = $langs->trans("Preview"); $head[$h][1] = $langs->trans("Preview");
$head[$h][2] = 'preview'; $head[$h][2] = 'preview';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('OrderContact'); $head[$h][1] = $langs->trans('OrderContact');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
/*$filesdir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref); /*$filesdir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref);
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$listoffiles=dol_dir_list($filesdir,'files',1); $listoffiles=dol_dir_list($filesdir,'files',1);
@@ -86,12 +86,12 @@ function commande_prepare_head($commande)
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id; $head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$object->id;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -106,7 +106,7 @@ function commande_prepare_head($commande)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$commande->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -32,7 +32,7 @@
* @param prelevement class BonPrelevement * @param prelevement class BonPrelevement
* @return array head * @return array head
*/ */
function prelevement_prepare_head($prelevement) function prelevement_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$langs->load("withdrawals"); $langs->load("withdrawals");
@@ -40,35 +40,35 @@ function prelevement_prepare_head($prelevement)
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$prelevement->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'prelevement'; $head[$h][2] = 'prelevement';
$h++; $h++;
if ($conf->use_preview_tabs) if ($conf->use_preview_tabs)
{ {
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$prelevement->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$object->id;
$head[$h][1] = $langs->trans("Preview"); $head[$h][1] = $langs->trans("Preview");
$head[$h][2] = 'preview'; $head[$h][2] = 'preview';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$prelevement->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$object->id;
$head[$h][1] = $langs->trans("Lines"); $head[$h][1] = $langs->trans("Lines");
$head[$h][2] = 'lines'; $head[$h][2] = 'lines';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$prelevement->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$object->id;
$head[$h][1] = $langs->trans("Bills"); $head[$h][1] = $langs->trans("Bills");
$head[$h][2] = 'invoices'; $head[$h][2] = 'invoices';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-rejet.php?id='.$prelevement->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-rejet.php?id='.$object->id;
$head[$h][1] = $langs->trans("Rejects"); $head[$h][1] = $langs->trans("Rejects");
$head[$h][2] = 'rejects'; $head[$h][2] = 'rejects';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$prelevement->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$object->id;
$head[$h][1] = $langs->trans("Statistics"); $head[$h][1] = $langs->trans("Statistics");
$head[$h][2] = 'statistics'; $head[$h][2] = 'statistics';
$h++; $h++;
@@ -83,7 +83,7 @@ function prelevement_prepare_head($prelevement)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$propal->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -28,7 +28,7 @@
* Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function product_prepare_head($product, $user) function product_prepare_head($object, $user)
{ {
global $langs, $conf; global $langs, $conf;
$langs->load("products"); $langs->load("products");
@@ -36,25 +36,25 @@ function product_prepare_head($product, $user)
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
$head[$h][1] = $langs->trans("CustomerPrices"); $head[$h][1] = $langs->trans("CustomerPrices");
$head[$h][2] = 'price'; $head[$h][2] = 'price';
$h++; $h++;
if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
$head[$h][1] = $langs->trans("SuppliersPrices"); $head[$h][1] = $langs->trans("SuppliersPrices");
$head[$h][2] = 'suppliers'; $head[$h][2] = 'suppliers';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$object->id;
$head[$h][1] = $langs->trans("Photos"); $head[$h][1] = $langs->trans("Photos");
$head[$h][2] = 'photos'; $head[$h][2] = 'photos';
$h++; $h++;
@@ -62,7 +62,7 @@ function product_prepare_head($product, $user)
// Show category tab // Show category tab
if ($conf->categorie->enabled && $user->rights->categorie->lire) if ($conf->categorie->enabled && $user->rights->categorie->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$product->id.'&type=0'; $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=0';
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category'; $head[$h][2] = 'category';
$h++; $h++;
@@ -71,7 +71,7 @@ function product_prepare_head($product, $user)
// Show barcode tab // Show barcode tab
if ($conf->global->MAIN_MODULE_BARCODE && $user->rights->barcode->lire) if ($conf->global->MAIN_MODULE_BARCODE && $user->rights->barcode->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$object->id;
$head[$h][1] = $langs->trans("BarCode"); $head[$h][1] = $langs->trans("BarCode");
$head[$h][2] = 'barcode'; $head[$h][2] = 'barcode';
$h++; $h++;
@@ -80,7 +80,7 @@ function product_prepare_head($product, $user)
// Multilangs // Multilangs
if($conf->global->MAIN_MULTILANGS) if($conf->global->MAIN_MULTILANGS)
{ {
$head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id;
$head[$h][1] = $langs->trans("Translation"); $head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation'; $head[$h][2] = 'translation';
$h++; $h++;
@@ -89,32 +89,32 @@ function product_prepare_head($product, $user)
// Sub products // Sub products
if($conf->global->PRODUIT_SOUSPRODUITS) if($conf->global->PRODUIT_SOUSPRODUITS)
{ {
$head[$h][0] = DOL_URL_ROOT."/product/composition/fiche.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/composition/fiche.php?id=".$object->id;
$head[$h][1] = $langs->trans('AssociatedProducts'); $head[$h][1] = $langs->trans('AssociatedProducts');
$head[$h][2] = 'subproduct'; $head[$h][2] = 'subproduct';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$object->id;
$head[$h][1] = $langs->trans('Statistics'); $head[$h][1] = $langs->trans('Statistics');
$head[$h][2] = 'stats'; $head[$h][2] = 'stats';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$object->id;
$head[$h][1] = $langs->trans('Referers'); $head[$h][1] = $langs->trans('Referers');
$head[$h][2] = 'referers'; $head[$h][2] = 'referers';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id; $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents'); $head[$h][1] = $langs->trans('Documents');
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;
if($product->isproduct()) // Si produit stockable if($object->isproduct()) // Si produit stockable
{ {
if ($conf->stock->enabled && $user->rights->stock->lire) if ($conf->stock->enabled && $user->rights->stock->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
$head[$h][1] = $langs->trans("Stock"); $head[$h][1] = $langs->trans("Stock");
$head[$h][2] = 'stock'; $head[$h][2] = 'stock';
$h++; $h++;
@@ -131,7 +131,7 @@ function product_prepare_head($product, $user)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$product->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;
@@ -139,9 +139,9 @@ function product_prepare_head($product, $user)
} }
// More tabs from canvas // More tabs from canvas
if (is_array($product->onglets)) if (is_array($object->onglets))
{ {
foreach ($product->onglets as $onglet) foreach ($object->onglets as $onglet)
{ {
$head[$h] = $onglet; $head[$h] = $onglet;
$h++; $h++;

View File

@@ -76,7 +76,7 @@ function project_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$object->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;
@@ -156,7 +156,7 @@ function task_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$objsoc->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -27,7 +27,7 @@
* Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include
*/ */
function propal_prepare_head($propal) function propal_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$langs->load("propal"); $langs->load("propal");
@@ -36,7 +36,7 @@ function propal_prepare_head($propal)
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal.php?id='.$object->id;
$head[$h][1] = $langs->trans('ProposalCard'); $head[$h][1] = $langs->trans('ProposalCard');
$head[$h][2] = 'comm'; $head[$h][2] = 'comm';
$h++; $h++;
@@ -46,7 +46,7 @@ function propal_prepare_head($propal)
|| ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)))) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire))))
{ {
$langs->load("sendings"); $langs->load("sendings");
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings"); if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings");
if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings"); if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings");
$head[$h][1] = $text; $head[$h][1] = $text;
@@ -61,23 +61,23 @@ function propal_prepare_head($propal)
*/ */
if ($conf->use_preview_tabs) if ($conf->use_preview_tabs)
{ {
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?id='.$object->id;
$head[$h][1] = $langs->trans("Preview"); $head[$h][1] = $langs->trans("Preview");
$head[$h][2] = 'preview'; $head[$h][2] = 'preview';
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ProposalContact'); $head[$h][1] = $langs->trans('ProposalContact');
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes'); $head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id;
/*$filesdir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref); /*$filesdir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref);
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$listoffiles=dol_dir_list($filesdir,'files',1); $listoffiles=dol_dir_list($filesdir,'files',1);
@@ -86,7 +86,7 @@ function propal_prepare_head($propal)
$head[$h][2] = 'document'; $head[$h][2] = 'document';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?id='.$propal->id; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info'); $head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
@@ -101,7 +101,7 @@ function propal_prepare_head($propal)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$propal->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -59,7 +59,7 @@ function shipping_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$commande->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;
@@ -102,7 +102,7 @@ function delivery_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$commande->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -80,7 +80,7 @@ function stock_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$object->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -97,7 +97,7 @@ function user_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$object->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;
@@ -153,7 +153,7 @@ function group_prepare_head($object)
{ {
$values=explode(':',$value); $values=explode(':',$value);
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = DOL_URL_ROOT . preg_replace('/__ID__/i',$object->id,$values[3]); $head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@@ -843,7 +843,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{ {
foreach($conf->css_modules as $cssfile) foreach($conf->css_modules as $cssfile)
{ // cssfile is an absolute path { // cssfile is an absolute path
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.$cssfile.'?lang='.$langs->defaultlang.'&theme='.$conf->theme.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n"; print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_file_exists($cssfile,1).'?lang='.$langs->defaultlang.'&theme='.$conf->theme.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
} }
} }
// CSS forced by page in top_htmlhead call (relative url starting with /) // CSS forced by page in top_htmlhead call (relative url starting with /)