diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 4f46e54838b..f6b52df55e3 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -44,10 +44,10 @@ if ($_POST["action"] == 'add' && $user->admin)
$adht = new AdherentType($db);
$adht->libelle = trim($_POST["libelle"]);
- $adht->cotisation = $yesno[$_POST["cotisation"]];
+ $adht->cotisation = trim($_POST["cotisation"]);
$adht->commentaire = trim($_POST["comment"]);
$adht->mail_valid = trim($_POST["mail_valid"]);
- $adht->vote = $yesno[$_POST["vote"]];
+ $adht->vote = trim($_POST["vote"]);
if ($adht->libelle)
{
@@ -65,11 +65,11 @@ if ($_POST["action"] == 'update' && $user->admin)
if ($_POST["button"] != $langs->trans("Cancel")) {
$adht = new AdherentType($db);
$adht->id = $_POST["rowid"];
- $adht->libelle = $_POST["libelle"];
- $adht->cotisation = $yesno[$_POST["cotisation"]];
- $adht->commentaire = $_POST["comment"];
- $adht->mail_valid = $_POST["mail_valid"];
- $adht->vote = $yesno[$_POST["vote"]];
+ $adht->libelle = trim($_POST["libelle"]);
+ $adht->cotisation = trim($_POST["cotisation"]);
+ $adht->commentaire = trim($_POST["comment"]);
+ $adht->mail_valid = trim($_POST["mail_valid"]);
+ $adht->vote = trim($_POST["vote"]);
$adht->update($user->id);
@@ -134,8 +134,8 @@ if (! $rowid && $_GET["action"] != 'create' && $_GET["action"] != 'edit') {
print "
";
print '| '.img_object($langs->trans("ShwoType"),'group').' '.$objp->rowid.' | ';
print ''.$objp->libelle.' | ';
- print ''.$langs->trans($objp->cotisation).' | ';
- print ''.$langs->trans($objp->vote).' | ';
+ print ''.yn($objp->cotisation).' | ';
+ print ''.yn($objp->vote).' | ';
print ''.img_edit().' | ';
print "
";
$i++;
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index 9ad5eef0360..8bc29310b61 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -135,7 +135,7 @@ if ($resql)
print ''.price($obj->amount)." | \n";
print ''.$rej->motifs[$obj->motif].' | ';
- print ''.$langs->trans($yesno[$obj->afacturer]).' | ';
+ print ''.yn($obj->afacturer).' | ';
print ''.$obj->fk_facture.' | ';
print "\n";
diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php
index 9bf900457d6..57dc35e750b 100644
--- a/htdocs/conf/conf.class.php
+++ b/htdocs/conf/conf.class.php
@@ -66,7 +66,353 @@ class Conf
var $postnuke;
var $webcal;
var $propal;
- var $categorie;
+ var $categorie;
+
+
+ /**
+ * \brief Positionne toutes les variables de configuration
+ * \param $db Handler d'accès base
+ * \return int < 0 si erreur, >= 0 si succès
+ */
+ function setValues($db)
+ {
+ dolibarr_syslog("functions.inc.php::setValues");
+
+
+ /*
+ * Definition de toutes les Constantes globales d'environnement
+ * - En constante php (\todo a virer)
+ * - En $this->global->key=value
+ */
+ $sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const";
+ $result = $db->query($sql);
+ if ($result)
+ {
+ $numr = $db->num_rows($result);
+ $i = 0;
+
+ while ($i < $numr)
+ {
+ $objp = $db->fetch_object($result);
+ $key=$objp->name;
+ $value=$objp->value; // Pas de stripslashes (ne s'applique pas sur lecture en base mais après POST quand get_magic_quotes_gpc()==1)
+ define ("$key", $value);
+ $this->global->$key=$value;
+ $i++;
+ }
+ }
+ $db->free($result);
+
+
+
+ /*
+ * Nettoyage variables des gestionnaires de menu
+ * conf->menu_top et conf->menu_left sont définis dans main.inc.php (selon user)
+ */
+ if (! $this->global->MAIN_MENU_BARRETOP) $this->global->MAIN_MENU_BARRETOP="default.php";
+ if (! $this->global->MAIN_MENUFRONT_BARRETOP) $this->global->MAIN_MENUFRONT_BARRETOP="default.php";
+ if (! $this->global->MAIN_MENU_BARRELEFT) $this->global->MAIN_MENU_BARRELEFT="default.php";
+ if (! $this->global->MAIN_MENUFRONT_BARRELEFT) $this->global->MAIN_MENUFRONT_BARRELEFT="default.php";
+
+ /*
+ * Charge l'objet de traduction et positionne langage courant global
+ */
+ if (! $this->global->MAIN_LANG_DEFAULT) $this->global->MAIN_LANG_DEFAULT="fr_FR";
+
+ /*
+ * Autres parametres globaux de configurations
+ */
+ $this->users->dir_output=DOL_DATA_ROOT."/users";
+
+ /*
+ * Utilise dans tous les upload de fichier
+ * necessaire pour desactiver dans la demo
+ */
+ if (defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1)
+ {
+ $this->upload = 1;
+ }
+ else
+ {
+ $this->upload = 0;
+ }
+
+
+ /*
+ * Definition des parametres d'activation de module et dependants des modules
+ * Chargement d'include selon etat activation des modules
+ */
+
+ // Module bookmark4u
+ $this->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0;
+ $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 externalrss
+ $this->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0;
+ // 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_images=DOL_DATA_ROOT."/commande/images";
+
+ if (defined('MAIN_MODULE_EXPEDITION') && MAIN_MODULE_EXPEDITION)
+ {
+ // Module expeditions
+ $this->expedition->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
+ $this->expedition->dir_output=DOL_DATA_ROOT."/expedition";
+ $this->expedition->dir_images=DOL_DATA_ROOT."/expedition/images";
+ // Module bon de livraison
+ $this->livraison->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0;
+ $this->livraison->dir_output=DOL_DATA_ROOT."/livraison";
+ $this->livraison->dir_images=DOL_DATA_ROOT."/livraison/images";
+ }
+
+ // Module societe
+ $this->societe->enabled=defined("MAIN_MODULE_SOCIETE")?MAIN_MODULE_SOCIETE:0;
+ $this->societe->dir_output=DOL_DATA_ROOT."/societe";
+ $this->societe->dir_images=DOL_DATA_ROOT."/societe/images";
+ $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
+ // Module commercial
+ $this->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
+ $this->commercial->dir_output=DOL_DATA_ROOT."/rapport";
+ // 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_images=DOL_DATA_ROOT."/comptaexpert/images";
+ // Module compta
+ $this->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABILITE:0;
+ $this->compta->dir_output=DOL_DATA_ROOT."/compta";
+ $this->compta->dir_images=DOL_DATA_ROOT."/compta/images";
+ // Module banque
+ $this->banque->enabled=defined("MAIN_MODULE_BANQUE")?MAIN_MODULE_BANQUE:0;
+ $this->banque->dir_output=DOL_DATA_ROOT."/banque";
+ $this->banque->dir_images=DOL_DATA_ROOT."/banque/images";
+ // Module don
+ $this->don->enabled=defined("MAIN_MODULE_DON")?MAIN_MODULE_DON:0;
+ $this->don->dir_output=DOL_DATA_ROOT."/dons";
+ $this->don->dir_images=DOL_DATA_ROOT."/dons/images";
+ // Module syslog
+ $this->syslog->enabled=defined("MAIN_MODULE_SYSLOG")?MAIN_MODULE_SYSLOG:0;
+ // Module fournisseur
+ $this->fournisseur->enabled=defined("MAIN_MODULE_FOURNISSEUR")?MAIN_MODULE_FOURNISSEUR:0;
+ $this->fournisseur->dir_output=DOL_DATA_ROOT."/fournisseur";
+ $this->fournisseur->commande->dir_output=DOL_DATA_ROOT."/fournisseur/commande";
+ $this->fournisseur->commande->dir_images=DOL_DATA_ROOT."/fournisseur/commande/images";
+ $this->fournisseur->facture->dir_output=DOL_DATA_ROOT."/fournisseur/facture";
+ $this->fournisseur->facture->dir_images=DOL_DATA_ROOT."/fournisseur/facture/images";
+ // Module ficheinter
+ $this->fichinter->enabled=defined("MAIN_MODULE_FICHEINTER")?MAIN_MODULE_FICHEINTER:0;
+ $this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter";
+ $this->fichinter->dir_images=DOL_DATA_ROOT."/ficheinter/images";
+ if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
+ // Module adherent
+ $this->adherent->enabled=defined("MAIN_MODULE_ADHERENT")?MAIN_MODULE_ADHERENT:0;
+ $this->adherent->dir_output=DOL_DATA_ROOT."/adherent";
+ // Module produit
+ $this->produit->enabled=defined("MAIN_MODULE_PRODUIT")?MAIN_MODULE_PRODUIT:0;
+ $this->produit->dir_output=DOL_DATA_ROOT."/produit";
+ $this->produit->dir_images=DOL_DATA_ROOT."/produit/images";
+ $this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0;
+ // Module service
+ $this->service->enabled=defined("MAIN_MODULE_SERVICE")?MAIN_MODULE_SERVICE:0;
+ $this->service->dir_output=DOL_DATA_ROOT."/produit";
+ $this->service->dir_images=DOL_DATA_ROOT."/produit/images";
+ // Module stock
+ $this->stock->enabled=defined("MAIN_MODULE_STOCK")?MAIN_MODULE_STOCK:0;
+ // 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
+ $this->contrat->enabled=defined("MAIN_MODULE_CONTRAT")?MAIN_MODULE_CONTRAT:0;
+ // Module projet
+ $this->projet->enabled=defined("MAIN_MODULE_PROJET")?MAIN_MODULE_PROJET:0;
+ // Module oscommerce
+ $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 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
+ $this->prelevement->enabled=defined("MAIN_MODULE_PRELEVEMENT")?MAIN_MODULE_PRELEVEMENT:0;
+ $this->prelevement->dir_output=DOL_DATA_ROOT."/prelevement";
+ $this->prelevement->dir_images=DOL_DATA_ROOT."/prelevement/images";
+ // Module webcal
+ $this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
+ $this->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'mysql';
+ $this->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';
+ $this->webcal->db->user=defined('PHPWEBCALENDAR_USER')?PHPWEBCALENDAR_USER:'';
+ $this->webcal->db->pass=defined('PHPWEBCALENDAR_PASS')?PHPWEBCALENDAR_PASS:'';
+ $this->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
+ // Module facture
+ $this->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0;
+ $this->facture->dir_output=DOL_DATA_ROOT."/facture";
+ $this->facture->dir_images=DOL_DATA_ROOT."/facture/images";
+ if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $this->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par defaut
+ // 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);
+ $this->propal->dir_output=DOL_DATA_ROOT."/propale";
+ $this->propal->dir_images=DOL_DATA_ROOT."/propale/images";
+ if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $this->propal->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par defaut
+ // Module telephonie
+ $this->telephonie->enabled=defined("MAIN_MODULE_TELEPHONIE")?MAIN_MODULE_TELEPHONIE:0;
+ $this->telephonie->dir_output=DOL_DATA_ROOT."/telephonie";
+ $this->telephonie->dir_images=DOL_DATA_ROOT."/telephonie/images";
+ // Module energie
+ $this->energie->enabled=defined("MAIN_MODULE_ENERGIE")?MAIN_MODULE_ENERGIE:0;
+ // Module domaine
+ $this->domaine->enabled=0;
+ // Module voyage
+ $this->voyage->enabled=0;
+ // Module actionscomm
+ $this->actionscomm->dir_output=DOL_DATA_ROOT."/action";
+ // Module export
+ $this->export->enabled=defined("MAIN_MODULE_EXPORT")?MAIN_MODULE_EXPORT:0;
+ $this->export->dir_ouput=DOL_DATA_ROOT."/export";
+
+
+ /*
+ * Modification de quelques variable de conf en fonction des Constantes
+ */
+
+ // societe
+ if (! $this->global->SOCIETE_CODECLIENT_ADDON) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
+ if (! $this->global->SOCIETE_CODEFOURNISSEUR_ADDON) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON="mod_codeclient_leopard";
+ if (! $this->global->SOCIETE_CODECOMPTA_ADDON) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
+ // Pour compatibilite ascendante:
+ if ($this->global->CODECLIENT_ADDON) $this->global->SOCIETE_CODECLIENT_ADDON=$this->global->CODECLIENT_ADDON;
+ if ($this->global->CODEFOURNISSEUR_ADDON) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->CODEFOURNISSEUR_ADDON;
+
+ // securite
+ if (! $this->global->USER_PASSWORD_GENERATED) $this->global->USER_PASSWORD_GENERATED='standard';
+
+ // conf->use_preview_tabs
+ $this->use_preview_tabs=1;
+ if (isset($this->global->MAIN_USE_PREVIEW_TABS)) $this->use_preview_tabs=$this->global->MAIN_USE_PREVIEW_TABS;
+
+ // conf->use_javascript
+ $this->use_javascript=1;
+ if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) $this->use_javascript=! $this->global->MAIN_DISABLE_JAVASCRIPT;
+
+ // conf->use_ajax
+ $this->use_ajax=0; // Pas d' Ajax par defaut
+ if (isset($this->global->MAIN_DISABLE_AJAX)) $this->use_ajax=! $this->global->MAIN_DISABLE_AJAX;
+
+ // conf->use_popup_calendar
+ $this->use_popup_calendar=""; // Pas de date popup par defaut
+ if (isset($this->global->MAIN_POPUP_CALENDAR)) $this->use_popup_calendar=$this->global->MAIN_POPUP_CALENDAR;
+
+ // conf->monnaie
+ if (! $this->global->MAIN_MONNAIE) $this->global->MAIN_MONNAIE='EUR';
+ $this->monnaie=$this->global->MAIN_MONNAIE;
+
+ // $this->compta->mode = Option du module Compta: Defini le mode de calcul des etats comptables (CA,...)
+ $this->compta->mode = 'RECETTES-DEPENSES'; // Par défaut
+ if (defined('COMPTA_MODE') && COMPTA_MODE) {
+ // Peut etre 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
+ $this->compta->mode = COMPTA_MODE;
+ }
+
+ // $this->defaulttx
+ if (defined('FACTURE_TVAOPTION') && FACTURE_TVAOPTION == 'franchise') {
+ $this->defaulttx='0'; // Taux par défaut des factures clients
+ }
+ else {
+ $this->defaulttx=''; // Pas de taux par défaut des factures clients, le premier sera pris
+ }
+
+ // $this->liste_limit = constante de taille maximale des listes
+ if (! $this->global->MAIN_SIZE_LISTE_LIMIT) $this->global->MAIN_SIZE_LISTE_LIMIT=20;
+ $this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT;
+
+ // $this->produit->limit_size = constante de taille maximale des select de produit
+ if (! isset($this->global->PRODUIT_LIMIT_SIZE)) $this->global->PRODUIT_LIMIT_SIZE=50;
+ $this->produit->limit_size=$this->global->PRODUIT_LIMIT_SIZE;
+
+ // $this->theme et $this->css
+ if (! $this->global->MAIN_THEME) $this->global->MAIN_THEME="eldy";
+ $this->theme=$this->global->MAIN_THEME;
+ $this->css = "theme/".$this->theme."/".$this->theme.".css";
+
+ // $this->email_from = email pour envoi par Dolibarr des mails auto (notifications, ...)
+ // $this->mailing->email_from = email pour envoi par Dolibarr des mailings
+ $this->email_from="dolibarr-robot@domain.com";
+ if (defined('MAIN_EMAIL_FROM'))
+ {
+ $this->email_from=MAIN_EMAIL_FROM;
+ }
+ if (defined('MAILING_EMAIL_FROM'))
+ {
+ $this->mailing->email_from=MAILING_EMAIL_FROM;
+ }
+ else $this->mailing->email_from=$this->email_from;
+
+ // $this->adherent->email_resil, ...
+ if (defined("MAIN_MAIL_RESIL"))
+ {
+ $this->adherent->email_resil=MAIN_MAIL_RESIL;
+ }
+ if (defined("MAIN_MAIL_RESIL_SUBJECT"))
+ {
+ $this->adherent->email_resil_subject=MAIN_MAIL_RESIL_SUBJECT;
+ }
+ if (defined("MAIN_MAIL_VALID"))
+ {
+ $this->adherent->email_valid=MAIN_MAIL_VALID;
+ }
+ if (defined("MAIN_MAIL_VALID_SUBJECT"))
+ {
+ $this->adherent->email_valid_subject=MAIN_MAIL_VALID_SUBJECT;
+ }
+ if (defined("MAIN_MAIL_EDIT"))
+ {
+ $this->adherent->email_edit=MAIN_MAIL_EDIT;
+ }
+ if (defined("MAIN_MAIL_EDIT_SUBJECT"))
+ {
+ $this->adherent->email_edit_subject=MAIN_MAIL_EDIT_SUBJECT;
+ }
+ if (defined("MAIN_MAIL_NEW"))
+ {
+ $this->adherent->email_new=MAIN_MAIL_NEW;
+ }
+ if (defined("MAIN_MAIL_NEW_SUBJECT"))
+ {
+ $this->adherent->email_new_subject=MAIN_MAIL_NEW_SUBJECT;
+ }
+
+ // Format de la date
+ // \todo Mettre format dans fichier langue
+ $this->format_date_text_short="%d %b %Y";
+ $this->format_date_short="%d/%m/%Y";
+ $this->format_date_short_java="dd/MM/yyyy";
+
+ /* \todo Ajouter une option Gestion de la TVA dans le module compta qui permet de désactiver la fonction TVA
+ * (pour particuliers ou libéraux en franchise)
+ * En attendant, valeur forcée à 1
+ */
+ $this->compta->tva=1;
+
+ // Delais de tolerance des alertes
+ $this->actions->warning_delay=$this->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
+ $this->commande->traitement->warning_delay=$this->global->MAIN_DELAY_ORDERS_TO_PROCESS*24*60*60;
+ $this->propal->cloture->warning_delay=$this->global->MAIN_DELAY_PROPALS_TO_CLOSE*24*60*60;
+ $this->propal->facturation->warning_delay=$this->global->MAIN_DELAY_PROPALS_TO_BILL*24*60*60;
+ $this->facture->fournisseur->warning_delay=$this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY*24*60*60;
+ $this->facture->client->warning_delay=$this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED*24*60*60;
+ $this->contrat->services->inactifs->warning_delay=$this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES*24*60*60;
+ $this->contrat->services->expires->warning_delay=$this->global->MAIN_DELAY_RUNNING_SERVICES*24*60*60;
+ $this->adherent->cotisation->warning_delay=$this->global->MAIN_DELAY_MEMBERS*24*60*60;
+ $this->bank->rappro->warning_delay=$this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE*24*60*60;
+
+ }
+
}
?>
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 69b9a9d2058..7e1949ec272 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -106,6 +106,30 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade')
}
}
+ // Chargement config
+ define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root);
+ $conf->setValues($db);
+
+
+ /*
+ * Pour utiliser d'autres versions des librairies externes que les
+ * versions embarquées dans Dolibarr, définir les constantes adequates:
+ * Pour FPDF: FPDF_PATH
+ * Pour PEAR: PEAR_PATH
+ * Pour PHP_WriteExcel: PHP_WRITEEXCEL_PATH
+ * Pour PHPlot: PHPLOT_PATH
+ * Pour MagpieRss: MAGPIERSS_PATH
+ */
+ if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
+ if (! defined('PEAR_PATH')) { define('PEAR_PATH', DOL_DOCUMENT_ROOT .'/includes/pear/'); }
+ if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
+ if (! defined('PHPLOT_PATH')) { define('PHPLOT_PATH', DOL_DOCUMENT_ROOT .'/includes/phplot/'); }
+ if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); }
+ if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); }
+ define('FPDF_FONTPATH', FPDF_PATH . 'font/');
+ define('MAGPIE_DIR', MAGPIERSS_PATH);
+
+
/***************************************************************************************
*
* Migration des données
@@ -118,6 +142,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade')
print '| |
';
+
// Chaque action de migration doit renvoyer une ligne sur 4 colonnes avec
// dans la 1ere colonne, la description de l'action a faire
// dans la 4eme colonne, le texte 'OK' si fait ou 'AlreadyDone' si rien n'est fait ou 'Error'
@@ -136,8 +161,11 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade')
migrate_paiementfourn_facturefourn($db,$langs,$conf);
+ migrate_modeles($db,$langs,$conf);
+
+
// On commit dans tous les cas.
- // La procédure etant conçus pour pouvoir passer plusieurs fois quelquesoit la situation.
+ // La procédure etant conçue pour pouvoir passer plusieurs fois quelquesoit la situation.
$db->commit();
$db->close();
@@ -403,7 +431,6 @@ function migrate_contracts_date2($db,$langs,$conf)
}
-
/*
* Mise a jour des dates de création de contrat
*/
@@ -555,4 +582,44 @@ function migrate_paiementfourn_facturefourn($db,$langs,$conf)
}
}
+
+/*
+ * Mise a jour des modeles selectionnes
+ */
+function migrate_modeles($db,$langs,$conf)
+{
+ //print '
';
+ //print ''.$langs->trans('UpdateModelsTable')."
\n";
+
+ if ($conf->facture->enabled)
+ {
+ include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
+ $model=new ModelePDFFactures();
+ $modellist=$model->liste_modeles($db);
+ if (sizeof($modellist)==0)
+ {
+ // Aucun model par defaut.
+ $sql=" insert into llx_document_model(nom,type) values('crabe','invoice')";
+ $resql = $db->query($sql);
+ if (! $resql) dolibarr_print_error($db);
+ }
+ }
+
+ if ($conf->commande->enabled)
+ {
+ include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php');
+ $model=new ModelePDFCommandes();
+ $modellist=$model->liste_modeles($db);
+ if (sizeof($modellist)==0)
+ {
+ // Aucun model par defaut.
+ $sql=" insert into llx_document_model(nom,type) values('einstein','order')";
+ $resql = $db->query($sql);
+ if (! $resql) dolibarr_print_error($db);
+ }
+ }
+
+ //print $langs->trans("AlreadyDone");
+}
+
?>
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 3e0882f7d78..c8f13f7f231 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -54,6 +54,12 @@ if (get_magic_quotes_gpc())
require_once("master.inc.php");
+/*
+ */
+$bc[0]="class=\"impair\"";
+$bc[1]="class=\"pair\"";
+
+
// Verification du login.
// Cette verification est faite pour chaque accee Apres l'authentification,
// l'objet $user est initialise Notament $user->id, $user->login et $user->nom, $user->prenom
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 2f123ba7261..067c0f145c9 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -81,7 +81,7 @@ define('DOL_URL_ROOT', $pos);
/*
- * Initialisation de l'objet $conf
+ * Creation objet $conf
*/
require_once(DOL_DOCUMENT_ROOT."/conf/conf.class.php");
$conf = new Conf();
@@ -97,65 +97,41 @@ if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_m
$conf->db->prefix = $dolibarr_main_db_prefix;
define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
-/*
- * Chargement des includes principaux
- */
-require_once(DOL_DOCUMENT_ROOT ."/lib/".$conf->db->type.".lib.php");
+// Chargement des includes principaux
require_once(DOL_DOCUMENT_ROOT ."/lib/functions.inc.php");
require_once(DOL_DOCUMENT_ROOT ."/user.class.php");
require_once(DOL_DOCUMENT_ROOT ."/menu.class.php");
require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php");
+require_once(DOL_DOCUMENT_ROOT ."/lib/".$conf->db->type.".lib.php");
-
+/*
+ * Creation objet $db
+ */
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
if (! $db->connected) {
dolibarr_print_error($db,"host=".$conf->db->host.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
exit;
}
-
+/*
+ * Creation objet $user
+ */
$user = new User($db);
/*
- * Definition de toutes les Constantes globales d'environnement
- * - En constante php (\todo a virer)
- * - En $conf->global->key=value
+ * Chargement objet $conf
*/
-$sql = "SELECT name, value FROM ".MAIN_DB_PREFIX."const";
-$result = $db->query($sql);
-if ($result)
-{
- $numr = $db->num_rows($result);
- $i = 0;
-
- while ($i < $numr)
- {
- $objp = $db->fetch_object($result);
- $key=$objp->name;
- $value=$objp->value; // Pas de stripslashes (ne s'applique pas sur lecture base mais après POST quand get_magic_quotes_gpc()==1)
- define ("$key", $value);
- $conf->global->$key=$value;
- $i++;
- }
-}
-$db->free($result);
+$conf->setValues($db);
/*
- * Nettoyage variables des gestionnaires de menu
- * conf->menu_top et conf->menu_left sont définis dans main.inc.php (selon user)
+ * Creation objet $langs
*/
-if (! $conf->global->MAIN_MENU_BARRETOP) $conf->global->MAIN_MENU_BARRETOP="default.php";
-if (! $conf->global->MAIN_MENUFRONT_BARRETOP) $conf->global->MAIN_MENUFRONT_BARRETOP="default.php";
-if (! $conf->global->MAIN_MENU_BARRELEFT) $conf->global->MAIN_MENU_BARRELEFT="default.php";
-if (! $conf->global->MAIN_MENUFRONT_BARRELEFT) $conf->global->MAIN_MENUFRONT_BARRELEFT="default.php";
-
-/*
- * Charge l'objet de traduction et positionne langage courant global
- */
-if (! $conf->global->MAIN_LANG_DEFAULT) $conf->global->MAIN_LANG_DEFAULT="fr_FR";
-
require_once(DOL_DOCUMENT_ROOT ."/translate.class.php");
$langs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
+
+/*
+ * Chargement objet $langs
+ */
$langs->setDefaultLang($conf->global->MAIN_LANG_DEFAULT);
$langs->setPhpLang($conf->global->MAIN_LANG_DEFAULT);
@@ -178,288 +154,13 @@ if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMEN
define('FPDF_FONTPATH', FPDF_PATH . 'font/');
define('MAGPIE_DIR', MAGPIERSS_PATH);
-// \todo Ajouter la ligne
-// require_once(FPDF_PATH . "fpdf.php");
-// dans le fichier pdfdetail_standard_modeles du module telephonie afin de pouvoir la suivante
-if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdf.php");
-
-/*
- * Autres parametres globaux de configurations
- */
-$conf->users->dir_output=DOL_DATA_ROOT."/users";
-
-/*
- * Utilise dans tous les upload de fichier
- * necessaire pour desactiver dans la demo
- */
-if (defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1)
-{
- $conf->upload = 1;
-}
-else
-{
- $conf->upload = 0;
-}
-
-
-/*
- * Definition des parametres d'activation de module et dependants des modules
- * Chargement d'include selon etat activation des modules
- */
-
-// Module bookmark4u
-$conf->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0;
-$conf->bookmark->enabled=defined('MAIN_MODULE_BOOKMARK')?MAIN_MODULE_BOOKMARK:0;
-// Module deplacement
-$conf->deplacement->enabled=defined("MAIN_MODULE_DEPLACEMENT")?MAIN_MODULE_DEPLACEMENT:0;
-// Module mailing
-$conf->mailing->enabled=defined("MAIN_MODULE_MAILING")?MAIN_MODULE_MAILING:0;
-// Module externalrss
-$conf->externalrss->enabled=defined("MAIN_MODULE_EXTERNALRSS")?MAIN_MODULE_EXTERNALRSS:0;
-// Module commande client
-$conf->commande->enabled=defined("MAIN_MODULE_COMMANDE")?MAIN_MODULE_COMMANDE:0;
-$conf->commande->dir_output=DOL_DATA_ROOT."/commande";
-$conf->commande->dir_images=DOL_DATA_ROOT."/commande/images";
-
-if (defined('MAIN_MODULE_EXPEDITION') && MAIN_MODULE_EXPEDITION)
-{
- // Module expeditions
- $conf->expedition->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
- $conf->expedition->dir_output=DOL_DATA_ROOT."/expedition";
- $conf->expedition->dir_images=DOL_DATA_ROOT."/expedition/images";
- // Module bon de livraison
- $conf->livraison->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0;
- $conf->livraison->dir_output=DOL_DATA_ROOT."/livraison";
- $conf->livraison->dir_images=DOL_DATA_ROOT."/livraison/images";
-}
-
-// Module societe
-$conf->societe->enabled=defined("MAIN_MODULE_SOCIETE")?MAIN_MODULE_SOCIETE:0;
-$conf->societe->dir_output=DOL_DATA_ROOT."/societe";
-$conf->societe->dir_images=DOL_DATA_ROOT."/societe/images";
-$conf->societe->dir_logos=DOL_DATA_ROOT."/societe/logos";
-if (defined('SOCIETE_OUTPUTDIR') && SOCIETE_OUTPUTDIR) { $conf->societe->dir_output=SOCIETE_OUTPUTDIR; } # Pour passer outre le rep par defaut
-// Module commercial
-$conf->commercial->enabled=defined("MAIN_MODULE_COMMERCIAL")?MAIN_MODULE_COMMERCIAL:0;
-$conf->commercial->dir_output=DOL_DATA_ROOT."/rapport";
-// Module comptaexpert
-$conf->comptaexpert->enabled=defined("MAIN_MODULE_COMPTABILITE_EXPERT")?MAIN_MODULE_COMPTABILITE_EXPERT:0;
-$conf->comptaexpert->dir_output=DOL_DATA_ROOT."/comptaexpert";
-$conf->comptaexpert->dir_images=DOL_DATA_ROOT."/comptaexpert/images";
-// Module compta
-$conf->compta->enabled=defined("MAIN_MODULE_COMPTABILITE")?MAIN_MODULE_COMPTABILITE:0;
-$conf->compta->dir_output=DOL_DATA_ROOT."/compta";
-$conf->compta->dir_images=DOL_DATA_ROOT."/compta/images";
-// Module banque
-$conf->banque->enabled=defined("MAIN_MODULE_BANQUE")?MAIN_MODULE_BANQUE:0;
-$conf->banque->dir_output=DOL_DATA_ROOT."/banque";
-$conf->banque->dir_images=DOL_DATA_ROOT."/banque/images";
-// Module don
-$conf->don->enabled=defined("MAIN_MODULE_DON")?MAIN_MODULE_DON:0;
-$conf->don->dir_output=DOL_DATA_ROOT."/dons";
-$conf->don->dir_images=DOL_DATA_ROOT."/dons/images";
-// Module syslog
-$conf->syslog->enabled=defined("MAIN_MODULE_SYSLOG")?MAIN_MODULE_SYSLOG:0;
-// Module fournisseur
-$conf->fournisseur->enabled=defined("MAIN_MODULE_FOURNISSEUR")?MAIN_MODULE_FOURNISSEUR:0;
-$conf->fournisseur->dir_output=DOL_DATA_ROOT."/fournisseur";
-$conf->fournisseur->commande->dir_output=DOL_DATA_ROOT."/fournisseur/commande";
-$conf->fournisseur->commande->dir_images=DOL_DATA_ROOT."/fournisseur/commande/images";
-$conf->fournisseur->facture->dir_output=DOL_DATA_ROOT."/fournisseur/facture";
-$conf->fournisseur->facture->dir_images=DOL_DATA_ROOT."/fournisseur/facture/images";
-// Module ficheinter
-$conf->fichinter->enabled=defined("MAIN_MODULE_FICHEINTER")?MAIN_MODULE_FICHEINTER:0;
-$conf->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter";
-$conf->fichinter->dir_images=DOL_DATA_ROOT."/ficheinter/images";
-if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $conf->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
-// Module adherent
-$conf->adherent->enabled=defined("MAIN_MODULE_ADHERENT")?MAIN_MODULE_ADHERENT:0;
-$conf->adherent->dir_output=DOL_DATA_ROOT."/adherent";
-// Module produit
-$conf->produit->enabled=defined("MAIN_MODULE_PRODUIT")?MAIN_MODULE_PRODUIT:0;
-$conf->produit->dir_output=DOL_DATA_ROOT."/produit";
-$conf->produit->dir_images=DOL_DATA_ROOT."/produit/images";
-$conf->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0;
-// Module service
-$conf->service->enabled=defined("MAIN_MODULE_SERVICE")?MAIN_MODULE_SERVICE:0;
-$conf->service->dir_output=DOL_DATA_ROOT."/produit";
-$conf->service->dir_images=DOL_DATA_ROOT."/produit/images";
-// Module stock
-$conf->stock->enabled=defined("MAIN_MODULE_STOCK")?MAIN_MODULE_STOCK:0;
-// Module code barre
-$conf->barcode->enabled=defined("MAIN_MODULE_BARCODE")?MAIN_MODULE_BARCODE:0;
-// Module categorie
-$conf->categorie->enabled=defined("MAIN_MODULE_CATEGORIE")?MAIN_MODULE_CATEGORIE:0;
-// Module contrat
-$conf->contrat->enabled=defined("MAIN_MODULE_CONTRAT")?MAIN_MODULE_CONTRAT:0;
-// Module projet
-$conf->projet->enabled=defined("MAIN_MODULE_PROJET")?MAIN_MODULE_PROJET:0;
-// Module oscommerce
-$conf->boutique->enabled=defined("MAIN_MODULE_BOUTIQUE")?MAIN_MODULE_BOUTIQUE:0;
-$conf->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0;
-$conf->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
-// Module postnuke
-$conf->postnuke->enabled=defined("MAIN_MODULE_POSTNUKE")?MAIN_MODULE_POSTNUKE:0;
-// Module clicktodial
-$conf->clicktodial->enabled=defined("MAIN_MODULE_CLICKTODIAL")?MAIN_MODULE_CLICKTODIAL:0;
-// Module prelevement
-$conf->prelevement->enabled=defined("MAIN_MODULE_PRELEVEMENT")?MAIN_MODULE_PRELEVEMENT:0;
-$conf->prelevement->dir_output=DOL_DATA_ROOT."/prelevement";
-$conf->prelevement->dir_images=DOL_DATA_ROOT."/prelevement/images";
-// Module webcal
-$conf->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
-$conf->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'mysql';
-$conf->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';
-$conf->webcal->db->user=defined('PHPWEBCALENDAR_USER')?PHPWEBCALENDAR_USER:'';
-$conf->webcal->db->pass=defined('PHPWEBCALENDAR_PASS')?PHPWEBCALENDAR_PASS:'';
-$conf->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
-// Module facture
-$conf->facture->enabled=defined("MAIN_MODULE_FACTURE")?MAIN_MODULE_FACTURE:0;
// \todo Ajouter la ligne
// require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
-// dans le fichier facturation-emission.php du module telephonie afin de pouvoir supprimer la suivante
+// dans le fichier facturation-emission.php du module telephonie afin de pouvoir supprimer la ligne suivante
if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php");
-$conf->facture->dir_output=DOL_DATA_ROOT."/facture";
-$conf->facture->dir_images=DOL_DATA_ROOT."/facture/images";
-if (defined('FAC_OUTPUTDIR') && FAC_OUTPUTDIR) { $conf->facture->dir_output=FAC_OUTPUTDIR; } # Pour passer outre le rep par defaut
-// Module propal
-$conf->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
-if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4);
-$conf->propal->dir_output=DOL_DATA_ROOT."/propale";
-$conf->propal->dir_images=DOL_DATA_ROOT."/propale/images";
-if (defined('PROPALE_OUTPUTDIR') && PROPALE_OUTPUTDIR) { $conf->propal->dir_output=PROPALE_OUTPUTDIR; } # Pour passer outre le rep par defaut
-// Module telephonie
-$conf->telephonie->enabled=defined("MAIN_MODULE_TELEPHONIE")?MAIN_MODULE_TELEPHONIE:0;
-$conf->telephonie->dir_output=DOL_DATA_ROOT."/telephonie";
-$conf->telephonie->dir_images=DOL_DATA_ROOT."/telephonie/images";
-// Module energie
-$conf->energie->enabled=defined("MAIN_MODULE_ENERGIE")?MAIN_MODULE_ENERGIE:0;
-// Module domaine
-$conf->domaine->enabled=0;
-// Module voyage
-$conf->voyage->enabled=0;
-// Module actionscomm
-$conf->actionscomm->dir_output=DOL_DATA_ROOT."/action";
-// Module export
-$conf->export->enabled=defined("MAIN_MODULE_EXPORT")?MAIN_MODULE_EXPORT:0;
-$conf->export->dir_ouput=DOL_DATA_ROOT."/export";
-
-
-/*
- * Modification de quelques variable de conf en fonction des Constantes
- */
-
-// societe
-if (! $conf->global->SOCIETE_CODECLIENT_ADDON) $conf->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
-if (! $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON="mod_codeclient_leopard";
-if (! $conf->global->SOCIETE_CODECOMPTA_ADDON) $conf->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
-// Pour compatibilite ascendante:
-if ($conf->global->CODECLIENT_ADDON) $conf->global->SOCIETE_CODECLIENT_ADDON=$conf->global->CODECLIENT_ADDON;
-if ($conf->global->CODEFOURNISSEUR_ADDON) $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON=$conf->global->CODEFOURNISSEUR_ADDON;
-
-// securite
-if (! $conf->global->USER_PASSWORD_GENERATED) $conf->global->USER_PASSWORD_GENERATED='standard';
-
-// conf->use_preview_tabs
-$conf->use_preview_tabs=1;
-if (isset($conf->global->MAIN_USE_PREVIEW_TABS)) $conf->use_preview_tabs=$conf->global->MAIN_USE_PREVIEW_TABS;
-
-// conf->use_javascript
-$conf->use_javascript=1;
-if (isset($conf->global->MAIN_DISABLE_JAVASCRIPT)) $conf->use_javascript=! $conf->global->MAIN_DISABLE_JAVASCRIPT;
-
-// conf->use_ajax
-$conf->use_ajax=0; // Pas d' Ajax par defaut
-if (isset($conf->global->MAIN_DISABLE_AJAX)) $conf->use_ajax=! $conf->global->MAIN_DISABLE_AJAX;
-
-// conf->use_popup_calendar
-$conf->use_popup_calendar=""; // Pas de date popup par defaut
-if (isset($conf->global->MAIN_POPUP_CALENDAR)) $conf->use_popup_calendar=$conf->global->MAIN_POPUP_CALENDAR;
-
-// conf->monnaie
-if (! $conf->global->MAIN_MONNAIE) $conf->global->MAIN_MONNAIE='EUR';
-$conf->monnaie=$conf->global->MAIN_MONNAIE;
-
-// $conf->compta->mode = Option du module Compta: Defini le mode de calcul des etats comptables (CA,...)
-$conf->compta->mode = 'RECETTES-DEPENSES'; // Par défaut
-if (defined('COMPTA_MODE') && COMPTA_MODE) {
- // Peut etre 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
- $conf->compta->mode = COMPTA_MODE;
-}
-
-// $conf->defaulttx
-if (defined('FACTURE_TVAOPTION') && FACTURE_TVAOPTION == 'franchise') {
- $conf->defaulttx='0'; // Taux par défaut des factures clients
-}
-else {
- $conf->defaulttx=''; // Pas de taux par défaut des factures clients, le premier sera pris
-}
-
-// $conf->liste_limit = constante de taille maximale des listes
-if (! $conf->global->MAIN_SIZE_LISTE_LIMIT) $conf->global->MAIN_SIZE_LISTE_LIMIT=20;
-$conf->liste_limit=$conf->global->MAIN_SIZE_LISTE_LIMIT;
-
-// $conf->produit->limit_size = constante de taille maximale des select de produit
-if (! isset($conf->global->PRODUIT_LIMIT_SIZE)) $conf->global->PRODUIT_LIMIT_SIZE=50;
-$conf->produit->limit_size=$conf->global->PRODUIT_LIMIT_SIZE;
-
-// $conf->theme et $conf->css
-if (! $conf->global->MAIN_THEME) $conf->global->MAIN_THEME="eldy";
-$conf->theme=$conf->global->MAIN_THEME;
-$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
-
-// $conf->email_from = email pour envoi par Dolibarr des mails auto (notifications, ...)
-// $conf->mailing->email_from = email pour envoi par Dolibarr des mailings
-$conf->email_from="dolibarr-robot@domain.com";
-if (defined('MAIN_EMAIL_FROM'))
-{
- $conf->email_from=MAIN_EMAIL_FROM;
-}
-if (defined('MAILING_EMAIL_FROM'))
-{
- $conf->mailing->email_from=MAILING_EMAIL_FROM;
-}
-else $conf->mailing->email_from=$conf->email_from;
-
-// $conf->adherent->email_resil, ...
-if (defined("MAIN_MAIL_RESIL"))
-{
- $conf->adherent->email_resil=MAIN_MAIL_RESIL;
-}
-if (defined("MAIN_MAIL_RESIL_SUBJECT"))
-{
- $conf->adherent->email_resil_subject=MAIN_MAIL_RESIL_SUBJECT;
-}
-if (defined("MAIN_MAIL_VALID"))
-{
- $conf->adherent->email_valid=MAIN_MAIL_VALID;
-}
-if (defined("MAIN_MAIL_VALID_SUBJECT"))
-{
- $conf->adherent->email_valid_subject=MAIN_MAIL_VALID_SUBJECT;
-}
-if (defined("MAIN_MAIL_EDIT"))
-{
- $conf->adherent->email_edit=MAIN_MAIL_EDIT;
-}
-if (defined("MAIN_MAIL_EDIT_SUBJECT"))
-{
- $conf->adherent->email_edit_subject=MAIN_MAIL_EDIT_SUBJECT;
-}
-if (defined("MAIN_MAIL_NEW"))
-{
- $conf->adherent->email_new=MAIN_MAIL_NEW;
-}
-if (defined("MAIN_MAIL_NEW_SUBJECT"))
-{
- $conf->adherent->email_new_subject=MAIN_MAIL_NEW_SUBJECT;
-}
-
-// Format de la date
-// \todo Mettre format dans fichier langue
-$conf->format_date_text_short="%d %b %Y";
-$conf->format_date_short="%d/%m/%Y";
-$conf->format_date_short_java="dd/MM/yyyy";
+// require_once(FPDF_PATH . "fpdf.php");
+// dans le fichier pdfdetail_standard_modeles du module telephonie afin de pouvoir supprimer la ligne suivante
+if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdf.php");
/*
@@ -489,29 +190,8 @@ $mysoc->email=$conf->global->MAIN_INFO_SOCIETE_MAIL;
$mysoc->adresse_full=$mysoc->adresse."\n".$mysoc->cp." ".$mysoc->ville;
$mysoc->logo=$conf->global->MAIN_INFO_SOCIETE_LOGO;
-/* \todo Ajouter une option Gestion de la TVA dans le module compta qui permet de désactiver la fonction TVA
- * (pour particuliers ou libéraux en franchise)
- * En attendant, valeur forcée à 1
- */
-$conf->compta->tva=1;
-// Delais de tolerance des alertes
-$conf->actions->warning_delay=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
-$conf->commande->traitement->warning_delay=$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS*24*60*60;
-$conf->propal->cloture->warning_delay=$conf->global->MAIN_DELAY_PROPALS_TO_CLOSE*24*60*60;
-$conf->propal->facturation->warning_delay=$conf->global->MAIN_DELAY_PROPALS_TO_BILL*24*60*60;
-$conf->facture->fournisseur->warning_delay=$conf->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY*24*60*60;
-$conf->facture->client->warning_delay=$conf->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED*24*60*60;
-$conf->contrat->services->inactifs->warning_delay=$conf->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES*24*60*60;
-$conf->contrat->services->expires->warning_delay=$conf->global->MAIN_DELAY_RUNNING_SERVICES*24*60*60;
-$conf->adherent->cotisation->warning_delay=$conf->global->MAIN_DELAY_MEMBERS*24*60*60;
-$conf->bank->rappro->warning_delay=$conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE*24*60*60;
-
-
-/*
- */
-$bc[0]="class=\"impair\"";
-$bc[1]="class=\"pair\"";
+// Sert uniquement dans module telephonie
$yesno[0]="no";
$yesno[1]="yes";