diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 9e540a71d95..b8be83dd91d 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2005 Laurent Destailleur - * Copyright (C) 2005 Simon Tosser + * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2005 Simon Tosser * * 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 @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -52,6 +51,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_DELAY_SUPPLIER_BILLS_TO_PAY",$_POST["SupplierBillsToPay"]); dolibarr_set_const($db, "MAIN_DELAY_CUSTOMER_BILLS_UNPAYED",$_POST["CustomerBillsUnpayed"]); dolibarr_set_const($db, "MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE",$_POST["TransactionsToConciliate"]); + dolibarr_set_const($db, "MAIN_DELAY_CHEQUES_TO_DEPOSIT",$_POST["ChequesToDeposit"]); dolibarr_set_const($db, "MAIN_DELAY_MEMBERS",$_POST["Members"]); if ($_POST['action'] != 'updateedit') { @@ -170,6 +170,11 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.img_object('','account').''; print ''.$langs->trans("DelaysOfToleranceTransactionsToConciliate").''; print ' ' . $langs->trans("days") . ''; + $var=!$var; + print ''; + print ''.img_object('','account').''; + print ''.$langs->trans("DelaysOfTolerancechequesToDeposit").''; + print ' ' . $langs->trans("days") . ''; } if ($conf->adherent->enabled) { @@ -269,6 +274,10 @@ else print ''; print ''.img_object('','account').''; print ''.$langs->trans("DelaysOfToleranceTransactionsToConciliate").'' . ($conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE+0) . ' ' . $langs->trans("days") . ''; + $var=!$var; + print ''; + print ''.img_object('','account').''; + print ''.$langs->trans("DelaysOfToleranceChequesToDeposit").'' . ($conf->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT+0) . ' ' . $langs->trans("days") . ''; } if ($conf->adherent->enabled) diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index 79b34d632a7..87053de3df5 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -20,7 +20,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -124,10 +123,10 @@ class Conf if (! $this->global->MAIN_MENUFRONT_BARRELEFT) $this->global->MAIN_MENUFRONT_BARRELEFT="default.php"; // Variable globales LDAP - if (! $this->global->LDAP_KEY_USERS) $this->global->LDAP_KEY_USERS=$this->global->LDAP_FIELD_FULLNAME; - if (! $this->global->LDAP_KEY_GROUPS) $this->global->LDAP_KEY_GROUPS=$this->global->LDAP_FIELD_FULLNAME; - if (! $this->global->LDAP_KEY_CONTACTS) $this->global->LDAP_KEY_CONTACTS=$this->global->LDAP_FIELD_FULLNAME; - if (! $this->global->LDAP_KEY_MEMBERS) $this->global->LDAP_KEY_MEMBERS=$this->global->LDAP_FIELD_FULLNAME; + if (! isset($this->global->LDAP_KEY_USERS)) $this->global->LDAP_KEY_USERS=$this->global->LDAP_FIELD_FULLNAME; + if (! isset($this->global->LDAP_KEY_GROUPS)) $this->global->LDAP_KEY_GROUPS=$this->global->LDAP_FIELD_FULLNAME; + if (! isset($this->global->LDAP_KEY_CONTACTS)) $this->global->LDAP_KEY_CONTACTS=$this->global->LDAP_FIELD_FULLNAME; + if (! isset($this->global->LDAP_KEY_MEMBERS)) $this->global->LDAP_KEY_MEMBERS=$this->global->LDAP_FIELD_FULLNAME; /* @@ -351,21 +350,21 @@ class Conf // Debug Mode $this->use_debug_mode=0; - if ($this->global->MAIN_ENABLE_DEBUG_MODE) $this->use_debug_mode=$this->global->MAIN_ENABLE_DEBUG_MODE; + if (isset($this->global->MAIN_ENABLE_DEBUG_MODE)) $this->use_debug_mode=$this->global->MAIN_ENABLE_DEBUG_MODE; // System tools if (! $this->global->SYSTEMTOOLS_MYSQLDUMP) $this->global->SYSTEMTOOLS_MYSQLDUMP="mysqldump"; // 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=$this->global->SOCIETE_CODECLIENT_ADDON; - if (! $this->global->SOCIETE_CODECOMPTA_ADDON) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum"; + if (! isset($this->global->SOCIETE_CODEFOURNISSEUR_ADDON) || ! $this->global->SOCIETE_CODEFOURNISSEUR_ADDON) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON; + if (! isset($this->global->SOCIETE_CODECOMPTA_ADDON) || ! $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; + if (isset($this->global->CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON=$this->global->CODECLIENT_ADDON; + if (isset($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'; + if (! isset($this->global->USER_PASSWORD_GENERATED) || ! $this->global->USER_PASSWORD_GENERATED) $this->global->USER_PASSWORD_GENERATED='standard'; // conf->use_preview_tabs $this->use_preview_tabs=1; @@ -426,27 +425,27 @@ class Conf // $this->email_from = email pour envoi par dolibarr des mails automatiques $this->email_from = "dolibarr-robot@domain.com"; - if ($conf->global->MAIN_MAIL_EMAIL_FROM) + if (isset($conf->global->MAIN_MAIL_EMAIL_FROM) && $conf->global->MAIN_MAIL_EMAIL_FROM) { $this->email_from = $conf->global->MAIN_MAIL_EMAIL_FROM; } // $this->notification->email_from = email pour envoi par Dolibarr des notifications - $this->notification->email_from=$conf->global->MAIN_MAIL_EMAIL_FROM; - if ($conf->global->NOTIFICATION_EMAIL_FROM) + $this->notification->email_from=$this->email_from; + if (isset($conf->global->NOTIFICATION_EMAIL_FROM) && $conf->global->NOTIFICATION_EMAIL_FROM) { - $this->mailing->email_from=$conf->global->NOTIFICATION_EMAIL_FROM; + $this->notification->email_from=$conf->global->NOTIFICATION_EMAIL_FROM; } // $this->mailing->email_from = email pour envoi par Dolibarr des mailings - $this->mailing->email_from=$conf->global->MAIN_MAIL_EMAIL_FROM; - if ($conf->global->MAILING_EMAIL_FROM) + $this->mailing->email_from=$this->email_from;; + if (isset($conf->global->MAILING_EMAIL_FROM) && $conf->global->MAILING_EMAIL_FROM) { $this->mailing->email_from=$conf->global->MAILING_EMAIL_FROM; } // Defini MAIN_GRAPH_LIBRARY - if (! in_array($this->global->MAIN_GRAPH_LIBRARY, array('phplot','artichow'))) + if (isset($this->global->MAIN_GRAPH_LIBRARY) && ! in_array($this->global->MAIN_GRAPH_LIBRARY, array('phplot','artichow'))) { $this->global->MAIN_GRAPH_LIBRARY='phplot'; // $this->global->MAIN_GRAPH_LIBRARY = 'artichow'; @@ -485,7 +484,7 @@ class Conf $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; - + $this->bank->cheque->warning_delay=$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT*24*60*60; } } diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 4c27f713234..257e4bb9ed6 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -431,21 +431,21 @@ if ($_GET["action"] == 'create') } elseif ($_GET["id"] > 0) { - /* - * Affichage en mode visu - */ - - $html = new Form($db); - $fichinter = new Fichinter($db); - $result=$fichinter->fetch($_GET["id"]); - if (! $result > 0) - { - dolibarr_print_error($db); - exit; - } - $fichinter->fetch_client(); - - // Debug mode + /* +* Affichage en mode visu +*/ + + $html = new Form($db); + $fichinter = new Fichinter($db); + $result=$fichinter->fetch($_GET["id"]); + if (! $result > 0) + { + dolibarr_print_error($db); + exit; + } + $fichinter->fetch_client(); + + // Debug mode // TODO: créer une fonction debug générique if ($conf->use_debug_mode) { @@ -457,49 +457,49 @@ elseif ($_GET["id"] > 0) print $debug; } - if ($mesg) print $mesg."
"; + if ($mesg) print $mesg."
"; - $head = fichinter_prepare_head($fichinter); - - dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard")); - - /* - * Confirmation de la suppression de la fiche d'intervention - */ - if ($_GET['action'] == 'delete') - { - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete'); - print '
'; - } - - /* - * Confirmation de la validation de la fiche d'intervention - */ - if ($_GET['action'] == 'validate') - { - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate'); - print '
'; - } - - /* - * Confirmation de la suppression d'une ligne d'intervention - */ - if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) - { - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline'); - print '
'; - } - - print ''; - - // Ref - print ''; - - // Societe - print ""; - - // Date - print '
'.$langs->trans("Ref").''.$fichinter->ref.'
".$langs->trans("Company")."".$fichinter->client->getNomUrl(1)."
'; + $head = fichinter_prepare_head($fichinter); + + dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard")); + + /* +* Confirmation de la suppression de la fiche d'intervention +*/ + if ($_GET['action'] == 'delete') + { + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete'); + print '
'; + } + + /* +* Confirmation de la validation de la fiche d'intervention +*/ + if ($_GET['action'] == 'validate') + { + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate'); + print '
'; + } + + /* +* Confirmation de la suppression d'une ligne d'intervention +*/ + if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) + { + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline'); + print '
'; + } + + print ''; + + // Ref + print ''; + + // Societe + print ""; + + // Date + print '
'.$langs->trans("Ref").''.$fichinter->ref.'
".$langs->trans("Company")."".$fichinter->client->getNomUrl(1)."
'; print ''; @@ -521,7 +521,7 @@ elseif ($_GET["id"] > 0) print ''; print ''; - // Projet + // Projet if ($conf->projet->enabled) { $langs->load("projects"); @@ -529,7 +529,7 @@ elseif ($_GET["id"] > 0) print '
'; print $langs->trans('Date'); print '
'; $societe=new Societe($db); - $societe->fetch($fichinter->socid); + $societe->fetch($fichinter->socid); $numprojet = $societe->has_projects(); if (! $numprojet) { @@ -578,50 +578,50 @@ elseif ($_GET["id"] > 0) print ''; } - // Durée - print ''; - - // Description - print ''; - print ''; - - // Statut - print ''; + // Durée + print ''; + + // Description + print ''; + print ''; + + // Statut + print ''; - print "
'; print $langs->trans('Project').'
'.$langs->trans("TotalDuration").''.$fichinter->duree.'
'; - print ''; - if ($_GET['action'] != 'editdescription' && $fichinter->brouillon) print ''; - print '
'; - print $langs->trans('Description'); - print 'id.'">'.img_edit($langs->trans('SetDescription'),1).'
'; - print '
'; - if ($_GET['action'] == 'editdescription') - { - print '
'; - print ''; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('description',$fichinter->description,280,'dolibarr_notes','In',true); - $doleditor->Create(); - } - else - { - print ''; - } - print ''; - print '
'; - } - else - { - print nl2br($fichinter->description); - } - print '
'.$langs->trans("Status").''.$fichinter->getLibStatut(4).'
'.$langs->trans("TotalDuration").''.$fichinter->duree.'
'; + print ''; + if ($_GET['action'] != 'editdescription' && $fichinter->brouillon) print ''; + print '
'; + print $langs->trans('Description'); + print 'id.'">'.img_edit($langs->trans('SetDescription'),1).'
'; + print '
'; + if ($_GET['action'] == 'editdescription') + { + print '
'; + print ''; + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE) + { + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('description',$fichinter->description,280,'dolibarr_notes','In',true); + $doleditor->Create(); + } + else + { + print ''; + } + print ''; + print '
'; + } + else + { + print nl2br($fichinter->description); + } + print '
'.$langs->trans("Status").''.$fichinter->getLibStatut(4).'

"; - - /* - * Lignes d'intervention - */ + print "

"; + + /* + * Lignes d'intervention + */ print ''; $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang'; @@ -744,14 +744,14 @@ elseif ($_GET["id"] > 0) print ''; // Date d'intervention - print ''; - - // Durée - print ''; + print ''; + + // Durée + print ''; print ''; @@ -829,69 +829,69 @@ elseif ($_GET["id"] > 0) print "\n"; - /** - * Barre d'actions - * - */ - print '
'; + /** + * Barre d'actions + * + */ + print ''; + if ($user->societe_id == 0) + { + // Validate + if ($fichinter->statut == 0 && $user->rights->ficheinter->creer) + { + print 'use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + { + $url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_validate&confirm=yes'; + print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmValidateIntervention').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"'; + } + else + { + print 'href="fiche.php?id='.$_GET["id"].'&action=validate"'; + } + print '>'.$langs->trans("Valid").''; + } + + // Delete + if ($fichinter->statut == 0 && $user->rights->ficheinter->supprimer) + { + print 'use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + { + $url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_delete&confirm=yes'; + print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans("ConfirmDeleteIntervention").'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"'; + } + else + { + print 'href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=delete"'; + } + print '>'.$langs->trans('Delete').''; + } + } + + print '
'; - print '
'; - $html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention"); - print ''; - $html->select_duree('duration',$objp->duree); - print ''; + $html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention"); + print ''; + $html->select_duree('duration',$objp->duree); + print ''; print '
"; + print "
'; - /* - * Documents générés - */ - $filename=sanitize_string($fichinter->ref); - $filedir=$conf->fichinter->dir_output . "/".$fichinter->ref; - $urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id; - $genallowed=$user->rights->ficheinter->creer; - $delallowed=$user->rights->ficheinter->supprimer; - $genallowed=1; - $delallowed=1; + print '"; - print "
'; + /* + * Documents générés + */ + $filename=sanitize_string($fichinter->ref); + $filedir=$conf->fichinter->dir_output . "/".$fichinter->ref; + $urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id; + $genallowed=$user->rights->ficheinter->creer; + $delallowed=$user->rights->ficheinter->supprimer; + $genallowed=1; + $delallowed=1; - $var=true; + $var=true; - print "
\n"; - $somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf); + print "
\n"; + $somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf); - print "
"; - print " 
\n"; + print "
"; + print " 
\n"; } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 8c2c46ce075..6db2551e4c9 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php index e94ca5662a9..797e7e931ed 100644 --- a/htdocs/fourn/fournisseur.commande.class.php +++ b/htdocs/fourn/fournisseur.commande.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2007 Franky Van Liedekerke * * This program is free software; you can redistribute it and/or modify @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php index 3cf69eaf97d..72d8ed86e1a 100644 --- a/htdocs/includes/boxes/box_factures_fourn.php +++ b/htdocs/includes/boxes/box_factures_fourn.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -67,7 +66,6 @@ class box_factures_fourn extends ModeleBoxes { $this->info_box_head = array( 'text' => $langs->trans("BoxTitleLastSupplierBills",$max), - 'limit'=> strlen($text) ); if ($user->rights->fournisseur->facture->lire) diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php index 42974f113f1..d6bfd2cd217 100644 --- a/htdocs/includes/boxes/modules_boxes.php +++ b/htdocs/includes/boxes/modules_boxes.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2007 Laurent Destailleur * * 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 @@ -17,7 +17,6 @@ * or see http://www.gnu.org/ * * $Id$ - * $Source$ */ /** @@ -108,7 +107,8 @@ class ModeleBoxes $bcx[1] = 'class="box_impair"'; $var = true; - $nbcol=sizeof($contents[0])+1; + $nbcol=0; + if (isset($contents[0])) $nbcol=sizeof($contents[0])+1; $nblines=sizeof($contents); print "\n\n\n"; @@ -126,8 +126,8 @@ class ModeleBoxes { print '
'; } - print dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX); - if ($head['sublink']) + if (isset($head['text'])) print dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX); + if (isset($head['sublink']) && $head['sublink']) { print ' '.img_picto($head['subtext'],$head['subpicto']).''; } diff --git a/htdocs/index.php b/htdocs/index.php index 277b3d4bfbb..7372106bf94 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -205,7 +204,7 @@ if ($user->societe_id == 0) { $classe=$classes[$key]; // Cherche dans cache si le load_state_board deja réalisé - if (! is_object($boardloaded[$classe])) + if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe])) { include_once($includes[$key]); @@ -248,7 +247,7 @@ $var=true; // // Nbre actions à faire (en retard) -if (($conf->commercial->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled) && $user->rights->actions->lire) +if ($conf->commercial->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled) { include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); $board=new ActionComm($db); diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 776c5b120b3..3d3e6c7c1bc 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -23,7 +23,6 @@ * or see http://www.gnu.org/ * * $Id$ - * $Source$ */ /** @@ -163,26 +162,26 @@ function sanitize_string($str) \brief Envoi des messages dolibarr dans un fichier ou dans syslog Pour fichier: fichier défini par SYSLOG_FILE Pour syslog: facility défini par SYSLOG_FACILITY - \param message Message a tracer. Ne doit pas etre traduit si level = LOG_ERROR + \param message Message a tracer. Ne doit pas etre traduit si level = LOG_ERR \param level Niveau de l'erreur \remarks Cette fonction n'a un effet que si le module syslog est activé. Warning, les fonctions syslog sont buggués sous Windows et génèrent des fautes de protection mémoire. Pour résoudre, utiliser le loggage fichier, au lieu du loggage syslog (configuration du module). Si SYSLOG_FILE_NO_ERROR défini, on ne gère pas erreur ecriture log - \remarks On windows LOG_ERROR=4, LOG_WARNING=5, LOG_NOTICE=LOG_DEBUG=LOG_INFO=6 + \remarks On windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_DEBUG=LOG_INFO=6 */ function dolibarr_syslog($message, $level=LOG_INFO) { global $conf,$user,$langs; - if ($conf->syslog->enabled) + if (isset($conf->syslog->enabled) && $conf->syslog->enabled) { //print $level.' - '.$conf->global->SYSLOG_LEVEL.' - '.$conf->syslog->enabled." \n"; if ($level > $conf->global->SYSLOG_LEVEL) return; // Traduction du message - if ($level == LOG_ERROR) + if ($level == LOG_ERR) { $langs->load("errors"); if ($message != $langs->trans($message)) $message = $langs->trans($message); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a7893fdab04..520b624ee2a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -798,7 +797,8 @@ function top_menu($head, $title="", $target="") $title.='
'.$langs->trans("ConnectedSince").': '.dolibarr_print_date($user->datelastlogin,"dayhour"); if ($dolibarr_main_authentication) $title.='
'.$langs->trans("AuthenticationMode").': '.$dolibarr_main_authentication; - $text.='atarget?(' target="'.$menutop->atarget.'"'):''; $text.='>'; $text.=' * Copyright (C) 2003 Éric Seigne - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Guillaume Delecourt * @@ -20,7 +20,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -57,7 +56,7 @@ function llxHeader($head = "") $menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); } - if ($conf->commercial->enabled && $user->rights->commercial->lire) + if ($conf->commercial->enabled && isset($user->rights->commercial->lire) && $user->rights->commercial->lire) { $langs->load("commercial"); $menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial")); diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 38defb73928..92840d50bf2 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -682,8 +682,7 @@ class Product $sql.= " AND pfp.rowid = ".$prodfournprice; $sql.= " AND pfp.quantity <= ".$qty; - dolibarr_syslog("Product::get_buyprice $prodfournprice,$qty sql=".$sql); - + dolibarr_syslog("Product::get_buyprice sql=".$sql); $resql = $this->db->query($sql); if ($resql) { @@ -699,7 +698,7 @@ class Product else { // On refait le meme select sur la ref et l'id du produit - $sql = "SELECT pfp.price as price, pfp.quantity as quantity, pf.fk_soc"; + $sql = "SELECT pfp.price as price, pfp.quantity as quantity, pf.fk_soc,"; $sql.= " pf.fk_product, pf.ref_fourn"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product_fournisseur as pf"; $sql.= " WHERE pf.rowid = pfp.fk_product_fournisseur"; @@ -709,6 +708,7 @@ class Product $sql.= " ORDER BY pfp.quantity DESC"; $sql.= " LIMIT 1"; + dolibarr_syslog("Product::get_buyprice sql=".$sql); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 0cdc54aab8c..a6c64b9277d 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -495,22 +495,26 @@ class User $i = 0; while ($i < $num) { - $row = $this->db->fetch_row($result); + $obj = $this->db->fetch_object($result); - if ($row[1]) + $module=$obj->module; + $perms=$obj->perms; + $subperms=$obj->subperms; + + if ($perms) { - if ($row[2]) + if ($subperms) { - if (! $this->rights->$row[0] || - (is_object($this->rights->$row[0]) && ! $this->rights->$row[0]->$row[1]) || - (is_object($this->rights->$row[0]->$row[1])) ) + if (! isset($this->rights->$module) || + (is_object($this->rights->$module) && ! isset($this->rights->$module->$perms)) || + (is_object($this->rights->$module->$perms)) ) { - $this->rights->$row[0]->$row[1]->$row[2] = 1; + $this->rights->$module->$perms->$subperms = 1; } } else { - $this->rights->$row[0]->$row[1] = 1; + $this->rights->$module->$perms = 1; } }