Fix: Corrige un paquet de warnings

This commit is contained in:
Laurent Destailleur 2007-10-23 23:28:13 +00:00
parent 207fb63fe6
commit 5e5e8bba2d
14 changed files with 231 additions and 226 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com> * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* *
* 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
@ -18,7 +18,6 @@
* 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$ * $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_SUPPLIER_BILLS_TO_PAY",$_POST["SupplierBillsToPay"]);
dolibarr_set_const($db, "MAIN_DELAY_CUSTOMER_BILLS_UNPAYED",$_POST["CustomerBillsUnpayed"]); 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_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"]); dolibarr_set_const($db, "MAIN_DELAY_MEMBERS",$_POST["Members"]);
if ($_POST['action'] != 'updateedit') if ($_POST['action'] != 'updateedit')
{ {
@ -170,6 +170,11 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
print '<td width="20px">'.img_object('','account').'</td>'; print '<td width="20px">'.img_object('','account').'</td>';
print '<td>'.$langs->trans("DelaysOfToleranceTransactionsToConciliate").'</td><td>'; print '<td>'.$langs->trans("DelaysOfToleranceTransactionsToConciliate").'</td><td>';
print '<input size="5" name="TransactionsToConciliate" value="'. ($conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE+0) . '"> ' . $langs->trans("days") . '</td></tr>'; print '<input size="5" name="TransactionsToConciliate" value="'. ($conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE+0) . '"> ' . $langs->trans("days") . '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td width="20px">'.img_object('','account').'</td>';
print '<td>'.$langs->trans("DelaysOfTolerancechequesToDeposit").'</td><td>';
print '<input size="5" name="ChequesToDeposit" value="'. ($conf->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT+0) . '"> ' . $langs->trans("days") . '</td></tr>';
} }
if ($conf->adherent->enabled) if ($conf->adherent->enabled)
{ {
@ -269,6 +274,10 @@ else
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="20px">'.img_object('','account').'</td>'; print '<td width="20px">'.img_object('','account').'</td>';
print '<td>'.$langs->trans("DelaysOfToleranceTransactionsToConciliate").'</td><td>' . ($conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE+0) . ' ' . $langs->trans("days") . '</td></tr>'; print '<td>'.$langs->trans("DelaysOfToleranceTransactionsToConciliate").'</td><td>' . ($conf->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE+0) . ' ' . $langs->trans("days") . '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td width="20px">'.img_object('','account').'</td>';
print '<td>'.$langs->trans("DelaysOfToleranceChequesToDeposit").'</td><td>' . ($conf->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT+0) . ' ' . $langs->trans("days") . '</td></tr>';
} }
if ($conf->adherent->enabled) if ($conf->adherent->enabled)

View File

