2
0
forked from Wavyzz/dolibarr

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
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
*
* 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 '<td width="20px">'.img_object('','account').'</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>';
$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)
{
@@ -269,6 +274,10 @@ else
print '<tr '.$bc[$var].'>';
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>';
$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)

View File

@@ -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;
}
}

View File

@@ -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<63>er une fonction debug g<>n<EFBFBD>rique
if ($conf->use_debug_mode)
{
@@ -457,49 +457,49 @@ elseif ($_GET["id"] > 0)
print $debug;
}
if ($mesg) print $mesg."<br>";
if ($mesg) print $mesg."<br>";
$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 '<br>';
}
/*
* 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 '<br>';
}
/*
* 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.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline');
print '<br>';
}
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$fichinter->ref.'</td></tr>';
// Societe
print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>";
// Date
print '<tr><td>';
$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 '<br>';
}
/*
* 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 '<br>';
}
/*
* 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.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline');
print '<br>';
}
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$fichinter->ref.'</td></tr>';
// Societe
print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>";
// Date
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Date');
print '</td>';
@@ -521,7 +521,7 @@ elseif ($_GET["id"] > 0)
print '</td>';
print '</tr>';
// Projet
// Projet
if ($conf->projet->enabled)
{
$langs->load("projects");
@@ -529,7 +529,7 @@ elseif ($_GET["id"] > 0)
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project').'</td>';
$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 '</tr>';
}
// Dur<75>e
print '<tr><td>'.$langs->trans("TotalDuration").'</td><td>'.$fichinter->duree.'</td></tr>';
// Description
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Description');
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>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editdescription')
{
print '<form name="editdescription" action="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'" method="post">';
print '<input type="hidden" name="action" value="setdescription">';
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 '<textarea name="description" wrap="soft" cols="70" rows="12">'.$fichinter->description.'</textarea>';
}
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print nl2br($fichinter->description);
}
print '</td>';
print '</tr>';
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut(4).'</td></tr>';
// Dur<75>e
print '<tr><td>'.$langs->trans("TotalDuration").'</td><td>'.$fichinter->duree.'</td></tr>';
// Description
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Description');
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>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editdescription')
{
print '<form name="editdescription" action="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'" method="post">';
print '<input type="hidden" name="action" value="setdescription">';
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 '<textarea name="description" wrap="soft" cols="70" rows="12">'.$fichinter->description.'</textarea>';
}
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
else
{
print nl2br($fichinter->description);
}
print '</td>';
print '</tr>';
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut(4).'</td></tr>';
print "</table><br>";
/*
* Lignes d'intervention
*/
print "</table><br>";
/*
* Lignes d'intervention
*/
print '<table class="noborder" width="100%">';
$sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang';
@@ -744,14 +744,14 @@ elseif ($_GET["id"] > 0)
print '</td>';
// Date d'intervention
print '<td>';
$html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention");
print '</td>';
// Dur<75>e
print '<td>';
$html->select_duree('duration',$objp->duree);
print '</td>';
print '<td>';
$html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention");
print '</td>';
// Dur<75>e
print '<td>';
$html->select_duree('duration',$objp->duree);
print '</td>';
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>';
@@ -829,69 +829,69 @@ elseif ($_GET["id"] > 0)
print "\n";
/**
* Barre d'actions
*
*/
print '<div class="tabsAction">';
/**
* Barre d'actions
*
*/
print '<div class="tabsAction">';
if ($user->societe_id == 0)
{
// Validate
if ($fichinter->statut == 0 && $user->rights->ficheinter->creer)
{
print '<a class="butAction" ';
if ($conf->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").'</a>';
}
// Delete
if ($fichinter->statut == 0 && $user->rights->ficheinter->supprimer)
{
print '<a class="butActionDelete" ';
if ($conf->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.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>';
}
}
print '</div>';
if ($user->societe_id == 0)
{
// Validate
if ($fichinter->statut == 0 && $user->rights->ficheinter->creer)
{
print '<a class="butAction" ';
if ($conf->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").'</a>';
}
// Delete
if ($fichinter->statut == 0 && $user->rights->ficheinter->supprimer)
{
print '<a class="butActionDelete" ';
if ($conf->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.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>';
}
}
print '</div>';
print '<table width="100%"><tr><td width="50%" valign="top">';
/*
* Documents g<>n<EFBFBD>r<EFBFBD>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 '<table width="100%"><tr><td width="50%" valign="top">';
/*
* Documents g<>n<EFBFBD>r<EFBFBD>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 "<br>\n";
$somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf);
print "<br>\n";
$somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf);
print "</td><td>";
print "&nbsp;</td>";
print "</tr></table>\n";
print "</td><td>";
print "&nbsp;</td>";
print "</tr></table>\n";
}

View File

@@ -18,7 +18,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/**

View File

@@ -1,6 +1,6 @@
<?php
/* 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>
*
* 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$
*/
/**

View File

@@ -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)

View File

@@ -1,5 +1,5 @@
<?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
* 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<!-- Box start -->\n";
@@ -126,8 +126,8 @@ class ModeleBoxes
{
print '<table class="nobordernopadding" width="100%"><tr><td align="left">';
}
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 ' <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.
*
* $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<69>
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 <20> 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);

View File

@@ -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<69>.
Warning, les fonctions syslog sont buggu<67>s sous Windows et g<>n<EFBFBD>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);

View File

@@ -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.='<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;
$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.='>';
$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)
// error_reporting(E_ALL);
//error_reporting(E_ALL);
error_reporting(E_ALL ^ E_NOTICE);
// 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
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");

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 <20>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 Guillaume Delecourt <guillaume.delecourt@opensides.be>
*
@@ -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"));

View File

@@ -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)
{

View File

@@ -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;
}
}