Removed duplicate code.
Prepare dynamic disabling of modules
This commit is contained in:
parent
030c18f1ef
commit
dc46ba4000
@ -14,173 +14,170 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/admin/import/dolibarrimport.class.php
|
* \file htdocs/admin/import/dolibarrimport.class.php
|
||||||
\ingroup import
|
* \ingroup import
|
||||||
\brief Fichier de la classe des imports
|
* \brief Fichier de la classe des imports
|
||||||
\version $Revision$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class DolibarrImport
|
* \class DolibarrImport
|
||||||
\brief Classe permettant la gestion des imports
|
* \brief Classe permettant la gestion des imports
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class DolibarrImport
|
class DolibarrImport
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur de la classe
|
* \brief Constructeur de la classe
|
||||||
* \param DB Handler accès base de données
|
* \param DB Handler accès base de données
|
||||||
*/
|
*/
|
||||||
function DolibarrImport($DB)
|
function DolibarrImport($DB)
|
||||||
{
|
{
|
||||||
$this->db=$DB;
|
$this->db=$DB;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
\brief Importe un fichier clients
|
\brief Importe un fichier clients
|
||||||
*/
|
*/
|
||||||
function ImportClients($file)
|
function ImportClients($file)
|
||||||
{
|
{
|
||||||
$this->nb_import_ok = 0;
|
$this->nb_import_ok = 0;
|
||||||
$this->nb_import_ko = 0;
|
$this->nb_import_ko = 0;
|
||||||
$this->nb_import = 0;
|
$this->nb_import = 0;
|
||||||
|
|
||||||
dolibarr_syslog("DolibarrImport::ImportClients($file)", LOG_DEBUG);
|
dolibarr_syslog("DolibarrImport::ImportClients($file)", LOG_DEBUG);
|
||||||
|
|
||||||
$this->ReadFile($file);
|
$this->ReadFile($file);
|
||||||
|
|
||||||
foreach ($this->lines as $this->line)
|
foreach ($this->lines as $this->line)
|
||||||
{
|
{
|
||||||
$societe = new Societe($this->db);
|
$societe = new Societe($this->db);
|
||||||
|
|
||||||
$this->SetInfosTiers($societe);
|
$this->SetInfosTiers($societe);
|
||||||
|
|
||||||
$societe->client = 1;
|
$societe->client = 1;
|
||||||
$societe->tva_assuj = $this->line[12];
|
$societe->tva_assuj = $this->line[12];
|
||||||
$societe->code_client = $this->line[13];
|
$societe->code_client = $this->line[13];
|
||||||
$societe->tva_intra = $this->line[14];
|
$societe->tva_intra = $this->line[14];
|
||||||
|
|
||||||
$this->nb_import++;
|
$this->nb_import++;
|
||||||
|
|
||||||
if ( $societe->create($user) == 0)
|
if ( $societe->create($user) == 0)
|
||||||
{
|
{
|
||||||
dolibarr_syslog("DolibarrImport::ImportClients ".$societe->nom." SUCCESS", LOG_DEBUG);
|
dolibarr_syslog("DolibarrImport::ImportClients ".$societe->nom." SUCCESS", LOG_DEBUG);
|
||||||
$this->nb_import_ok++;
|
$this->nb_import_ok++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("DolibarrImport::ImportClients ".$societe->nom." ERROR", LOG_ERR);
|
dolibarr_syslog("DolibarrImport::ImportClients ".$societe->nom." ERROR", LOG_ERR);
|
||||||
$this->nb_import_ko++;
|
$this->nb_import_ko++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function SetInfosTiers(&$obj)
|
function SetInfosTiers(&$obj)
|
||||||
{
|
{
|
||||||
$obj->nom = $this->line[0];
|
$obj->nom = $this->line[0];
|
||||||
$obj->adresse = $this->line[1];
|
$obj->adresse = $this->line[1];
|
||||||
|
|
||||||
if (strlen(trim($this->line[2])) > 0)
|
if (strlen(trim($this->line[2])) > 0)
|
||||||
$obj->adresse .= "\n". trim($this->line[2]);
|
$obj->adresse .= "\n". trim($this->line[2]);
|
||||||
|
|
||||||
if (strlen(trim($this->line[3])) > 0)
|
if (strlen(trim($this->line[3])) > 0)
|
||||||
$obj->adresse .= "\n". trim($this->line[3]);
|
$obj->adresse .= "\n". trim($this->line[3]);
|
||||||
|
|
||||||
$obj->cp = $this->line[4];
|
$obj->cp = $this->line[4];
|
||||||
$obj->ville = $this->line[5];
|
$obj->ville = $this->line[5];
|
||||||
$obj->tel = $this->line[6];
|
$obj->tel = $this->line[6];
|
||||||
$obj->fax = $this->line[7];
|
$obj->fax = $this->line[7];
|
||||||
$obj->email = $this->line[8];
|
$obj->email = $this->line[8];
|
||||||
$obj->url = $this->line[9];
|
$obj->url = $this->line[9];
|
||||||
$obj->siren = $this->line[10];
|
$obj->siren = $this->line[10];
|
||||||
$obj->siret = $this->line[11];
|
$obj->siret = $this->line[11];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ReadFile($file)
|
function ReadFile($file)
|
||||||
{
|
{
|
||||||
$this->errno = 0;
|
$this->errno = 0;
|
||||||
|
|
||||||
if (is_readable($file))
|
if (is_readable($file))
|
||||||
{
|
{
|
||||||
dolibarr_syslog("DolibarrImport::ReadFile Lecture du fichier $file", LOG_DEBUG);
|
dolibarr_syslog("DolibarrImport::ReadFile Lecture du fichier $file", LOG_DEBUG);
|
||||||
|
|
||||||
$line = 0;
|
$line = 0;
|
||||||
$hf = fopen ($file, "r");
|
$hf = fopen ($file, "r");
|
||||||
$line = 0;
|
$line = 0;
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
|
|
||||||
while (!feof($hf) )
|
while (!feof($hf) )
|
||||||
{
|
{
|
||||||
$cont = fgets($hf, 1024);
|
$cont = fgets($hf, 1024);
|
||||||
|
|
||||||
if (strlen(trim($cont)) > 0)
|
if (strlen(trim($cont)) > 0)
|
||||||
{
|
{
|
||||||
$this->lines[$i] = explode(";", $cont);
|
$this->lines[$i] = explode(";", $cont);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->errno = -2;
|
$this->errno = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errno;
|
return $errno;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
\brief Cree le repertoire de backup
|
|
||||||
*/
|
|
||||||
function CreateBackupDir()
|
|
||||||
{
|
|
||||||
$time = time();
|
|
||||||
|
|
||||||
$upload_dir = DOL_DATA_ROOT."/import/";
|
/*
|
||||||
|
\brief Cree le repertoire de backup
|
||||||
|
*/
|
||||||
|
function CreateBackupDir()
|
||||||
|
{
|
||||||
|
$time = time();
|
||||||
|
|
||||||
if (! is_dir($upload_dir))
|
$upload_dir = DOL_DATA_ROOT."/import/";
|
||||||
{
|
|
||||||
umask(0);
|
|
||||||
if (! mkdir($upload_dir, 0755))
|
|
||||||
{
|
|
||||||
dolibarr_syslog("DolibarrImport::ReadFile Impossible de créer $upload_dir",LOG_ERR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$upload_dir = DOL_DATA_ROOT."/import/".strftime("%Y",$time);
|
if (! is_dir($upload_dir))
|
||||||
|
{
|
||||||
|
umask(0);
|
||||||
|
if (! mkdir($upload_dir, 0755))
|
||||||
|
{
|
||||||
|
dolibarr_syslog("DolibarrImport::ReadFile Impossible de créer $upload_dir",LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! is_dir($upload_dir))
|
$upload_dir = DOL_DATA_ROOT."/import/".strftime("%Y",$time);
|
||||||
{
|
|
||||||
umask(0);
|
|
||||||
if (! mkdir($upload_dir, 0755))
|
|
||||||
{
|
|
||||||
dolibarr_syslog("DolibarrImport::ReadFile Impossible de créer $upload_dir",LOG_ERR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$upload_dir = DOL_DATA_ROOT."/import/".strftime("%Y",$time)."/".strftime("%d-%m-%Y",$time);
|
if (! is_dir($upload_dir))
|
||||||
|
{
|
||||||
|
umask(0);
|
||||||
|
if (! mkdir($upload_dir, 0755))
|
||||||
|
{
|
||||||
|
dolibarr_syslog("DolibarrImport::ReadFile Impossible de créer $upload_dir",LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! is_dir($upload_dir))
|
$upload_dir = DOL_DATA_ROOT."/import/".strftime("%Y",$time)."/".strftime("%d-%m-%Y",$time);
|
||||||
{
|
|
||||||
umask(0);
|
|
||||||
if (! mkdir($upload_dir, 0755))
|
|
||||||
{
|
|
||||||
dolibarr_syslog("DolibarrImport::ReadFile Impossible de créer $upload_dir",LOG_ERR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->upload_dir = DOL_DATA_ROOT."/import/".strftime("%Y",$time)."/".strftime("%d-%m-%Y",$time);
|
if (! is_dir($upload_dir))
|
||||||
|
{
|
||||||
|
umask(0);
|
||||||
|
if (! mkdir($upload_dir, 0755))
|
||||||
|
{
|
||||||
|
dolibarr_syslog("DolibarrImport::ReadFile Impossible de créer $upload_dir",LOG_ERR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
$this->upload_dir = DOL_DATA_ROOT."/import/".strftime("%Y",$time)."/".strftime("%d-%m-%Y",$time);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -61,11 +61,11 @@ print "</tr>\n";
|
|||||||
print '</table></form>';
|
print '</table></form>';
|
||||||
|
|
||||||
|
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$imp = new DolibarrImport($db);
|
$imp = new DolibarrImport($db);
|
||||||
$imp->CreateBackupDir();
|
$imp->CreateBackupDir();
|
||||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $imp->upload_dir . "/" . $_FILES['userfile']['name'],1))
|
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $imp->upload_dir . "/" . $_FILES['userfile']['name'],1) > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$imp->ImportClients($imp->upload_dir . "/" . $_FILES['userfile']['name']);
|
$imp->ImportClients($imp->upload_dir . "/" . $_FILES['userfile']['name']);
|
||||||
|
|||||||
@ -76,7 +76,7 @@ function llxHeader($head = "")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled && $user->rights->ficheinter->lire)
|
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
|
||||||
{
|
{
|
||||||
$langs->trans("interventions");
|
$langs->trans("interventions");
|
||||||
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
||||||
|
|||||||
@ -66,7 +66,7 @@ $pagenext = $page + 1;
|
|||||||
/*
|
/*
|
||||||
* Action envoie fichier
|
* Action envoie fichier
|
||||||
*/
|
*/
|
||||||
if ( $_POST["sendit"] && $conf->upload )
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Creation répertoire si n'existe pas
|
* Creation répertoire si n'existe pas
|
||||||
|
|||||||
@ -41,7 +41,7 @@ $langs->load("companies");
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
if ($conf->fichinter->enabled) $langs->load("interventions");
|
if ($conf->ficheinter->enabled) $langs->load("interventions");
|
||||||
if (!empty($conf->global->MAIN_MODULE_CHRONODOCS)) $langs->load("chronodocs");
|
if (!empty($conf->global->MAIN_MODULE_CHRONODOCS)) $langs->load("chronodocs");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -506,7 +506,7 @@ if ($socid > 0)
|
|||||||
/*
|
/*
|
||||||
* Dernieres interventions
|
* Dernieres interventions
|
||||||
*/
|
*/
|
||||||
if ($conf->fichinter->enabled)
|
if ($conf->ficheinter->enabled)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
@ -652,7 +652,7 @@ if ($socid > 0)
|
|||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$objsoc->id.'&action=create">'.$langs->trans("AddContract").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$objsoc->id.'&action=create">'.$langs->trans("AddContract").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled && $user->rights->ficheinter->creer)
|
if ($conf->ficheinter->enabled && $user->rights->ficheinter->creer)
|
||||||
{
|
{
|
||||||
$langs->load("fichinter");
|
$langs->load("fichinter");
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$objsoc->id.'&action=create">'.$langs->trans("AddIntervention").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$objsoc->id.'&action=create">'.$langs->trans("AddIntervention").'</a>';
|
||||||
|
|||||||
@ -88,7 +88,7 @@ function llxHeader($head = "", $title = "")
|
|||||||
$menu->add(DOL_URL_ROOT."/comm/mailing/", $langs->trans("EMailings"));
|
$menu->add(DOL_URL_ROOT."/comm/mailing/", $langs->trans("EMailings"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled && $user->rights->ficheinter->lire)
|
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
|
||||||
{
|
{
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
||||||
|
|||||||
@ -66,7 +66,7 @@ $pagenext = $page + 1;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && $conf->upload)
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ function llxHeader($head = "", $urlp = "") {
|
|||||||
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
|
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled )
|
if ($conf->ficheinter->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
||||||
|
|||||||
@ -88,7 +88,7 @@ function llxHeader($head = "", $urlp = "")
|
|||||||
$menu->add(DOL_URL_ROOT."/comm/mailing/", $langs->trans("EMailings"));
|
$menu->add(DOL_URL_ROOT."/comm/mailing/", $langs->trans("EMailings"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled )
|
if ($conf->ficheinter->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
||||||
|
|||||||
@ -72,7 +72,7 @@ if (!$commande->fetch($id)) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && $conf->upload)
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->commande->dir_output . "/" . sanitizeFileName($commande->ref);
|
$upload_dir = $conf->commande->dir_output . "/" . sanitizeFileName($commande->ref);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|||||||
@ -19,10 +19,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/commande/fiche.php
|
* \file htdocs/compta/commande/fiche.php
|
||||||
\ingroup commande
|
* \ingroup commande
|
||||||
\brief Fiche commande
|
* \brief Fiche commande
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -206,7 +206,7 @@ if ($_GET["id"] > 0)
|
|||||||
print '<tr><td>'.$langs->trans('Date').'</td>';
|
print '<tr><td>'.$langs->trans('Date').'</td>';
|
||||||
print '<td colspan="2">'.dolibarr_print_date($commande->date,'daytext').'</td>';
|
print '<td colspan="2">'.dolibarr_print_date($commande->date,'daytext').'</td>';
|
||||||
print '<td width="50%">'.$langs->trans('Source').' : '.$commande->getLabelSource();
|
print '<td width="50%">'.$langs->trans('Source').' : '.$commande->getLabelSource();
|
||||||
if ($commande->source == 0)
|
if ($commande->source == 0 && $conf->propal->enabled)
|
||||||
{
|
{
|
||||||
// Si source = propal
|
// Si source = propal
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $pagenext = $page + 1;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && $conf->upload)
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$facture = new Facture($db);
|
$facture = new Facture($db);
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
|
|||||||
@ -33,14 +33,13 @@
|
|||||||
\brief Classe de stockage de la config courante
|
\brief Classe de stockage de la config courante
|
||||||
\todo Deplacer ce fichier dans htdocs/lib
|
\todo Deplacer ce fichier dans htdocs/lib
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Conf
|
class Conf
|
||||||
{
|
{
|
||||||
/** \public */
|
/** \public */
|
||||||
//! Objet des caracteristiques de connexions
|
//! Object with database handler
|
||||||
var $db;
|
var $db;
|
||||||
//! Charset for HTML output
|
//! Charset for HTML output
|
||||||
var $character_set_client; // ISO-8859-1, UTF8
|
var $character_set_client; // UTF8, ISO-8859-1
|
||||||
|
|
||||||
var $externalrss;
|
var $externalrss;
|
||||||
var $commande;
|
var $commande;
|
||||||
@ -84,7 +83,7 @@ class Conf
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition de toutes les Constantes globales d'environnement
|
* Definition de toutes les Constantes globales d'environnement
|
||||||
* - En constante php (\todo a virer)
|
* - En constante php (\TODO a virer)
|
||||||
* - En $this->global->key=value
|
* - En $this->global->key=value
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const";
|
$sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const";
|
||||||
@ -104,7 +103,16 @@ class Conf
|
|||||||
if (! defined("$key")) define ("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE during install)
|
if (! defined("$key")) define ("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE during install)
|
||||||
$this->global->$key=$value;
|
$this->global->$key=$value;
|
||||||
// If this is constant for a css file activated by a module
|
// If this is constant for a css file activated by a module
|
||||||
if (eregi('MAIN_MODULE_([A-Z_]+)_CSS',$key)) $this->css_modules[]=$value;
|
if (eregi('^MAIN_MODULE_([A-Z_]+)_CSS$',$key) && $value)
|
||||||
|
{
|
||||||
|
$this->css_modules[]=$value;
|
||||||
|
}
|
||||||
|
if (eregi('^MAIN_MODULE_([A-Z]+)$',$key,$reg) && $value)
|
||||||
|
{
|
||||||
|
$module=strtolower($reg[1]);
|
||||||
|
//print "Module ".$module." is enabled<br>\n";
|
||||||
|
$this->$module->enabled=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -116,10 +124,8 @@ class Conf
|
|||||||
// \TODO Mettre tous les param de conf DB dans une propriete de la classe
|
// \TODO Mettre tous les param de conf DB dans une propriete de la classe
|
||||||
|
|
||||||
|
|
||||||
/*
|
// Nettoyage variables des gestionnaires de menu
|
||||||
* Nettoyage variables des gestionnaires de menu
|
// conf->menu_top et conf->menu_left sont definis dans main.inc.php (selon user)
|
||||||
* conf->menu_top et conf->menu_left sont definis dans main.inc.php (selon user)
|
|
||||||
*/
|
|
||||||
if (! $this->global->MAIN_MENU_BARRETOP) $this->global->MAIN_MENU_BARRETOP="eldy_backoffice.php";
|
if (! $this->global->MAIN_MENU_BARRETOP) $this->global->MAIN_MENU_BARRETOP="eldy_backoffice.php";
|
||||||
if (! $this->global->MAIN_MENUFRONT_BARRETOP) $this->global->MAIN_MENUFRONT_BARRETOP="eldy_backoffice.php";
|
if (! $this->global->MAIN_MENUFRONT_BARRETOP) $this->global->MAIN_MENUFRONT_BARRETOP="eldy_backoffice.php";
|
||||||
if (! $this->global->MAIN_MENU_BARRELEFT) $this->global->MAIN_MENU_BARRELEFT="eldy_backoffice.php";
|
if (! $this->global->MAIN_MENU_BARRELEFT) $this->global->MAIN_MENU_BARRELEFT="eldy_backoffice.php";
|
||||||
@ -133,56 +139,32 @@ class Conf
|
|||||||
if (! isset($this->global->LDAP_KEY_MEMBERS)) $this->global->LDAP_KEY_MEMBERS=$this->global->LDAP_FIELD_FULLNAME;
|
if (! isset($this->global->LDAP_KEY_MEMBERS)) $this->global->LDAP_KEY_MEMBERS=$this->global->LDAP_FIELD_FULLNAME;
|
||||||
|
|
||||||
|
|
||||||
/*
|
// Load translation object with current language
|
||||||
* Charge l'objet de traduction et positionne langage courant global
|
|
||||||
*/
|
|
||||||
if (empty($this->global->MAIN_LANG_DEFAULT)) $this->global->MAIN_LANG_DEFAULT="en_US";
|
if (empty($this->global->MAIN_LANG_DEFAULT)) $this->global->MAIN_LANG_DEFAULT="en_US";
|
||||||
|
|
||||||
/*
|
// Other global parameters
|
||||||
* Autres parametres globaux de configurations
|
|
||||||
*/
|
|
||||||
$this->users->dir_output=DOL_DATA_ROOT."/users";
|
$this->users->dir_output=DOL_DATA_ROOT."/users";
|
||||||
|
|
||||||
/*
|
// For backward compatibility
|
||||||
* Autorisation globale d'uploader (necessaire pour desactiver dans la demo)
|
$this->comptaexpert->enabled=defined("MAIN_MODULE_COMPTABILITE_EXPERT")?MAIN_MODULE_COMPTABILITE_EXPERT:0;
|
||||||
* conf->upload peut etre ecrasee dans main.inc.php (selon user)
|
$this->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABILITE:0;
|
||||||
*/
|
$this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
|
||||||
$this->upload = $this->global->MAIN_UPLOAD_DOC;
|
$this->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
|
||||||
|
|
||||||
/*
|
|
||||||
* Definition des parametres d'activation de module et dependants des modules
|
|
||||||
* Chargement d'include selon etat activation des modules
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Module agenda
|
// Module agenda
|
||||||
$this->agenda->enabled=defined('MAIN_MODULE_AGENDA')?MAIN_MODULE_AGENDA:0;
|
|
||||||
$this->agenda->dir_temp=DOL_DATA_ROOT."/agenda/temp";
|
$this->agenda->dir_temp=DOL_DATA_ROOT."/agenda/temp";
|
||||||
|
|
||||||
// Module bookmark
|
|
||||||
$this->bookmark->enabled=defined('MAIN_MODULE_BOOKMARK')?MAIN_MODULE_BOOKMARK:0;
|
|
||||||
|
|
||||||
// Module deplacement
|
|
||||||
$this->deplacement->enabled=defined("MAIN_MODULE_DEPLACEMENT")?MAIN_MODULE_DEPLACEMENT:0;
|
|
||||||
|
|
||||||
// Module mailing
|
|
||||||
$this->mailing->enabled=defined("MAIN_MODULE_MAILING")?MAIN_MODULE_MAILING:0;
|
|
||||||
|
|
||||||
// Module notification
|
|
||||||
$this->notification->enabled=defined("MAIN_MODULE_NOTIFICATION")?MAIN_MODULE_NOTIFICATION:0;
|
|
||||||
|
|
||||||
// Module externalrss
|
// Module externalrss
|
||||||
$this->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0;
|
|
||||||
$this->externalrss->dir_temp=DOL_DATA_ROOT."/rss/temp";
|
$this->externalrss->dir_temp=DOL_DATA_ROOT."/rss/temp";
|
||||||
|
|
||||||
// Module commande client
|
// Module commande client
|
||||||
$this->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0;
|
|
||||||
$this->commande->dir_output=DOL_DATA_ROOT."/commande";
|
$this->commande->dir_output=DOL_DATA_ROOT."/commande";
|
||||||
$this->commande->dir_temp =DOL_DATA_ROOT."/commande/temp";
|
$this->commande->dir_temp =DOL_DATA_ROOT."/commande/temp";
|
||||||
|
|
||||||
// Module expeditions
|
// Module expeditions
|
||||||
$this->expedition->enabled=defined("MAIN_MODULE_EXPEDITION")?MAIN_MODULE_EXPEDITION:0;
|
|
||||||
$this->expedition->dir_output=DOL_DATA_ROOT."/expedition";
|
$this->expedition->dir_output=DOL_DATA_ROOT."/expedition";
|
||||||
$this->expedition->dir_temp =DOL_DATA_ROOT."/expedition/temp";
|
$this->expedition->dir_temp =DOL_DATA_ROOT."/expedition/temp";
|
||||||
|
|
||||||
// Sous module bons d'expedition
|
// Sous module bons d'expedition
|
||||||
$this->expedition_bon->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
|
$this->expedition_bon->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
|
||||||
$this->expedition_bon->dir_output=DOL_DATA_ROOT."/expedition/sending";
|
$this->expedition_bon->dir_output=DOL_DATA_ROOT."/expedition/sending";
|
||||||
@ -193,96 +175,62 @@ class Conf
|
|||||||
$this->livraison_bon->dir_temp =DOL_DATA_ROOT."/expedition/receipt/temp";
|
$this->livraison_bon->dir_temp =DOL_DATA_ROOT."/expedition/receipt/temp";
|
||||||
|
|
||||||
// Module societe
|
// Module societe
|
||||||
$this->societe->enabled=defined("MAIN_MODULE_SOCIETE")?MAIN_MODULE_SOCIETE:0;
|
|
||||||
$this->societe->dir_output=DOL_DATA_ROOT."/societe";
|
$this->societe->dir_output=DOL_DATA_ROOT."/societe";
|
||||||
$this->societe->dir_temp =DOL_DATA_ROOT."/societe/temp";
|
$this->societe->dir_temp =DOL_DATA_ROOT."/societe/temp";
|
||||||
$this->societe->dir_logos =DOL_DATA_ROOT."/societe/logos";
|
$this->societe->dir_logos =DOL_DATA_ROOT."/societe/logos";
|
||||||
if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $this->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $this->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
||||||
// Module commercial
|
// Module commercial
|
||||||
$this->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
|
|
||||||
$this->commercial->dir_output=DOL_DATA_ROOT."/comm";
|
$this->commercial->dir_output=DOL_DATA_ROOT."/comm";
|
||||||
$this->commercial->dir_temp =DOL_DATA_ROOT."/comm/temp";
|
$this->commercial->dir_temp =DOL_DATA_ROOT."/comm/temp";
|
||||||
|
|
||||||
// Module taxes et charges sociales
|
// Module taxes et charges sociales
|
||||||
$this->tax->enabled=defined("MAIN_MODULE_TAX")?MAIN_MODULE_TAX:0;
|
|
||||||
$this->tax->dir_output=DOL_DATA_ROOT."/taxes";
|
$this->tax->dir_output=DOL_DATA_ROOT."/taxes";
|
||||||
$this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp";
|
$this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp";
|
||||||
|
|
||||||
// Module comptaexpert
|
// Module comptaexpert
|
||||||
$this->comptaexpert->enabled=defined("MAIN_MODULE_COMPTABILITE_EXPERT")?MAIN_MODULE_COMPTABILITE_EXPERT:0;
|
|
||||||
$this->comptaexpert->dir_output=DOL_DATA_ROOT."/comptaexpert";
|
$this->comptaexpert->dir_output=DOL_DATA_ROOT."/comptaexpert";
|
||||||
$this->comptaexpert->dir_temp =DOL_DATA_ROOT."/comptaexpert/temp";
|
$this->comptaexpert->dir_temp =DOL_DATA_ROOT."/comptaexpert/temp";
|
||||||
// Module compta
|
// Module compta
|
||||||
$this->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABILITE:0;
|
|
||||||
$this->compta->dir_output=DOL_DATA_ROOT."/compta";
|
$this->compta->dir_output=DOL_DATA_ROOT."/compta";
|
||||||
$this->compta->dir_temp =DOL_DATA_ROOT."/compta/temp";
|
$this->compta->dir_temp =DOL_DATA_ROOT."/compta/temp";
|
||||||
// Module banque
|
// Module banque
|
||||||
$this->banque->enabled=defined("MAIN_MODULE_BANQUE")?MAIN_MODULE_BANQUE:0;
|
|
||||||
$this->banque->dir_output=DOL_DATA_ROOT."/banque";
|
$this->banque->dir_output=DOL_DATA_ROOT."/banque";
|
||||||
$this->banque->dir_temp =DOL_DATA_ROOT."/banque/temp";
|
$this->banque->dir_temp =DOL_DATA_ROOT."/banque/temp";
|
||||||
// Module don
|
// Module don
|
||||||
$this->don->enabled=defined("MAIN_MODULE_DON")?MAIN_MODULE_DON:0;
|
|
||||||
$this->don->dir_output=DOL_DATA_ROOT."/dons";
|
$this->don->dir_output=DOL_DATA_ROOT."/dons";
|
||||||
$this->don->dir_temp =DOL_DATA_ROOT."/dons/temp";
|
$this->don->dir_temp =DOL_DATA_ROOT."/dons/temp";
|
||||||
// Module syslog
|
|
||||||
$this->syslog->enabled=defined("MAIN_MODULE_SYSLOG")?MAIN_MODULE_SYSLOG:0;
|
|
||||||
// Module fournisseur
|
// Module fournisseur
|
||||||
$this->fournisseur->enabled=defined("MAIN_MODULE_FOURNISSEUR")?MAIN_MODULE_FOURNISSEUR:0;
|
|
||||||
$this->fournisseur->dir_output=DOL_DATA_ROOT."/fournisseur";
|
$this->fournisseur->dir_output=DOL_DATA_ROOT."/fournisseur";
|
||||||
$this->fournisseur->commande->dir_output=DOL_DATA_ROOT."/fournisseur/commande";
|
$this->fournisseur->commande->dir_output=DOL_DATA_ROOT."/fournisseur/commande";
|
||||||
$this->fournisseur->commande->dir_temp =DOL_DATA_ROOT."/fournisseur/commande/temp";
|
$this->fournisseur->commande->dir_temp =DOL_DATA_ROOT."/fournisseur/commande/temp";
|
||||||
$this->fournisseur->facture->dir_output =DOL_DATA_ROOT."/fournisseur/facture";
|
$this->fournisseur->facture->dir_output =DOL_DATA_ROOT."/fournisseur/facture";
|
||||||
$this->fournisseur->facture->dir_temp =DOL_DATA_ROOT."/fournisseur/facture/temp";
|
$this->fournisseur->facture->dir_temp =DOL_DATA_ROOT."/fournisseur/facture/temp";
|
||||||
// Module ficheinter
|
// Module ficheinter
|
||||||
$this->fichinter->enabled=defined("MAIN_MODULE_FICHEINTER")?MAIN_MODULE_FICHEINTER:0;
|
|
||||||
$this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter";
|
$this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter";
|
||||||
$this->fichinter->dir_temp =DOL_DATA_ROOT."/ficheinter/temp";
|
$this->fichinter->dir_temp =DOL_DATA_ROOT."/ficheinter/temp";
|
||||||
if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
||||||
// Module adherent
|
// Module adherent
|
||||||
$this->adherent->enabled=defined("MAIN_MODULE_ADHERENT")?MAIN_MODULE_ADHERENT:0;
|
|
||||||
$this->adherent->dir_output=DOL_DATA_ROOT."/adherent";
|
$this->adherent->dir_output=DOL_DATA_ROOT."/adherent";
|
||||||
$this->adherent->dir_tmp=DOL_DATA_ROOT."/adherent/temp";
|
$this->adherent->dir_tmp=DOL_DATA_ROOT."/adherent/temp";
|
||||||
// Module produit
|
// Module produit
|
||||||
$this->produit->enabled=defined("MAIN_MODULE_PRODUIT")?MAIN_MODULE_PRODUIT:0;
|
|
||||||
$this->produit->dir_output=DOL_DATA_ROOT."/produit";
|
$this->produit->dir_output=DOL_DATA_ROOT."/produit";
|
||||||
$this->produit->dir_temp =DOL_DATA_ROOT."/produit/temp";
|
$this->produit->dir_temp =DOL_DATA_ROOT."/produit/temp";
|
||||||
$this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0;
|
$this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0;
|
||||||
// Module service
|
// Module service
|
||||||
$this->service->enabled=defined("MAIN_MODULE_SERVICE")?MAIN_MODULE_SERVICE:0;
|
|
||||||
$this->service->dir_output=DOL_DATA_ROOT."/produit";
|
$this->service->dir_output=DOL_DATA_ROOT."/produit";
|
||||||
$this->service->dir_temp =DOL_DATA_ROOT."/produit/temp";
|
$this->service->dir_temp =DOL_DATA_ROOT."/produit/temp";
|
||||||
// Module stock
|
|
||||||
$this->stock->enabled=defined("MAIN_MODULE_STOCK")?MAIN_MODULE_STOCK:0;
|
|
||||||
|
|
||||||
// Module droipret
|
// Module droipret
|
||||||
$this->droitpret->enabled=defined("MAIN_MODULE_DROITPRET")?MAIN_MODULE_DROITPRET:0;
|
|
||||||
$this->droitpret->cat=defined('DROITPRET_CAT')?DROITPRET_CAT:'';
|
$this->droitpret->cat=defined('DROITPRET_CAT')?DROITPRET_CAT:'';
|
||||||
$this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:'';
|
$this->droitpret->cat=defined('DROITPRET_MAIL')?DROITPRET_MAIL:'';
|
||||||
$this->droitpret->dir_temp=DOL_DATA_ROOT."/droitpret/temp";
|
$this->droitpret->dir_temp=DOL_DATA_ROOT."/droitpret/temp";
|
||||||
|
|
||||||
// Module code barre
|
|
||||||
$this->barcode->enabled=defined("MAIN_MODULE_BARCODE")?MAIN_MODULE_BARCODE:0;
|
|
||||||
// Module categorie
|
|
||||||
$this->categorie->enabled=defined("MAIN_MODULE_CATEGORIE")?MAIN_MODULE_CATEGORIE:0;
|
|
||||||
// Module contrat
|
// Module contrat
|
||||||
$this->contrat->enabled=defined("MAIN_MODULE_CONTRAT")?MAIN_MODULE_CONTRAT:0;
|
|
||||||
$this->contrat->dir_output=DOL_DATA_ROOT."/contracts";
|
$this->contrat->dir_output=DOL_DATA_ROOT."/contracts";
|
||||||
// Module projet
|
|
||||||
$this->projet->enabled=defined("MAIN_MODULE_PROJET")?MAIN_MODULE_PROJET:0;
|
|
||||||
// Module oscommerce 1
|
|
||||||
$this->boutique->enabled=defined("MAIN_MODULE_BOUTIQUE")?MAIN_MODULE_BOUTIQUE:0;
|
|
||||||
$this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0;
|
|
||||||
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
|
|
||||||
// Module oscommerce 2
|
|
||||||
$this->oscommerce2->enabled=defined("MAIN_MODULE_OSCOMMERCEWS")?MAIN_MODULE_OSCOMMERCEWS:0;
|
|
||||||
// Module postnuke
|
|
||||||
$this->postnuke->enabled=defined("MAIN_MODULE_POSTNUKE")?MAIN_MODULE_POSTNUKE:0;
|
|
||||||
// Module clicktodial
|
|
||||||
$this->clicktodial->enabled=defined("MAIN_MODULE_CLICKTODIAL")?MAIN_MODULE_CLICKTODIAL:0;
|
|
||||||
// Module prelevement
|
// Module prelevement
|
||||||
$this->prelevement->enabled=defined("MAIN_MODULE_PRELEVEMENT")?MAIN_MODULE_PRELEVEMENT:0;
|
|
||||||
$this->prelevement->dir_output=DOL_DATA_ROOT."/prelevement";
|
$this->prelevement->dir_output=DOL_DATA_ROOT."/prelevement";
|
||||||
$this->prelevement->dir_temp =DOL_DATA_ROOT."/prelevement/temp";
|
$this->prelevement->dir_temp =DOL_DATA_ROOT."/prelevement/temp";
|
||||||
// Module webcal
|
// Module webcal
|
||||||
$this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
|
|
||||||
$this->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'__dolibarr_main_db_type__';
|
$this->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'__dolibarr_main_db_type__';
|
||||||
$this->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';
|
$this->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';
|
||||||
$this->webcal->db->port=defined('PHPWEBCALENDAR_PORT')?PHPWEBCALENDAR_PORT:'';
|
$this->webcal->db->port=defined('PHPWEBCALENDAR_PORT')?PHPWEBCALENDAR_PORT:'';
|
||||||
@ -291,7 +239,6 @@ class Conf
|
|||||||
$this->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
|
$this->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
|
||||||
$this->webcal->dir_temp=DOL_DATA_ROOT.'/webcal/temp';
|
$this->webcal->dir_temp=DOL_DATA_ROOT.'/webcal/temp';
|
||||||
// Module phenix
|
// Module phenix
|
||||||
$this->phenix->enabled=defined('MAIN_MODULE_PHENIX')?MAIN_MODULE_PHENIX:0;
|
|
||||||
$this->phenix->db->type=defined('PHPPHENIX_TYPE')?PHPPHENIX_TYPE:'__dolibarr_main_db_type__';
|
$this->phenix->db->type=defined('PHPPHENIX_TYPE')?PHPPHENIX_TYPE:'__dolibarr_main_db_type__';
|
||||||
$this->phenix->db->host=defined('PHPPHENIX_HOST')?PHPPHENIX_HOST:'';
|
$this->phenix->db->host=defined('PHPPHENIX_HOST')?PHPPHENIX_HOST:'';
|
||||||
$this->phenix->db->port=defined('PHPPHENIX_PORT')?PHPPHENIX_PORT:'';
|
$this->phenix->db->port=defined('PHPPHENIX_PORT')?PHPPHENIX_PORT:'';
|
||||||
@ -300,7 +247,6 @@ class Conf
|
|||||||
$this->phenix->db->name=defined('PHPPHENIX_DBNAME')?PHPPHENIX_DBNAME:'';
|
$this->phenix->db->name=defined('PHPPHENIX_DBNAME')?PHPPHENIX_DBNAME:'';
|
||||||
$this->phenix->cookie=defined('PHPPHENIX_COOKIE')?PHPPHENIX_COOKIE:'';
|
$this->phenix->cookie=defined('PHPPHENIX_COOKIE')?PHPPHENIX_COOKIE:'';
|
||||||
// Module mantis
|
// Module mantis
|
||||||
$this->mantis->enabled=defined('MAIN_MODULE_MANTIS')?MAIN_MODULE_MANTIS:0;
|
|
||||||
$this->mantis->db->type=defined('PHPMANTIS_TYPE')?PHPMANTIS_TYPE:'__dolibarr_main_db_type__';
|
$this->mantis->db->type=defined('PHPMANTIS_TYPE')?PHPMANTIS_TYPE:'__dolibarr_main_db_type__';
|
||||||
$this->mantis->db->host=defined('PHPMANTIS_HOST')?PHPMANTIS_HOST:'';
|
$this->mantis->db->host=defined('PHPMANTIS_HOST')?PHPMANTIS_HOST:'';
|
||||||
$this->mantis->db->port=defined('PHPMANTIS_PORT')?PHPMANTIS_PORT:'';
|
$this->mantis->db->port=defined('PHPMANTIS_PORT')?PHPMANTIS_PORT:'';
|
||||||
@ -308,24 +254,17 @@ class Conf
|
|||||||
$this->mantis->db->pass=defined('PHPMANTIS_PASS')?PHPMANTIS_PASS:'';
|
$this->mantis->db->pass=defined('PHPMANTIS_PASS')?PHPMANTIS_PASS:'';
|
||||||
$this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:'';
|
$this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:'';
|
||||||
// Module facture
|
// Module facture
|
||||||
$this->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0;
|
|
||||||
$this->facture->dir_output=DOL_DATA_ROOT."/facture";
|
$this->facture->dir_output=DOL_DATA_ROOT."/facture";
|
||||||
$this->facture->dir_temp =DOL_DATA_ROOT."/facture/temp";
|
$this->facture->dir_temp =DOL_DATA_ROOT."/facture/temp";
|
||||||
if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $this->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $this->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
||||||
// Module propal
|
// Module propal
|
||||||
$this->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
|
|
||||||
if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
|
if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
|
||||||
$this->propal->dir_output=DOL_DATA_ROOT."/propale";
|
$this->propal->dir_output=DOL_DATA_ROOT."/propale";
|
||||||
$this->propal->dir_temp =DOL_DATA_ROOT."/propale/temp";
|
$this->propal->dir_temp =DOL_DATA_ROOT."/propale/temp";
|
||||||
if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $this->propal->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $this->propal->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par defaut
|
||||||
// Module telephonie
|
// Module telephonie
|
||||||
$this->telephonie->enabled=defined("MAIN_MODULE_TELEPHONIE")?MAIN_MODULE_TELEPHONIE:0;
|
|
||||||
$this->telephonie->dir_output=DOL_DATA_ROOT."/telephonie";
|
$this->telephonie->dir_output=DOL_DATA_ROOT."/telephonie";
|
||||||
$this->telephonie->dir_temp =DOL_DATA_ROOT."/telephonie/temp";
|
$this->telephonie->dir_temp =DOL_DATA_ROOT."/telephonie/temp";
|
||||||
// Module document
|
|
||||||
$this->document->enabled=defined("MAIN_MODULE_DOCUMENT")?MAIN_MODULE_DOCUMENT:0;
|
|
||||||
// Module energie
|
|
||||||
$this->energie->enabled=defined("MAIN_MODULE_ENERGIE")?MAIN_MODULE_ENERGIE:0;
|
|
||||||
// Module domaine
|
// Module domaine
|
||||||
$this->domaine->enabled=0;
|
$this->domaine->enabled=0;
|
||||||
// Module voyage
|
// Module voyage
|
||||||
@ -334,27 +273,22 @@ class Conf
|
|||||||
$this->actions->dir_output=DOL_DATA_ROOT."/action";
|
$this->actions->dir_output=DOL_DATA_ROOT."/action";
|
||||||
$this->actions->dir_temp =DOL_DATA_ROOT."/action/temp";
|
$this->actions->dir_temp =DOL_DATA_ROOT."/action/temp";
|
||||||
// Module export
|
// Module export
|
||||||
$this->export->enabled=defined("MAIN_MODULE_EXPORT")?MAIN_MODULE_EXPORT:0;
|
|
||||||
$this->export->dir_output=DOL_DATA_ROOT."/export";
|
$this->export->dir_output=DOL_DATA_ROOT."/export";
|
||||||
$this->export->dir_temp =DOL_DATA_ROOT."/export/temp";
|
$this->export->dir_temp =DOL_DATA_ROOT."/export/temp";
|
||||||
// Module import
|
// Module import
|
||||||
$this->import->enabled=defined("MAIN_MODULE_IMPORT")?MAIN_MODULE_IMPORT:0;
|
|
||||||
$this->import->dir_output=DOL_DATA_ROOT."/import";
|
$this->import->dir_output=DOL_DATA_ROOT."/import";
|
||||||
$this->import->dir_temp =DOL_DATA_ROOT."/import/temp";
|
$this->import->dir_temp =DOL_DATA_ROOT."/import/temp";
|
||||||
// Module ldap
|
// Module ldap
|
||||||
$this->ldap->enabled=defined("MAIN_MODULE_LDAP")?MAIN_MODULE_LDAP:0;
|
|
||||||
$this->ldap->dir_temp=DOL_DATA_ROOT."/ldap/temp";
|
$this->ldap->dir_temp=DOL_DATA_ROOT."/ldap/temp";
|
||||||
// Module FCKeditor
|
// Module FCKeditor
|
||||||
$this->fckeditor->enabled=defined("MAIN_MODULE_FCKEDITOR")?MAIN_MODULE_FCKEDITOR:0;
|
|
||||||
$this->fckeditor->dir_output=DOL_DATA_ROOT."/fckeditor";
|
$this->fckeditor->dir_output=DOL_DATA_ROOT."/fckeditor";
|
||||||
// Module etiquette
|
|
||||||
$this->label->enabled=defined("MAIN_MODULE_LABEL")?MAIN_MODULE_LABEL:0;
|
|
||||||
// Module ECM
|
// Module ECM
|
||||||
$this->ecm->enabled=defined("MAIN_MODULE_ECM")?MAIN_MODULE_ECM:0;
|
|
||||||
$this->ecm->dir_output=DOL_DATA_ROOT."/ecm";
|
$this->ecm->dir_output=DOL_DATA_ROOT."/ecm";
|
||||||
// Module emailing
|
// Module emailing
|
||||||
$this->mailings->enabled=defined("MAIN_MODULE_MAILING")?MAIN_MODULE_MAILING:0;
|
|
||||||
$this->mailings->dir_temp=DOL_DATA_ROOT."/mailings/temp";
|
$this->mailings->dir_temp=DOL_DATA_ROOT."/mailings/temp";
|
||||||
|
// Module oscommerce 1
|
||||||
|
$this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0;
|
||||||
|
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -70,7 +70,7 @@ $modulepart='contract';
|
|||||||
/*
|
/*
|
||||||
* Action envoie fichier
|
* Action envoie fichier
|
||||||
*/
|
*/
|
||||||
if ($_POST["sendit"] && $conf->upload)
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Creation répertoire si n'existe pas
|
* Creation répertoire si n'existe pas
|
||||||
|
|||||||
@ -72,7 +72,7 @@ function llxHeader($head = "")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled && $user->rights->ficheinter->lire)
|
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
|
||||||
{
|
{
|
||||||
$langs->trans("interventions");
|
$langs->trans("interventions");
|
||||||
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
||||||
|
|||||||
@ -89,7 +89,7 @@ $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
|||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
// Envoie fichier
|
// Envoie fichier
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if (! is_dir($upload_dir))
|
if (! is_dir($upload_dir))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,7 +44,7 @@ $upload_dir = $conf->ecm->dir_output.'/'.$section;
|
|||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
// Envoie fichier
|
// Envoie fichier
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ if (! empty($_REQUEST["section"]))
|
|||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
// Envoie fichier
|
// Envoie fichier
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$result=$ecmdir->fetch($_REQUEST["section"]);
|
$result=$ecmdir->fetch($_REQUEST["section"]);
|
||||||
if (! $result > 0)
|
if (! $result > 0)
|
||||||
|
|||||||
@ -82,7 +82,7 @@ if ($commande->fetch($id) < 0)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && $conf->upload)
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$upload_dir = $conf->fournisseur->commande->dir_output . "/" . sanitizeFileName($commande->ref);
|
$upload_dir = $conf->fournisseur->commande->dir_output . "/" . sanitizeFileName($commande->ref);
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|||||||
@ -70,7 +70,7 @@ $pagenext = $page + 1;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST['sendit'] && $conf->upload)
|
if ($_POST['sendit'] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
$facture = new FactureFournisseur($db);
|
$facture = new FactureFournisseur($db);
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
|
|||||||
@ -35,7 +35,7 @@ if (!$user->rights->produit->lire) accessforbidden();
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( $_POST["sendit"] && $conf->upload)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if ($_GET["id"])
|
if ($_GET["id"])
|
||||||
{
|
{
|
||||||
@ -111,7 +111,7 @@ if ($_GET["id"])
|
|||||||
* Ajouter une photo
|
* Ajouter une photo
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && $conf->upload)
|
if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("AddPhoto"));
|
print_titre($langs->trans("AddPhoto"));
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
if ($_GET["action"] == '')
|
if ($_GET["action"] == '')
|
||||||
{
|
{
|
||||||
if ( $user->rights->produit->creer && $conf->upload)
|
if ( $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="photos.php?action=ajout_photo&id='.$product->id.'">';
|
print '<a class="butAction" href="photos.php?action=ajout_photo&id='.$product->id.'">';
|
||||||
print $langs->trans("AddPhoto").'</a>';
|
print $langs->trans("AddPhoto").'</a>';
|
||||||
|
|||||||
@ -68,23 +68,23 @@ class FormFile
|
|||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
$max=$conf->upload; // En Kb
|
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
|
||||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||||
if (eregi('m$',$maxphp)) $maxphp=$maxphp*1024;
|
if (eregi('m$',$maxphp)) $maxphp=$maxphp*1024;
|
||||||
if (eregi('k$',$maxphp)) $maxphp=$maxphp;
|
if (eregi('k$',$maxphp)) $maxphp=$maxphp;
|
||||||
// Now $max and $maxphp are in Kb
|
// Now $max and $maxphp are in Kb
|
||||||
if ($maxphp > 0) $max=min($max,$maxphp);
|
if ($maxphp > 0) $max=min($max,$maxphp);
|
||||||
|
|
||||||
if ($conf->upload > 0)
|
if ($max > 0)
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
|
print '<input type="hidden" name="max_file_size" value="'.($max*1024).'">';
|
||||||
}
|
}
|
||||||
print '<input class="flat" type="file" name="userfile" size="70"';
|
print '<input class="flat" type="file" name="userfile" size="70"';
|
||||||
print (empty($conf->upload)?' disabled="true"':'');
|
print (empty($conf->global->MAIN_UPLOAD_DOC)?' disabled="true"':'');
|
||||||
print '>';
|
print '>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
print '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||||
print (empty($conf->upload)?' disabled="true"':'');
|
print (empty($conf->global->MAIN_UPLOAD_DOC)?' disabled="true"':'');
|
||||||
print '>';
|
print '>';
|
||||||
|
|
||||||
if ($addcancel)
|
if ($addcancel)
|
||||||
@ -93,7 +93,7 @@ class FormFile
|
|||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->upload))
|
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb");
|
||||||
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||||
|
|||||||
@ -359,7 +359,7 @@ class MenuLeft {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Interventions
|
// Interventions
|
||||||
if ($conf->fichinter->enabled)
|
if ($conf->ficheinter->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$newmenu->add(DOL_URL_ROOT."/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire);
|
$newmenu->add(DOL_URL_ROOT."/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire);
|
||||||
|
|||||||
@ -341,7 +341,7 @@ class MenuLeft {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Interventions
|
// Interventions
|
||||||
if ($conf->fichinter->enabled )
|
if ($conf->ficheinter->enabled )
|
||||||
{
|
{
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$newmenu->add(DOL_URL_ROOT."/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire);
|
$newmenu->add(DOL_URL_ROOT."/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire);
|
||||||
|
|||||||
@ -149,7 +149,7 @@ class MenuTop {
|
|||||||
if ($conf->propal->enabled) $showcommercial=1;
|
if ($conf->propal->enabled) $showcommercial=1;
|
||||||
if ($conf->commande->enabled) $showcommercial=1;
|
if ($conf->commande->enabled) $showcommercial=1;
|
||||||
if ($conf->contrat->enabled) $showcommercial=1;
|
if ($conf->contrat->enabled) $showcommercial=1;
|
||||||
if ($conf->fichinter->enabled) $showcommercial=1;
|
if ($conf->ficheinter->enabled) $showcommercial=1;
|
||||||
if ($showcommercial)*/
|
if ($showcommercial)*/
|
||||||
if ($conf->commercial->enabled)
|
if ($conf->commercial->enabled)
|
||||||
{
|
{
|
||||||
@ -311,8 +311,8 @@ class MenuTop {
|
|||||||
print '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
|
print '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// OSCommerce 2
|
// OSCommerce WS
|
||||||
if ($conf->oscommerce2->enabled)
|
if ($conf->oscommercews->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("shop");
|
$langs->load("shop");
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,7 @@ class MenuTop {
|
|||||||
if ($conf->propal->enabled) $showcommercial=1;
|
if ($conf->propal->enabled) $showcommercial=1;
|
||||||
if ($conf->commande->enabled) $showcommercial=1;
|
if ($conf->commande->enabled) $showcommercial=1;
|
||||||
if ($conf->contrat->enabled) $showcommercial=1;
|
if ($conf->contrat->enabled) $showcommercial=1;
|
||||||
if ($conf->fichinter->enabled) $showcommercial=1;
|
if ($conf->ficheinter->enabled) $showcommercial=1;
|
||||||
if ($showcommercial)*/
|
if ($showcommercial)*/
|
||||||
if ($conf->commercial->enabled)
|
if ($conf->commercial->enabled)
|
||||||
{
|
{
|
||||||
@ -311,8 +311,8 @@ class MenuTop {
|
|||||||
print '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
|
print '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// OSCommerce 2
|
// OSCommerce WS
|
||||||
if ($conf->oscommerce2->enabled)
|
if ($conf->oscommercews->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("shop");
|
$langs->load("shop");
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,7 @@ class MenuTop {
|
|||||||
if ($conf->propal->enabled) $showcommercial=1;
|
if ($conf->propal->enabled) $showcommercial=1;
|
||||||
if ($conf->commande->enabled) $showcommercial=1;
|
if ($conf->commande->enabled) $showcommercial=1;
|
||||||
if ($conf->contrat->enabled) $showcommercial=1;
|
if ($conf->contrat->enabled) $showcommercial=1;
|
||||||
if ($conf->fichinter->enabled) $showcommercial=1;
|
if ($conf->ficheinter->enabled) $showcommercial=1;
|
||||||
if ($showcommercial)*/
|
if ($showcommercial)*/
|
||||||
if ($conf->commercial->enabled)
|
if ($conf->commercial->enabled)
|
||||||
{
|
{
|
||||||
@ -311,8 +311,8 @@ class MenuTop {
|
|||||||
print '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
|
print '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// OSCommerce 2
|
// OSCommerce WS
|
||||||
if ($conf->oscommerce2->enabled)
|
if ($conf->oscommercews->enabled)
|
||||||
{
|
{
|
||||||
$langs->load("shop");
|
$langs->load("shop");
|
||||||
|
|
||||||
|
|||||||
@ -295,7 +295,7 @@ insert into `llx_menu_constraint` (`rowid`, `action`) values (7, '$conf->propal
|
|||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (8, '$conf->commande->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (8, '$conf->commande->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (9, '$conf->expedition->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (9, '$conf->expedition->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (10, '$conf->contrat->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (10, '$conf->contrat->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (11, '$conf->fichinter->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (11, '$conf->ficheinter->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (12, '$conf->societe->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (12, '$conf->societe->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (13, '$conf->facture->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (13, '$conf->facture->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (14, '$conf->global->FACTURE_ENABLE_RECUR');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (14, '$conf->global->FACTURE_ENABLE_RECUR');
|
||||||
@ -323,7 +323,7 @@ insert into `llx_menu_constraint` (`rowid`, `action`) values (35, '$conf->commer
|
|||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (36, '$conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->commande->enabled || $conf->facture->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (36, '$conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled || $conf->commande->enabled || $conf->facture->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (37, '$conf->mailing->enabled || $conf->export->enabled || $conf->bookmark->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (37, '$conf->mailing->enabled || $conf->export->enabled || $conf->bookmark->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (38, '$conf->boutique->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (38, '$conf->boutique->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (39, '$conf->oscommerce2->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (39, '$conf->oscommercews->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (40, '$conf->webcal->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (40, '$conf->webcal->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (41, '$conf->mantis->enabled');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (41, '$conf->mantis->enabled');
|
||||||
insert into `llx_menu_constraint` (`rowid`, `action`) values (42, '$conf->global->PRODUIT_SPECIAL_LIVRE && $conf->global->PRODUCT_CANVAS_ABILITY');
|
insert into `llx_menu_constraint` (`rowid`, `action`) values (42, '$conf->global->PRODUIT_SPECIAL_LIVRE && $conf->global->PRODUCT_CANVAS_ABILITY');
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2008 Matteli
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -22,13 +23,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/main.inc.php
|
* \file htdocs/main.inc.php
|
||||||
\ingroup core
|
* \ingroup core
|
||||||
\brief Fichier de formatage generique des ecrans Dolibarr
|
* \brief Fichier de formatage generique des ecrans Dolibarr
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Pour le tuning optionnel. Activer si la variable d'environnement DOL_TUNING est positionnee.
|
// For optionnal tuning. Enabled if environment variable DOL_TUNING is defined.
|
||||||
// A appeler avant tout. Fait l'equivalent de la fonction dol_microtime_float pas encore chargee.
|
// A appeler avant tout. Fait l'equivalent de la fonction dol_microtime_float pas encore chargee.
|
||||||
$micro_start_time=0;
|
$micro_start_time=0;
|
||||||
if (! empty($_SERVER['DOL_TUNING']))
|
if (! empty($_SERVER['DOL_TUNING']))
|
||||||
@ -46,7 +47,7 @@ function stripslashes_deep($value)
|
|||||||
{
|
{
|
||||||
return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value));
|
return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value));
|
||||||
}
|
}
|
||||||
if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* plus pris en compte dans PHP6
|
if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6
|
||||||
{
|
{
|
||||||
if (get_magic_quotes_gpc())
|
if (get_magic_quotes_gpc())
|
||||||
{
|
{
|
||||||
@ -118,7 +119,7 @@ if ($conf->main_force_https)
|
|||||||
{
|
{
|
||||||
if ($_SERVER["HTTPS"] != 'on')
|
if ($_SERVER["HTTPS"] != 'on')
|
||||||
{
|
{
|
||||||
dolibarr_syslog("dolibarr_main_force_https is on but https disabled on serveur",LOG_ERR);
|
dolibarr_syslog("dolibarr_main_force_https is on but https disabled on serveur. We ignore option.",LOG_ERR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -85,7 +85,7 @@ function llxHeader($head = "")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->fichinter->enabled && $user->rights->ficheinter->lire)
|
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
|
||||||
{
|
{
|
||||||
$langs->trans("interventions");
|
$langs->trans("interventions");
|
||||||
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
$menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions"));
|
||||||
|
|||||||
@ -76,7 +76,7 @@ $modulepart='produit';
|
|||||||
/*
|
/*
|
||||||
* Action envoie fichier
|
* Action envoie fichier
|
||||||
*/
|
*/
|
||||||
if ($_POST["sendit"] && $conf->upload)
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Creation répertoire si n'existe pas
|
* Creation répertoire si n'existe pas
|
||||||
|
|||||||
@ -46,14 +46,14 @@ if (!$user->rights->produit->lire) accessforbidden();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_FILES['userfile']['size'] > 0 && $_POST["sendit"] && $conf->upload != 0)
|
if ($_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if ($_GET["id"])
|
if ($_GET["id"])
|
||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($_GET["id"]);
|
$result = $product->fetch($_GET["id"]);
|
||||||
|
|
||||||
// if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1))
|
// if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1) > 0)
|
||||||
|
|
||||||
// var_dump($_FILES);
|
// var_dump($_FILES);
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
|
|
||||||
print "\n<div class=\"tabsAction\">\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
if ($_GET["action"] != 'ajout_photo' && $user->rights->produit->creer && $conf->upload)
|
if ($_GET["action"] != 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/photos.php?action=ajout_photo&id='.$product->id.'">';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/photos.php?action=ajout_photo&id='.$product->id.'">';
|
||||||
print $langs->trans("AddPhoto").'</a>';
|
print $langs->trans("AddPhoto").'</a>';
|
||||||
@ -167,7 +167,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
/*
|
/*
|
||||||
* Ajouter une photo
|
* Ajouter une photo
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] == 'ajout_photo' && $conf->upload && $user->rights->produit->creer)
|
if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
// Affiche formulaire upload
|
// Affiche formulaire upload
|
||||||
$formfile=new FormFile($db);
|
$formfile=new FormFile($db);
|
||||||
|
|||||||
@ -71,7 +71,7 @@ $courrier_dir = $conf->societe->dir_output . "/courrier/" . get_exdir($socid) ;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoie fichier
|
// Envoie fichier
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/telephonie/fournisseurtel.class.php';
|
|||||||
|
|
||||||
if (!$user->rights->telephonie->facture->ecrire) accessforbidden();
|
if (!$user->rights->telephonie->facture->ecrire) accessforbidden();
|
||||||
|
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if ($_POST['fournisseur'] > 0)
|
if ($_POST['fournisseur'] > 0)
|
||||||
{
|
{
|
||||||
@ -35,7 +35,7 @@ if ( $_POST["sendit"] && $conf->upload != 0)
|
|||||||
|
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
{
|
{
|
||||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1))
|
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1) > 0)
|
||||||
{
|
{
|
||||||
$mesg = "Le fichier est valide, et a été téléchargé avec succès.\n";
|
$mesg = "Le fichier est valide, et a été téléchargé avec succès.\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ if (! is_dir($upload_dir))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $_POST["sendit"] && $conf->upload != 0)
|
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
if (is_dir($upload_dir))
|
if (is_dir($upload_dir))
|
||||||
{
|
{
|
||||||
@ -42,7 +42,7 @@ if ( $_POST["sendit"] && $conf->upload != 0)
|
|||||||
$nextname = $upload_dir .'/backup';
|
$nextname = $upload_dir .'/backup';
|
||||||
|
|
||||||
|
|
||||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1))
|
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1) > 0)
|
||||||
{
|
{
|
||||||
$mesg = "Le fichier est valide, et a été téléchargé avec succès.\n";
|
$mesg = "Le fichier est valide, et a été téléchargé avec succès.\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user