@ -20,7 +20,6 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**
@ -124,10 +123,10 @@ class Conf
if (! $this->global->MAIN_MENUFRONT_BARRELEFT) $this->global->MAIN_MENUFRONT_BARRELEFT="default.php"; if (! $this->global->MAIN_MENUFRONT_BARRELEFT) $this->global->MAIN_MENUFRONT_BARRELEFT="default.php";
// Variable globales LDAP // Variable globales LDAP
if (! $this->global->LDAP_KEY_USERS) $this->global->LDAP_KEY_USERS=$this->global->LDAP_FIELD_FULLNAME; if (! isset($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 (! isset($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 (! isset($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_MEMBERS)) $this->global->LDAP_KEY_MEMBERS=$this->global->LDAP_FIELD_FULLNAME;
/* /*
@ -351,21 +350,21 @@ class Conf
// Debug Mode // Debug Mode
$this->use_debug_mode=0; $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 // System tools
if (! $this->global->SYSTEMTOOLS_MYSQLDUMP) $this->global->SYSTEMTOOLS_MYSQLDUMP="mysqldump"; if (! $this->global->SYSTEMTOOLS_MYSQLDUMP) $this->global->SYSTEMTOOLS_MYSQLDUMP="mysqldump";
// societe // societe
if (! $this->global->SOCIETE_CODECLIENT_ADDON) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard"; 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 (! isset($this->global->SOCIETE_CODEFOURNISSEUR_ADDON) || ! $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_CODECOMPTA_ADDON) || ! $this->global->SOCIETE_CODECOMPTA_ADDON) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
// Pour compatibilite ascendante: // Pour compatibilite ascendante:
if ($this->global->CODECLIENT_ADDON) $this->global->SOCIETE_CODECLIENT_ADDON=$this->global->CODECLIENT_ADDON; if (isset($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->CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->CODEFOURNISSEUR_ADDON;
// securite // 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 // conf->use_preview_tabs
$this->use_preview_tabs=1; $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 = email pour envoi par dolibarr des mails automatiques
$this->email_from = "dolibarr-robot@domain.com"; $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->email_from = $conf->global->MAIN_MAIL_EMAIL_FROM;
} }
// $this->notification->email_from = email pour envoi par Dolibarr des notifications // $this->notification->email_from = email pour envoi par Dolibarr des notifications
$this->notification->email_from=$conf->global->MAIN_MAIL_EMAIL_FROM; $this->notification->email_from=$this->email_from;
if ($conf->global->NOTIFICATION_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 = email pour envoi par Dolibarr des mailings
$this->mailing->email_from=$conf->global->MAIN_MAIL_EMAIL_FROM; $this->mailing->email_from=$this->email_from;;
if ($conf->global->MAILING_EMAIL_FROM) if (isset($conf->global->MAILING_EMAIL_FROM) && $conf->global->MAILING_EMAIL_FROM)
{ {
$this->mailing->email_from=$conf->global->MAILING_EMAIL_FROM; $this->mailing->email_from=$conf->global->MAILING_EMAIL_FROM;
} }
// Defini MAIN_GRAPH_LIBRARY // 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='phplot';
// $this->global->MAIN_GRAPH_LIBRARY = 'artichow'; // $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->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->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->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;
} }
} }

View File

@ -431,21 +431,21 @@ if ($_GET["action"] == 'create')
} }
elseif ($_GET["id"] > 0) elseif ($_GET["id"] > 0)
{ {
/* /*
* Affichage en mode visu * Affichage en mode visu
*/ */
$html = new Form($db); $html = new Form($db);
$fichinter = new Fichinter($db); $fichinter = new Fichinter($db);
$result=$fichinter->fetch($_GET["id"]); $result=$fichinter->fetch($_GET["id"]);
if (! $result > 0) if (! $result > 0)
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
exit; exit;
} }
$fichinter->fetch_client(); $fichinter->fetch_client();
// Debug mode // Debug mode
// TODO: créer une fonction debug générique // TODO: créer une fonction debug générique
if ($conf->use_debug_mode) if ($conf->use_debug_mode)
{ {
@ -457,49 +457,49 @@ elseif ($_GET["id"] > 0)
print $debug; print $debug;
} }
if ($mesg) print $mesg."<br>"; if ($mesg) print $mesg."<br>";
$head = fichinter_prepare_head($fichinter); $head = fichinter_prepare_head($fichinter);
dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard")); dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard"));
/* /*
* Confirmation de la suppression de la fiche d'intervention * Confirmation de la suppression de la fiche d'intervention
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete');
print '<br>'; print '<br>';
} }
/* /*
* Confirmation de la validation de la fiche d'intervention * Confirmation de la validation de la fiche d'intervention
*/ */
if ($_GET['action'] == 'validate') if ($_GET['action'] == 'validate')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate');
print '<br>'; print '<br>';
} }
/* /*
* Confirmation de la suppression d'une ligne d'intervention * Confirmation de la suppression d'une ligne d'intervention
*/ */
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline');
print '<br>'; print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$fichinter->ref.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$fichinter->ref.'</td></tr>';
// Societe // Societe
print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>"; print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>";
// Date // Date
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Date'); print $langs->trans('Date');
print '</td>'; print '</td>';
@ -521,7 +521,7 @@ elseif ($_GET["id"] > 0)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Projet // Projet
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
$langs->load("projects"); $langs->load("projects");
@ -529,7 +529,7 @@ elseif ($_GET["id"] > 0)
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project').'</td>'; print $langs->trans('Project').'</td>';
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($fichinter->socid); $societe->fetch($fichinter->socid);
$numprojet = $societe->has_projects(); $numprojet = $societe->has_projects();
if (! $numprojet) if (! $numprojet)
{ {
@ -578,50 +578,50 @@ elseif ($_GET["id"] > 0)
print '</tr>'; print '</tr>';
} }
// Durée // Durée
print '<tr><td>'.$langs->trans("TotalDuration").'</td><td>'.$fichinter->duree.'</td></tr>'; print '<tr><td>'.$langs->trans("TotalDuration").'</td><td>'.$fichinter->duree.'</td></tr>';
// Description // Description
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Description'); print $langs->trans('Description');
print '</td>'; print '</td>';
if ($_GET['action'] != 'editdescription' && $fichinter->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdescription&amp;id='.$fichinter->id.'">'.img_edit($langs->trans('SetDescription'),1).'</a></td>'; if ($_GET['action'] != 'editdescription' && $fichinter->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdescription&amp;id='.$fichinter->id.'">'.img_edit($langs->trans('SetDescription'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET['action'] == 'editdescription') if ($_GET['action'] == 'editdescription')
{ {
print '<form name="editdescription" action="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'" method="post">'; print '<form name="editdescription" action="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'" method="post">';
print '<input type="hidden" name="action" value="setdescription">'; print '<input type="hidden" name="action" value="setdescription">';
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE) if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE)
{ {
// Editeur wysiwyg // Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('description',$fichinter->description,280,'dolibarr_notes','In',true); $doleditor=new DolEditor('description',$fichinter->description,280,'dolibarr_notes','In',true);
$doleditor->Create(); $doleditor->Create();
} }
else else
{ {
print '<textarea name="description" wrap="soft" cols="70" rows="12">'.$fichinter->description.'</textarea>'; print '<textarea name="description" wrap="soft" cols="70" rows="12">'.$fichinter->description.'</textarea>';
} }
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} }
else else
{ {
print nl2br($fichinter->description); print nl2br($fichinter->description);
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut(4).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut(4).'</td></tr>';
print "</table><br>"; print "</table><br>";
/* /*
* Lignes d'intervention * Lignes d'intervention
*/ */
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang'; $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang';
@ -744,14 +744,14 @@ elseif ($_GET["id"] > 0)
print '</td>'; print '</td>';
// Date d'intervention // Date d'intervention
print '<td>'; print '<td>';
$html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention"); $html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention");
print '</td>'; print '</td>';
// Durée // Durée
print '<td>'; print '<td>';
$html->select_duree('duration',$objp->duree); $html->select_duree('duration',$objp->duree);
print '</td>'; print '</td>';
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '<br /><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>'; print '<br /><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
@ -829,69 +829,69 @@ elseif ($_GET["id"] > 0)
print "\n"; print "\n";
/** /**
* Barre d'actions * Barre d'actions
* *
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
// Validate // Validate
if ($fichinter->statut == 0 && $user->rights->ficheinter->creer) if ($fichinter->statut == 0 && $user->rights->ficheinter->creer)
{ {
print '<a class="butAction" '; print '<a class="butAction" ';
if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{ {
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_validate&confirm=yes'; $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\')"'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmValidateIntervention').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
} }
else else
{ {
print 'href="fiche.php?id='.$_GET["id"].'&action=validate"'; print 'href="fiche.php?id='.$_GET["id"].'&action=validate"';
} }
print '>'.$langs->trans("Valid").'</a>'; print '>'.$langs->trans("Valid").'</a>';
} }
// Delete // Delete
if ($fichinter->statut == 0 && $user->rights->ficheinter->supprimer) if ($fichinter->statut == 0 && $user->rights->ficheinter->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" ';
if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{ {
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_delete&confirm=yes'; $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\')"'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans("ConfirmDeleteIntervention").'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
} }
else else
{ {
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=delete"'; print 'href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=delete"';
} }
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }
} }
print '</div>'; print '</div>';
print '<table width="100%"><tr><td width="50%" valign="top">'; print '<table width="100%"><tr><td width="50%" valign="top">';
/* /*
* Documents générés * Documents générés
*/ */
$filename=sanitize_string($fichinter->ref); $filename=sanitize_string($fichinter->ref);
$filedir=$conf->fichinter->dir_output . "/".$fichinter->ref; $filedir=$conf->fichinter->dir_output . "/".$fichinter->ref;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id;
$genallowed=$user->rights->ficheinter->creer; $genallowed=$user->rights->ficheinter->creer;
$delallowed=$user->rights->ficheinter->supprimer; $delallowed=$user->rights->ficheinter->supprimer;
$genallowed=1; $genallowed=1;
$delallowed=1; $delallowed=1;
$var=true; $var=true;
print "<br>\n"; print "<br>\n";
$somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf); $somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf);
print "</td><td>"; print "</td><td>";
print "&nbsp;</td>"; print "&nbsp;</td>";
print "</tr></table>\n"; print "</tr></table>\n";
} }

