From bbcefa886493d7f1b587561cbbdd7fba0d3198a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2009 12:16:45 +0000 Subject: [PATCH] Qual: Uniformize code (navigation on objects) Qual: Code to support filter on entity on objects navigation is simpler. --- htdocs/comm/propal/contact.php | 25 ++-- htdocs/comm/propal/document.php | 46 +++++-- htdocs/comm/propal/note.php | 43 ++++-- htdocs/commande/commande.class.php | 1 + htdocs/commonobject.class.php | 27 ++-- htdocs/compta/facture.php | 2 +- htdocs/compta/facture/contact.php | 31 +++-- htdocs/compta/facture/document.php | 37 +++-- htdocs/compta/facture/info.php | 10 +- htdocs/compta/facture/note.php | 39 ++++-- htdocs/compta/propal.php | 7 +- htdocs/facture.class.php | 1 + htdocs/fourn/commande/fiche.php | 3 +- htdocs/fourn/fiche.php | 141 ++++++++++---------- htdocs/fourn/fournisseur.commande.class.php | 8 +- htdocs/fourn/fournisseur.facture.class.php | 4 + htdocs/html.form.class.php | 7 +- htdocs/html.formfile.class.php | 8 +- htdocs/includes/menus/init_menu_auguria.sql | 4 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/lib/files.lib.php | 6 +- htdocs/lib/fourn.lib.php | 22 ++- htdocs/lib/invoice.lib.php | 6 +- htdocs/lib/order.lib.php | 10 +- htdocs/lib/propal.lib.php | 6 +- htdocs/product.class.php | 3 +- htdocs/propal.class.php | 1 + htdocs/user.class.php | 3 +- htdocs/usergroup.class.php | 8 +- 30 files changed, 320 insertions(+), 191 deletions(-) diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 125c5a6f28d..c5273bddd2a 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/comm/propal/contact.php - \ingroup propal - \brief Onglet de gestion des contacts de propal - \version $Id$ -*/ + * \file htdocs/comm/propal/contact.php + * \ingroup propal + * \brief Onglet de gestion des contacts de propal + * \version $Id$ + */ require ("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); @@ -162,11 +162,12 @@ $contactstatic=new Contact($db); /* *************************************************************************** */ if (isset($mesg)) print $mesg; -$id = $_GET["propalid"]; -if ($id > 0) +$id = $_GET['propalid']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { $propal = New Propal($db); - if ( $propal->fetch($_GET['propalid']) > 0) + if ( $propal->fetch($id,$ref) > 0) { $soc = new Societe($db, $propal->socid); $soc->fetch($propal->socid); @@ -181,10 +182,12 @@ if ($id > 0) */ print ''; + $linkback="".$langs->trans("BackToList").""; + // Ref - print '"; + print ''; // Ref client print ''; diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php index 9b32984f4dc..6a13a9f1f45 100644 --- a/htdocs/fourn/fournisseur.commande.class.php +++ b/htdocs/fourn/fournisseur.commande.class.php @@ -36,15 +36,17 @@ require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); */ class CommandeFournisseur extends Commande { + var $id ; var $db ; var $error; + var $element='order_supplier'; var $table_element='commande_fournisseur'; var $table_element_line = 'commande_fournisseurdet'; var $fk_element = 'fk_commande'; - var $table_optional = 'societe as s'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id ; + var $ref; var $brouillon; @@ -120,8 +122,6 @@ class CommandeFournisseur extends Commande $this->note_public = $obj->note_public; $this->modelpdf = $obj->model_pdf; - $this->next_prev_filter = 'fk_soc = s.rowid AND s.entity = '.$conf->entity; - $this->db->free(); if ($this->statut == 0) $this->brouillon = 1; diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php index dbf3c7dd01b..88a2cd0b468 100644 --- a/htdocs/fourn/fournisseur.facture.class.php +++ b/htdocs/fourn/fournisseur.facture.class.php @@ -38,11 +38,13 @@ class FactureFournisseur extends Facture { var $id; var $db; + var $error; var $element='facture_fourn'; var $table_element='facture_fourn'; var $table_element_line='facture_fourn_det'; var $fk_element='fk_facture_fourn'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $ref; var $ref_supplier; @@ -212,6 +214,8 @@ class FactureFournisseur extends Facture */ function fetch($rowid) { + global $conf; + $sql = 'SELECT libelle, facnumber, amount, remise, '.$this->db->pdate(datef).'as df,'; $sql.= ' total_ht, total_tva, total_ttc, fk_user_author,'; $sql.= ' fk_statut, fk_projet as fk_project, paye, f.note, f.note_public,'; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index a2048703a62..2ad74cb1b61 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2720,7 +2720,7 @@ class Form 4=>$langs->trans("Day4"), 5=>$langs->trans("Day5"), 6=>$langs->trans("Day6")); - + $select_week = ''; return $select_week; } - + /** * \brief Return HTML combo list of month * \param selected Preselected value @@ -2773,7 +2773,7 @@ class Form $select_month .= ''; return $select_month; } - + /** * \brief Return HTML combo list of years * \param selected Preselected value @@ -2826,6 +2826,7 @@ class Form { $ret=''; + //print "$paramid,$morehtml,$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; $object->load_previous_next_ref($object->next_prev_filter,$fieldid); $previous_ref = $object->ref_previous?''.img_previous().'':''; $next_ref = $object->ref_next?''.img_next().'':''; diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php index 61cd3154f95..44bfb2c308a 100644 --- a/htdocs/html.formfile.class.php +++ b/htdocs/html.formfile.class.php @@ -121,7 +121,7 @@ class FormFile /** - * \brief Affiche la cartouche de la liste des documents d'une propale, facture... + * \brief Show the box with list of available documents for object * \param modulepart propal=propal, facture=facture, ... * \param filename Sub dir to scan (use '' if filedir already complete) * \param filedir Dir to scan @@ -130,8 +130,8 @@ class FormFile * \param delallowed Remove is allowed (1/0) * \param modelselected Model to preselect by default * \param modelliste Tableau des modeles possibles. Use '' to hide combo select list. - * \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS defini - * \param iconPDF N'affiche que l'icone PDF avec le lien (1/0) + * \param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) + * \param iconPDF Show only PDF icon with link (1/0) * \param maxfilenamelength Max length for filename shown * \param noform Do not output html form start and end * \param param More param on http links @@ -295,7 +295,7 @@ class FormFile print ''; print ''; - print_titre($langs->trans("BuildDocuments")); + print_titre($langs->trans("Documents")); print '
'.$langs->trans("Ref").''; - print $propal->ref; - print "
'.$langs->trans('Ref').''; + print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref',''); + print '
'; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 1744b1fc524..e6fb8936c63 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -20,11 +20,11 @@ */ /** - \file htdocs/comm/propal/document.php - \ingroup propale - \brief Page de gestion des documents attach�es � une proposition commerciale - \version $Id$ -*/ + * \file htdocs/comm/propal/document.php + * \ingroup propale + * \brief Page de gestion des documents attach�es � une proposition commerciale + * \version $Id$ + */ require('./pre.inc.php'); require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); @@ -109,15 +109,19 @@ if ($action=='delete') /* - * Affichage + * View */ llxHeader(); -if ($propalid > 0) +$html = new Form($db); + +$id = $_GET['propalid']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { $propal = new Propal($db); - if ($propal->fetch($propalid)) + if ($propal->fetch($id,$ref)) { $upload_dir = $conf->propale->dir_output.'/'.dol_sanitizeFileName($propal->ref); @@ -139,11 +143,29 @@ if ($propalid > 0) print ''; - // Ref - print ''; + $linkback="".$langs->trans("BackToList").""; - // Soci�t� - print ''; + // Ref + print ''; + + // Ref client + print ''; + print ''; + + // Customer + if ( is_null($propal->client) ) + $propal->fetch_client(); + print ""; + print ''; print ''; print ''; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 70781a9fa51..cdf9c01d14b 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * @@ -20,10 +20,10 @@ */ /** - \file htdocs/comm/propal/note.php - \ingroup propale - \brief Fiche d'information sur une proposition commerciale - \version $Id$ + * \file htdocs/comm/propal/note.php + * \ingroup propale + * \brief Fiche d'information sur une proposition commerciale + * \version $Id$ */ require('./pre.inc.php'); @@ -94,14 +94,16 @@ llxHeader(); $html = new Form($db); -if ($_GET['propalid']) +$id = $_GET['propalid']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { if ($mesg) print $mesg; $now=gmmktime(); $propal = new Propal($db); - if ( $propal->fetch($_GET['propalid']) ) + if ($propal->fetch($id, $ref)) { $societe = new Societe($db); if ( $societe->fetch($propal->socid) ) @@ -111,10 +113,29 @@ if ($_GET['propalid']) print '
'.$langs->trans('Ref').''.$propal->ref.'
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans('Ref').''; + print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref',''); + print '
'; + print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print '
'; + print '
'; + print $propal->ref_client; + print '
".$langs->trans("Company")."'.$propal->client->getNomUrl(1).'
'.$langs->trans("NbOfAttachedFiles").''.sizeof($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - print ''; + $linkback="".$langs->trans("BackToList").""; - // Societe - print ''; + // Ref + print ''; + + // Ref client + print ''; + print ''; + + // Customer + if ( is_null($propal->client) ) + $propal->fetch_client(); + print ""; + print ''; // Ligne info remises tiers print ''; diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index a0876250a77..7bc39f37caa 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -42,6 +42,7 @@ class Commande extends CommonObject var $table_element='commande'; var $table_element_line = 'commandedet'; var $fk_element = 'fk_commande'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id ; diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 7469857f555..aa9d5739ed6 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -406,22 +406,29 @@ class CommonObject /** * \brief Load properties id_previous and id_next * \param filter Optional filter - * \param fieldid Nom du champ a utiliser pour select next et previous - * \return int <0 if KO, >0 if OK + * \param fieldid Name of field to use for the select MAX and MIN + * \return int <0 if KO, >0 if OK */ function load_previous_next_ref($filter='',$fieldid) { + global $conf; + if (! $this->table_element) { dol_syslog("CommonObject::load_previous_next was called on objet with property table_element not defined", LOG_ERR); return -1; } + // this->ismultientitymanaged contains + // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + $sql = "SELECT MAX(".$fieldid.")"; - $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; - if ($this->table_optional) $sql.= ", ".MAIN_DB_PREFIX.$this->table_optional; - $sql.= " WHERE ".$fieldid." < '".addslashes($this->ref)."'"; + $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as te"; + if ($this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity + $sql.= " WHERE te.".$fieldid." < '".addslashes($this->ref)."'"; if (isset($filter)) $sql.=" AND ".$filter; + if ($this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity + if ($this->ismultientitymanaged > 0) $sql.= ' AND entity IN (0,'.$conf->entity.')'; //print $sql."
"; $result = $this->db->query($sql) ; @@ -435,11 +442,13 @@ class CommonObject $sql = "SELECT MIN(".$fieldid.")"; - $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; - if ($this->table_optional) $sql.= ", ".MAIN_DB_PREFIX.$this->table_optional; - $sql.= " WHERE ".$fieldid." > '".addslashes($this->ref)."'"; + $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as te"; + if ($this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity + $sql.= " WHERE te.".$fieldid." > '".addslashes($this->ref)."'"; if (isset($filter)) $sql.=" AND ".$filter; - // Rem: Bug in some mysql version: SELECT rowid FROM llx_socpeople WHERE rowid > 1 when one row in database with rowid=1, returns 1 instead of null + if ($this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity + if ($this->ismultientitymanaged > 0) $sql.= ' AND entity IN (0,'.$conf->entity.')'; + // Rem: Bug in some mysql version: SELECT MIN(rowid) FROM llx_socpeople WHERE rowid > 1 when one row in database with rowid=1, returns 1 instead of null //print $sql."
"; $result = $this->db->query($sql) ; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d727ba5dab0..c708d0ab8cc 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1977,7 +1977,7 @@ else $facstatic = new Facture($db); $fac = new Facture($db); - $result=$fac->fetch($_GET['facid'],$_GET['ref']); + $result=$fac->fetch($id,$ref); if ($result > 0) { if ($user->societe_id>0 && $user->societe_id!=$fac->socid) accessforbidden('',0); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index cd50321aa01..7114ac3a1d3 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -27,6 +27,7 @@ require ("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/discount.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/html.formcompany.class.php'); @@ -159,11 +160,13 @@ $contactstatic=new Contact($db); /* */ /* *************************************************************************** */ if (isset($mesg)) print $mesg; -$id = $_GET["facid"]; -if ($id > 0) + +$id = $_GET['facid']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { - $facture = New Facture($db); - if ( $facture->fetch($_GET['facid'], $user->societe_id) > 0) + $facture = new Facture($db); + if ($facture->fetch($id, $ref) > 0) { $facture->fetch_client(); @@ -176,10 +179,22 @@ if ($id > 0) */ print '
'.$langs->trans('Ref').''.$propal->ref.'
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans('Ref').''; + print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref',''); + print '
'; + print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print '
'; + print '
'; + print $propal->ref_client; + print '
".$langs->trans("Company")."'.$propal->client->getNomUrl(1).'
'.$langs->trans('Discounts').''; @@ -122,7 +143,7 @@ if ($_GET['propalid']) else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$societe->getAvailableDiscounts(); print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie)); + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print '
'; - // Reference du facture - print '"; + // Ref + print ''; + print ''; // Customer print ""; diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index bff24e396e1..f00c9e1e1cd 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -20,14 +20,15 @@ */ /** - \file htdocs/compta/facture/document.php - \ingroup facture - \brief Page de gestion des documents attach�es � une facture - \version $Id$ + * \file htdocs/compta/facture/document.php + * \ingroup facture + * \brief Page for attached files on invoices + * \version $Id$ */ require('./pre.inc.php'); require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/discount.class.php'); require_once(DOL_DOCUMENT_ROOT."/lib/invoice.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); @@ -109,15 +110,19 @@ if ($action=='delete') } /* - * Affichage + * View */ llxHeader(); -if ($facid > 0) +$html = new Form($db); + +$id = $_GET['facid']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { $facture = new Facture($db); - if ($facture->fetch($facid)) + if ($facture->fetch($id,$ref) > 0) { $upload_dir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($facture->ref); @@ -141,9 +146,23 @@ if ($facid > 0) print '
'.$langs->trans("Ref").''; - print $facture->ref; - print "
'.$langs->trans('Ref').''; + $morehtmlref=''; + $discount=new DiscountAbsolute($db); + $result=$discount->fetch(0,$facture->id); + if ($result > 0) + { + $morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')'; + } + if ($result < 0) + { + dol_print_error('',$discount->error); + } + print $html->showrefnav($facture,'ref','',1,'facnumber','ref',$morehtmlref); + print '
".$langs->trans("Company")."
'; // Ref - print ''; + print ''; + print ''; - // Soci�t� + // Company print ''; print ''; diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index f181ea60961..a685940406f 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -18,13 +18,15 @@ */ /** - \file htdocs/compta/facture/info.php - \ingroup facture - \brief Page des informations d'une facture - \version $Id$ + * \file htdocs/compta/facture/info.php + * \ingroup facture + * \brief Page des informations d'une facture + * \version $Id$ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/discount.class.php'); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 6f3a6ca831a..2217601b2a6 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -18,13 +18,15 @@ */ /** - \file htdocs/compta/facture/note.php - \ingroup facture - \brief Fiche de notes sur une facture - \version $Id$ + * \file htdocs/compta/facture/note.php + * \ingroup facture + * \brief Fiche de notes sur une facture + * \version $Id$ */ require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/discount.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); $socid=isset($_GET["socid"])?$_GET["socid"]:isset($_POST["socid"])?$_POST["socid"]:""; @@ -93,9 +95,14 @@ llxHeader(); $html = new Form($db); -if ($_GET["facid"]) +$id = $_GET['facid']; +$ref= $_GET['ref']; +if ($id > 0 || ! empty($ref)) { - $soc = new Societe($db, $fac->socid); + $fac = new Facture($db); + $fac->fetch($id,$ref); + + $soc = new Societe($db, $fac->socid); $soc->fetch($fac->socid); $head = facture_prepare_head($fac); @@ -104,10 +111,24 @@ if ($_GET["facid"]) print '
'.$langs->trans('Ref').''.$facture->ref.'
'.$langs->trans('Ref').''; + $morehtmlref=''; + $discount=new DiscountAbsolute($db); + $result=$discount->fetch(0,$facture->id); + if ($result > 0) + { + $morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')'; + } + if ($result < 0) + { + dol_print_error('',$discount->error); + } + print $html->showrefnav($facture,'ref','',1,'facnumber','ref',$morehtmlref); + print '
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans("NbOfAttachedFiles").''.sizeof($filearray).'
'; - // Reference - print ''; + // Ref + print ''; + print ''; - // Soci�t� + // Company print ''; print ''; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index f48f53e3286..06d5bdc09b1 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -151,15 +151,14 @@ if ($id > 0 || ! empty($ref)) /* - * Fiche propal - * + * Proposal card */ print '
'.$langs->trans('Ref').''.$fac->ref.'
'.$langs->trans('Ref').''; + $morehtmlref=''; + $discount=new DiscountAbsolute($db); + $result=$discount->fetch(0,$fac->id); + if ($result > 0) + { + $morehtmlref=' ('.$langs->trans("CreditNoteConvertedIntoDiscount",$discount->getNomUrl(1,'discount')).')'; + } + if ($result < 0) + { + dol_print_error('',$discount->error); + } + print $html->showrefnav($fac,'ref','',1,'facnumber','ref',$morehtmlref); + print '
'.$langs->trans("Company").''.$soc->getNomUrl(1,'compta').'
'; - $linkback="".$langs->trans("BackToList").""; + $linkback="".$langs->trans("BackToList").""; // Ref - print ''; diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 06789e71705..8881212ee14 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -47,6 +47,7 @@ class Facture extends CommonObject var $table_element='facture'; var $table_element_line = 'facturedet'; var $fk_element = 'fk_facture'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $table; var $tabledetail; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 5ad227ce788..9762e5ffaac 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -478,7 +478,6 @@ if ($_GET["action"] == 'create') llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur"); - $html = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); @@ -501,7 +500,7 @@ if ($id > 0 || ! empty($ref)) $commande = new CommandeFournisseur($db); - $result=$commande->fetch($_REQUEST['id'],$_REQUEST['ref']); + $result=$commande->fetch($id,$ref); if ($result >= 0) { $soc = new Societe($db); diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 94de948446b..c7583b086c7 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -94,10 +94,10 @@ if ( $societe->fetch($socid) ) // Phone print ''; - + // Fax print ''; - + // EMail print ''; @@ -140,114 +140,107 @@ if ( $societe->fetch($socid) ) print '
'.$langs->trans('Ref').''; + print '
'.$langs->trans('Ref').''; print $html->showrefnav($propal,'ref',$linkback,1,'ref','ref',''); print '
'.$langs->trans("Phone").''.dol_print_phone($societe->tel,$societe->pays_code,0,$societe->id,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($societe->fax,$societe->pays_code,0,$societe->id,'AC_FAX').'
'.$langs->trans('EMail').''.dol_print_email($societe->email,0,$societe->id,'AC_EMAIL').'
'; } - + print '
'; /* - * Liste des commandes associees + * Last orders */ $orderstatic = new CommandeFournisseur($db); - $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut"; - $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p "; - $sql.= " WHERE p.fk_soc =".$societe->id; - $sql.= " ORDER BY p.date_commande DESC"; - $sql.= " ".$db->plimit($MAXLIST); - $resql=$db->query($sql); - if ($resql) + if ($user->rights->fournisseur->commande->lire) { - $i = 0 ; - $num = $db->num_rows($resql); - if ($num > 0) + $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p "; + $sql.= " WHERE p.fk_soc =".$societe->id; + $sql.= " ORDER BY p.date_commande DESC"; + $sql.= " ".$db->plimit($MAXLIST); + $resql=$db->query($sql); + if ($resql) { + $i = 0 ; + $num = $db->num_rows($resql); print ''; print ''; print ''; - } - while ($i < $num && $i <= $MAXLIST) - { - $obj = $db->fetch_object($resql); - $var=!$var; + while ($i < $num && $i <= $MAXLIST) + { + $obj = $db->fetch_object($resql); + $var=!$var; - print ""; - print ''; - print '"; + print ''; + print ''; + print ''; + print ''; + $i++; } - else - { - print "-"; - } - print ''; - print ''; - print ''; - $i++; - } - $db->free($resql); - if ($num > 0) - { + $db->free($resql); print "
'; print ''; print '
'.$langs->trans("LastOrders",($num<$MAXLIST?$num:$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')
'; print '
'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.''; - if ($obj->dc) - { - print dol_print_date($obj->dc,'day'); + print "
'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.''; + if ($obj->dc) + { + print dol_print_date($obj->dc,'day'); + } + else + { + print "-"; + } + print ''.$orderstatic->LibStatut($obj->fk_statut,5).'
'.$orderstatic->LibStatut($obj->fk_statut,5).'
"; } + else + { + dol_print_error($db); + } } - else - { - dol_print_error($db); - } - /* - * Liste des factures associees + * Last invoices */ $MAXLIST=5; $langs->load('bills'); $facturestatic = new FactureFournisseur($db); - $sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p'; - $sql.= ' WHERE p.fk_soc = '.$societe->id; - $sql.= ' ORDER BY p.datef DESC'; - $resql=$db->query($sql); - if ($resql) + if ($user->rights->fournisseur->facture->lire) { - $i = 0 ; - $num = $db->num_rows($resql); - if ($num > 0) + $sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p'; + $sql.= ' WHERE p.fk_soc = '.$societe->id; + $sql.= ' ORDER BY p.datef DESC'; + $resql=$db->query($sql); + if ($resql) { + $i = 0 ; + $num = $db->num_rows($resql); print ''; print ''; print ''; - } - while ($i < min($num,$MAXLIST)) - { - $obj = $db->fetch_object($resql); - $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $i++; - } - $db->free($resql); - if ($num > 0) - { + while ($i < min($num,$MAXLIST)) + { + $obj = $db->fetch_object($resql); + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $i++; + } + $db->free($resql); print '
'; print '
'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' ('.$num.')
'; print '
'; - print ''; - print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dol_trunc($obj->libelle,14).''.dol_print_date($obj->df,'day').''.price($obj->amount).''.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).'
'; + print ''; + print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dol_trunc($obj->libelle,14).''.dol_print_date($obj->df,'day').''.price($obj->amount).''.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,5).'
'; } - } - else - { - dol_print_error($db); + else + { + dol_print_error($db); + } } print '
'; print ''; diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql index 09bc82b7d58..d7b4eee6c6b 100644 --- a/htdocs/includes/menus/init_menu_auguria.sql +++ b/htdocs/includes/menus/init_menu_auguria.sql @@ -112,10 +112,10 @@ insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3302__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/liste.php', 'List', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 1, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3303__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/contact/index.php?leftmenu=supplier&type=f', 'Contacts', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 2, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3304__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/stats.php', 'Statistics', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 3, __ENTITY__); -insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3400__+MAX_llx_menu__, 'suppliers', '', 4__+MAX_llx_menu__, '/fourn/facture/index.php', 'Bills', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3400__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/facture/index.php', 'Bills', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 4, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3401__+MAX_llx_menu__, 'suppliers', '', 3400__+MAX_llx_menu__, '/fourn/facture/fiche.php?action=create', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3402__+MAX_llx_menu__, 'suppliers', '', 3400__+MAX_llx_menu__, '/fourn/facture/paiement.php', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3500__+MAX_llx_menu__, 'suppliers', '', 4__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=suppliers', 'Orders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 2, __ENTITY__); +insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3500__+MAX_llx_menu__, 'suppliers', '', 3300__+MAX_llx_menu__, '/fourn/commande/index.php?leftmenu=suppliers', 'Orders', 0, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 5, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3501__+MAX_llx_menu__, 'suppliers', '', 3500__+MAX_llx_menu__, '/societe.php?leftmenu=supplier', 'NewOrder', 1, 'orders', '$user->rights->fournisseur->commande->creer', '', 2, 0, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled', 'auguria', 'left', 3502__+MAX_llx_menu__, 'suppliers', '', 3500__+MAX_llx_menu__, '/fourn/commande/liste.php?leftmenu=suppliers', 'List', 1, 'orders', '$user->rights->fournisseur->commande->lire', '', 2, 1, __ENTITY__); insert into `llx_menu` (`enabled`, `menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position, entity) values ('$conf->fournisseur->enabled && $conf->categorie->enabled', 'auguria', 'left', 4900__+MAX_llx_menu__, 'suppliers', '', 4__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=1', 'Categories', 0, 'categories', '$user->rights->categorie>lire', '', 2, 3, __ENTITY__); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ea663d2fb15..aefd418c652 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -497,6 +497,7 @@ Canceled=Canceled YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary Color=Color Documents=Linked files +DocumentsNb=Linked files (%s) Documents2=Documents BuildDocuments=Generated documents UploadDisabled=Upload disabled diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index b1725235634..cbcd05638b5 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -496,6 +496,7 @@ Canceled=Annulé YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires Color=Couleur Documents=Fichiers joints +DocumentsNb=Fichiers joints (%s) Documents2=Documents BuildDocuments=Documents générés UploadDisabled=Transfert désactivé diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 9329b17e311..a2baf32a1b6 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -32,7 +32,7 @@ * \param $exludefilter Regex for exclude filter (example: '\.meta$') * \param $sortcriteria Sort criteria ("name","date","size") * \param $sortorder Sort order (SORT_ASC, SORT_DESC) - * \param $mode 0=Return array with only keys needed, 1=Force all keys to be loaded + * \param $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower) * \return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file') */ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0) @@ -189,7 +189,7 @@ function dol_mimetype($file) /** * \brief Test if a folder is empty * \param folder Name of folder - * \return boolean True if dir is empty or non-existing, false if it contains files + * \return boolean True if dir is empty or non-existing, False if it contains files */ function dol_dir_is_emtpy($folder) { @@ -210,7 +210,7 @@ function dol_dir_is_emtpy($folder) closedir($handle); } else - return true; // Le repertoire n'existe pas + return true; // Dir does not exists } /** diff --git a/htdocs/lib/fourn.lib.php b/htdocs/lib/fourn.lib.php index eeb28facd23..2043ae7f36b 100644 --- a/htdocs/lib/fourn.lib.php +++ b/htdocs/lib/fourn.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006 Marc Barilley / Ocebo +/* Copyright (C) 2005-2009 Laurent Destailleur + * Copyright (C) 2006 Marc Barilley / Ocebo * * 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 @@ -19,10 +19,10 @@ */ /** - \file htdocs/lib/fourn.lib.php - \brief Ensemble de fonctions de base pour le module fournisseur - \version $Id$ -*/ + * \file htdocs/lib/fourn.lib.php + * \brief Ensemble de fonctions de base pour le module fournisseur + * \version $Id$ + */ function facturefourn_prepare_head($fac) { @@ -46,6 +46,10 @@ function facturefourn_prepare_head($fac) $h++; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$fac->id; + /*$filesdir = $conf->fournisseur->dir_output.'/facture/'.get_exdir($fac->id,2).$fac->id; + include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); + $listoffiles=dol_dir_list($filesdir,'files',1); + $head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); $head[$h][2] = 'documents'; $h++; @@ -107,7 +111,11 @@ function ordersupplier_prepare_head($commande) $h++; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$commande->id; - $head[$h][1] = $langs->trans("Documents"); + /*$filesdir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref); + include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); + $listoffiles=dol_dir_list($filesdir,'files',1); + $head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/ + $head[$h][1] = $langs->trans('Documents'); $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/lib/invoice.lib.php b/htdocs/lib/invoice.lib.php index 8deb714aa40..80bb2d58d1a 100644 --- a/htdocs/lib/invoice.lib.php +++ b/htdocs/lib/invoice.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2009 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 @@ -64,6 +64,10 @@ function facture_prepare_head($fac) $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$fac->id; + /*$filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref); + include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); + $listoffiles=dol_dir_list($filesdir,'files',1); + $head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/lib/order.lib.php b/htdocs/lib/order.lib.php index 3f9e5529005..5e0a8baa6ae 100644 --- a/htdocs/lib/order.lib.php +++ b/htdocs/lib/order.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007 Rodolphe Quiedeville +/* Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2007 Rodolphe Quiedeville * * 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 @@ -53,7 +53,7 @@ function commande_prepare_head($commande) $h++; } - // Commande à facturer + // Commande a facturer if ($conf->facture->enabled) { $head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id; @@ -76,6 +76,10 @@ function commande_prepare_head($commande) $h++; $head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$commande->id; + /*$filesdir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($commande->ref); + include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); + $listoffiles=dol_dir_list($filesdir,'files',1); + $head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/lib/propal.lib.php b/htdocs/lib/propal.lib.php index 925b276250f..33e16d010ac 100644 --- a/htdocs/lib/propal.lib.php +++ b/htdocs/lib/propal.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2009 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 @@ -77,6 +77,10 @@ function propal_prepare_head($propal) $h++; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?propalid='.$propal->id; + /*$filesdir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($propal->ref); + include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); + $listoffiles=dol_dir_list($filesdir,'files',1); + $head[$h][1] = (sizeof($listoffiles)?$langs->trans('DocumentsNb',sizeof($listoffiles)):$langs->trans('Documents'));*/ $head[$h][1] = $langs->trans('Documents'); $head[$h][2] = 'document'; $h++; diff --git a/htdocs/product.class.php b/htdocs/product.class.php index f55bcb2d593..3155600d843 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -42,6 +42,7 @@ class Product extends CommonObject var $errno = 0; var $element='product'; var $table_element='product'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe //! Identifiant unique var $id ; @@ -971,8 +972,6 @@ class Product extends CommonObject $this->import_key = $result["import_key"]; - $this->next_prev_filter = 'entity = '.$conf->entity; - $this->db->free(); // multilangs diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index ea6b53a5441..764a9a5cc88 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -48,6 +48,7 @@ class Propal extends CommonObject var $table_element='propal'; var $table_element_line='propaldet'; var $fk_element='fk_propal'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; diff --git a/htdocs/user.class.php b/htdocs/user.class.php index eb55390c942..45d3663f749 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -49,6 +49,7 @@ class User extends CommonObject var $errors=array(); var $element='user'; var $table_element='user'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id=0; var $ldap_sid; @@ -211,8 +212,6 @@ class User extends CommonObject $this->contact_id = $obj->fk_socpeople; $this->fk_member = $obj->fk_member; - $this->next_prev_filter = 'entity IN (0,'.$conf->entity.')'; - if (! $this->lang) $this->lang='fr_FR'; $this->db->free($result); diff --git a/htdocs/usergroup.class.php b/htdocs/usergroup.class.php index 75c3ec949d8..ca9ce0b3bb4 100644 --- a/htdocs/usergroup.class.php +++ b/htdocs/usergroup.class.php @@ -28,16 +28,16 @@ if ($conf->ldap->enabled) require_once (DOL_DOCUMENT_ROOT."/lib/ldap.class.php") /** - \class UserGroup - \brief Classe permettant la gestion des groupes d'utilisateur + * \class UserGroup + * \brief Classe permettant la gestion des groupes d'utilisateur */ - class UserGroup extends CommonObject { var $db; // Database handler var $error; var $errors=array(); var $table_element='usergroup'; + var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; // Group id var $entity; // Entity of group @@ -94,8 +94,6 @@ class UserGroup extends CommonObject $this->datec = $obj->datec; $this->datem = $obj->datem; - $this->next_prev_filter = 'entity IN (0,'.$conf->entity.')'; - // Sav current LDAP Current DN //$this->ldap_dn = $this->_load_ldap_dn($this->_load_ldap_info(),0); }