View File

@ -18,7 +18,6 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* *
* This program is free software; you can redistribute it and/or modify * 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. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$ * $Id$
* $Source$
*/ */
/** /**

View File

@ -17,7 +17,6 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**
@ -67,7 +66,6 @@ class box_factures_fourn extends ModeleBoxes {
$this->info_box_head = array( $this->info_box_head = array(
'text' => $langs->trans("BoxTitleLastSupplierBills",$max), 'text' => $langs->trans("BoxTitleLastSupplierBills",$max),
'limit'=> strlen($text)
); );
if ($user->rights->fournisseur->facture->lire) if ($user->rights->fournisseur->facture->lire)

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* 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
@ -17,7 +17,6 @@
* or see http://www.gnu.org/ * or see http://www.gnu.org/
* *
* $Id$ * $Id$
* $Source$
*/ */
/** /**
@ -108,7 +107,8 @@ class ModeleBoxes
$bcx[1] = 'class="box_impair"'; $bcx[1] = 'class="box_impair"';
$var = true; $var = true;
$nbcol=sizeof($contents[0])+1; $nbcol=0;
if (isset($contents[0])) $nbcol=sizeof($contents[0])+1;
$nblines=sizeof($contents); $nblines=sizeof($contents);
print "\n\n<!-- Box start -->\n"; print "\n\n<!-- Box start -->\n";
@ -126,8 +126,8 @@ class ModeleBoxes
{ {
print '<table class="nobordernopadding" width="100%"><tr><td align="left">'; print '<table class="nobordernopadding" width="100%"><tr><td align="left">';
} }
print dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX); if (isset($head['text'])) print dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX);
if ($head['sublink']) if (isset($head['sublink']) && $head['sublink'])
{ {
print ' <a href="'.$head['sublink'].'" target="_new">'.img_picto($head['subtext'],$head['subpicto']).'</a>'; print ' <a href="'.$head['sublink'].'" target="_new">'.img_picto($head['subtext'],$head['subpicto']).'</a>';
} }

View File

@ -18,7 +18,6 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**
@ -205,7 +204,7 @@ if ($user->societe_id == 0)
{ {
$classe=$classes[$key]; $classe=$classes[$key];
// Cherche dans cache si le load_state_board deja réalisé // 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]); include_once($includes[$key]);
@ -248,7 +247,7 @@ $var=true;
// //
// Nbre actions à faire (en retard) // 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"); include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
$board=new ActionComm($db); $board=new ActionComm($db);

View File

@ -23,7 +23,6 @@
* or see http://www.gnu.org/ * or see http://www.gnu.org/
* *
* $Id$ * $Id$
* $Source$
*/ */
/** /**
@ -163,26 +162,26 @@ function sanitize_string($str)
\brief Envoi des messages dolibarr dans un fichier ou dans syslog \brief Envoi des messages dolibarr dans un fichier ou dans syslog
Pour fichier: fichier défini par SYSLOG_FILE Pour fichier: fichier défini par SYSLOG_FILE
Pour syslog: facility défini par SYSLOG_FACILITY 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 \param level Niveau de l'erreur
\remarks Cette fonction n'a un effet que si le module syslog est activé. \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 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, fautes de protection mémoire. Pour résoudre, utiliser le loggage fichier,
au lieu du loggage syslog (configuration du module). au lieu du loggage syslog (configuration du module).
Si SYSLOG_FILE_NO_ERROR défini, on ne gère pas erreur ecriture log 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) function dolibarr_syslog($message, $level=LOG_INFO)
{ {
global $conf,$user,$langs; 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"; //print $level.' - '.$conf->global->SYSLOG_LEVEL.' - '.$conf->syslog->enabled." \n";
if ($level > $conf->global->SYSLOG_LEVEL) return; if ($level > $conf->global->SYSLOG_LEVEL) return;
// Traduction du message // Traduction du message
if ($level == LOG_ERROR) if ($level == LOG_ERR)
{ {
$langs->load("errors"); $langs->load("errors");
if ($message != $langs->trans($message)) $message = $langs->trans($message); if ($message != $langs->trans($message)) $message = $langs->trans($message);

View File

@ -21,7 +21,6 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**
@ -798,7 +797,8 @@ function top_menu($head, $title="", $target="")
$title.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dolibarr_print_date($user->datelastlogin,"dayhour"); $title.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dolibarr_print_date($user->datelastlogin,"dayhour");
if ($dolibarr_main_authentication) $title.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$dolibarr_main_authentication; if ($dolibarr_main_authentication) $title.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$dolibarr_main_authentication;
$text.='<a href="'.DOL_URL_ROOT.'/user/logout.php"'; $text='';
$text.='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
$text.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):''; $text.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
$text.='>'; $text.='>';
$text.='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"'; $text.='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';

View File

@ -59,7 +59,7 @@ else
} }
// Forcage du parametrage PHP error_reporting (Dolibarr non utilisable en mode error E_ALL) // Forcage du parametrage PHP error_reporting (Dolibarr non utilisable en mode error E_ALL)
// error_reporting(E_ALL); //error_reporting(E_ALL);
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
// Test si install ok // Test si install ok
@ -112,7 +112,7 @@ if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.inc.php"))
// on décode le mot de passe de la base si besoin // on décode le mot de passe de la base si besoin
require_once(DOL_DOCUMENT_ROOT ."/lib/functions.inc.php"); require_once(DOL_DOCUMENT_ROOT ."/lib/functions.inc.php");
if ($dolibarr_main_db_encrypted_pass) $dolibarr_main_db_pass = dolibarr_decode($dolibarr_main_db_encrypted_pass); if (isset($dolibarr_main_db_encrypted_pass) && $dolibarr_main_db_encrypted_pass) $dolibarr_main_db_pass = dolibarr_decode($dolibarr_main_db_encrypted_pass);
require_once(DOL_DOCUMENT_ROOT."/conf/conf.class.php"); require_once(DOL_DOCUMENT_ROOT."/conf/conf.class.php");

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com> * Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be> * Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
* *
@ -20,7 +20,6 @@
* 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$ * $Id$
* $Source$
*/ */
/** /**
@ -57,7 +56,7 @@ function llxHeader($head = "")
$menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); $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"); $langs->load("commercial");
$menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial")); $menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial"));

View File

@ -682,8 +682,7 @@ class Product
$sql.= " AND pfp.rowid = ".$prodfournprice; $sql.= " AND pfp.rowid = ".$prodfournprice;
$sql.= " AND pfp.quantity <= ".$qty; $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); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -699,7 +698,7 @@ class Product
else else
{ {
// On refait le meme select sur la ref et l'id du produit // 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.= " pf.fk_product, pf.ref_fourn";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."product_fournisseur as pf"; $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"; $sql.= " WHERE pf.rowid = pfp.fk_product_fournisseur";
@ -709,6 +708,7 @@ class Product
$sql.= " ORDER BY pfp.quantity DESC"; $sql.= " ORDER BY pfp.quantity DESC";
$sql.= " LIMIT 1"; $sql.= " LIMIT 1";
dolibarr_syslog("Product::get_buyprice sql=".$sql);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -495,22 +495,26 @@ class User
$i = 0; $i = 0;
while ($i < $num) 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] || if (! isset($this->rights->$module) ||
(is_object($this->rights->$row[0]) && ! $this->rights->$row[0]->$row[1]) || (is_object($this->rights->$module) && ! isset($this->rights->$module->$perms)) ||
(is_object($this->rights->$row[0]->$row[1])) ) (is_object($this->rights->$module->$perms)) )
{ {
$this->rights->$row[0]->$row[1]->$row[2] = 1; $this->rights->$module->$perms->$subperms = 1;
} }
} }
else else
{ {
$this->rights->$row[0]->$row[1] = 1; $this->rights->$module->$perms = 1;
} }
} }