diff --git a/htdocs/adherents/adherent_type.class.php b/htdocs/adherents/adherent_type.class.php index 71b34d3fedd..8589f43dec3 100644 --- a/htdocs/adherents/adherent_type.class.php +++ b/htdocs/adherents/adherent_type.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 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 @@ -15,9 +15,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** @@ -25,20 +22,22 @@ \ingroup adherent \brief Fichier de la classe gérant les types d'adhérents \author Rodolphe Quiedeville - \version $Revision$ + \version $Id$ */ +require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); + + /** \class AdherentType \brief Classe gérant les types d'adhérents */ - - -class AdherentType +class AdherentType extends CommonObject { var $error; var $errors=array(); var $db; + var $table_element = 'adherent_type'; var $id; var $libelle; @@ -182,6 +181,7 @@ class AdherentType $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; + $this->ref = $obj->rowid; $this->libelle = $obj->libelle; $this->statut = $obj->statut; $this->cotisation = $obj->cotisation; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index b05d041247e..62703a6b0bc 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 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 @@ -16,16 +16,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/adherents/type.php \ingroup adherent \brief Page de configuration des types d'adhérents - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -111,6 +108,8 @@ if ($user->rights->adherent->configurer && $_GET["action"] == 'commentaire') llxHeader(); +$form=new Form($db); + /* ************************************************************************** */ /* */ /* Liste des types d'adhérents */ @@ -149,7 +148,7 @@ if (! $rowid && $_GET["action"] != 'create' && $_GET["action"] != 'edit') $objp = $db->fetch_object($result); $var=!$var; print ""; - print ''.img_object($langs->trans("ShwoType"),'group').' '.$objp->rowid.''; + print ''.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.''; print ''.$objp->libelle.''; print ''.yn($objp->cotisation).''; print ''.yn($objp->vote).''; @@ -261,8 +260,14 @@ if ($rowid > 0) print ''; - print ''; - print ''; + // Ref + print ''; + print ''; + + // Label + print ''; print '
'.$langs->trans("Ref").''.$adht->id.'
'.$langs->trans("Label").''.$adht->libelle.'
'.$langs->trans("Ref").''; + print $form->showrefnav($adht,'rowid'); + print '
'.$langs->trans("Label").''.$adht->libelle.'
'.$langs->trans("SubscriptionRequired").''; print yn($adht->cotisation); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 061b3d5e60a..08e57cabd05 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -107,6 +107,11 @@ if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0) } + +/* +* View +*/ + $html = new Form($db); /* @@ -124,7 +129,7 @@ if ($_GET["socid"]) */ $soc = new Societe($db); $result = $soc->fetch($_GET["socid"]); - llxHeader("","",$langs->trans("CardCompany".$soc->type)); + llxHeader("","",$langs->trans("Category")); /* @@ -132,7 +137,7 @@ if ($_GET["socid"]) */ $head = societe_prepare_head($soc); - dolibarr_fiche_head($head, 'category', $soc->nom); + dolibarr_fiche_head($head, 'category', $langs->trans("ThirdParty")); print ''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 1a77ee311d8..ed05b27ad22 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -148,7 +148,7 @@ if ($socid > 0) $head = societe_prepare_head($objsoc); - dolibarr_fiche_head($head, 'customer', $objsoc->nom); + dolibarr_fiche_head($head, 'customer', $langs->trans("ThirdParty")); /* diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 3833ae14d81..2dd417c210a 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2008 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 @@ -14,15 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/commonobject.class.php \ingroup core \brief Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...) - \version $Revision$ + \version $Id$ */ @@ -513,6 +511,8 @@ class CommonObject $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " WHERE ".$fieldid." < '".addslashes($this->ref)."'"; if (isset($filter)) $sql.=" AND ".$filter; + + //print $sql; $result = $this->db->query($sql) ; if (! $result) { @@ -521,11 +521,13 @@ class CommonObject } $row = $this->db->fetch_row($result); $this->ref_previous = $row[0]; + $sql = "SELECT MIN(".$fieldid.")"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " WHERE ".$fieldid." > '".addslashes($this->ref)."'"; if (isset($filter)) $sql.=" AND ".$filter; + $result = $this->db->query($sql) ; if (! $result) { diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 9cdae43c9dc..d93c1e22d5a 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -113,7 +113,7 @@ if ($socid > 0) */ $head = societe_prepare_head($societe); - dolibarr_fiche_head($head, 'compta', $societe->nom); + dolibarr_fiche_head($head, 'compta', $langs->trans("ThirdParty")); print '
'; diff --git a/htdocs/docsoc.php b/htdocs/docsoc.php index 884b05f1eec..f8fcabe5e67 100644 --- a/htdocs/docsoc.php +++ b/htdocs/docsoc.php @@ -84,9 +84,10 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') $mesg = '
'.$langs->trans("FileWasRemoved").'
'; } + /* - * Affichage liste - */ +* View +*/ llxHeader(); @@ -102,7 +103,7 @@ if ($socid > 0) $html=new Form($db); - dolibarr_fiche_head($head, 'document', $societe->nom); + dolibarr_fiche_head($head, 'document', $langs->trans("ThirdParty")); /* * Confirmation de la suppression d'une ligne produit diff --git a/htdocs/fourn/fiche-stats.php b/htdocs/fourn/fiche-stats.php index 14f73871d25..b190e351676 100644 --- a/htdocs/fourn/fiche-stats.php +++ b/htdocs/fourn/fiche-stats.php @@ -1,7 +1,7 @@ - * Copyright (C) 2003 Éric Seigne - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2008 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 @@ -16,15 +16,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/fourn/fiche.php \ingroup fournisseur, facture \brief Page de fiche fournisseur - \version $Revision$ + \version $Id$ */ require('./pre.inc.php'); @@ -84,8 +82,9 @@ if ( $societe->fetch($socid) ) */ $head = societe_prepare_head($societe); - dolibarr_fiche_head($head, 'supplierstat', $societe->nom); + dolibarr_fiche_head($head, 'supplierstat', $langs->trans("ThirdParty")); + print '
'; print ''; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 5e10f2eae99..acbba71c80d 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -16,14 +16,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/fourn/fiche.php \ingroup fournisseur, facture \brief Page de fiche fournisseur + \version $Id$ */ require('./pre.inc.php'); @@ -84,7 +83,7 @@ if ( $societe->fetch($socid) ) */ $head = societe_prepare_head($societe); - dolibarr_fiche_head($head, 'supplier', $societe->nom); + dolibarr_fiche_head($head, 'supplier', $langs->trans("ThirdParty")); print '
'.$langs->trans("Name").''.$societe->nom.'
'; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index ed23314eac2..437eb7cea0c 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2794,14 +2794,14 @@ class Form /** * \brief Affiche tableau avec ref et bouton navigation pour un objet metier - * \param object Objet a afficher + * \param object Object to show * \param paramid Nom du parametre a utiliser pour nommer id dans liens URL * \param morehtml Code html supplementaire a afficher avant barre nav * \param shownav Show Condition * \param fieldid Nom du champ a utiliser pour select next et previous * \return string Portion HTML avec ref + boutons nav */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid') + function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref') { $ret=''; @@ -2809,11 +2809,13 @@ class Form $previous_ref = $object->ref_previous?''.img_previous().'':''; $next_ref = $object->ref_next?''.img_next().'':''; + //print "xx".$previous_ref."x".$next_ref; if ($previous_ref || $next_ref || $morehtml) { $ret.='
'; } - //$ret.=$object->getNomUrl(0); - $ret.=$object->ref; + + $ret.=$object->$fieldref; + if ($morehtml) { $ret.=''.$morehtml; } diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 23345e801a1..a50d146259f 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -17,17 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * or see http://www.gnu.org/ - * - * $Id$ */ /** \file htdocs/lib/company.lib.php \brief Ensemble de fonctions de base pour le module societe \ingroup societe - \version $Revision$ - - Ensemble de fonctions de base de dolibarr sous forme d'include + \version $Id$ */ function societe_prepare_head($objsoc) @@ -37,7 +33,7 @@ function societe_prepare_head($objsoc) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Company"); + $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'company'; $h++; diff --git a/htdocs/soc.php b/htdocs/soc.php index 1d465c500a9..e2c97b8295f 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Brian Fraval - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin * @@ -212,10 +212,10 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && } } -/** - * - * - */ + +/* +* View +*/ llxHeader(); @@ -899,7 +899,7 @@ else $head = societe_prepare_head($soc); - dolibarr_fiche_head($head, 'company', $soc->nom); + dolibarr_fiche_head($head, 'company', $langs->trans("ThirdParty")); // Confirmation de la suppression de la facture @@ -921,7 +921,11 @@ else print '
'; print ''; - print ''; + // + print ''; + print ''; print ''; diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index f105106a2c6..3d39e134862 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -19,28 +19,29 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/societe.class.php \ingroup societe \brief Fichier de la classe des societes - \version $Revision$ + \version $Id$ */ +require_once(DOL_DOCUMENT_ROOT."/commonobject.class.php"); + /** \class Societe \brief Classe permettant la gestion des societes */ -class Societe +class Societe extends CommonObject { var $db; var $error; var $errors=array(); - + var $table_element = 'societe'; + var $id; var $nom; var $nom_particulier; @@ -484,15 +485,16 @@ class Societe } /** - * \brief Charge depuis la base l'objet societe - * \param socid Id de la soci�t� � charger en m�moire - * \param user Objet de l'utilisateur + * \brief Load a third party from database into memory + * \param socid Id third party to load + * \param user User object * \return int >0 si ok, <0 si ko */ function fetch($socid, $user=0) { global $langs; global $conf; + /* Lecture des permissions */ if ($user <> 0) { @@ -545,6 +547,7 @@ class Societe $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; + $this->ref = $obj->rowid; $this->date_update = $obj->date_update; diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 3d125c99461..f9e53d72463 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2008 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 @@ -14,16 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/societe/info.php \ingroup societe \brief Page des informations d'une societe - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -55,13 +52,12 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0 } } -llxHeader(); - /* - * Visualisation de la fiche - * - */ +* View +*/ + +llxHeader(); $soc = new Societe($db); $soc->id = $socid; @@ -73,7 +69,7 @@ $soc->info($socid); */ $head = societe_prepare_head($soc); -dolibarr_fiche_head($head, 'info', $soc->nom); +dolibarr_fiche_head($head, 'info', $langs->trans("ThirdParty")); diff --git a/htdocs/socnote.php b/htdocs/socnote.php index 24954f6ef8c..638e8ebcb9d 100644 --- a/htdocs/socnote.php +++ b/htdocs/socnote.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -64,7 +64,7 @@ if ($socid > 0) */ $head = societe_prepare_head($societe); - dolibarr_fiche_head($head, 'note', $societe->nom); + dolibarr_fiche_head($head, 'note', $langs->trans("ThirdParty")); print "";
'.$langs->trans('Name').''.$soc->nom.'
'.$langs->trans('Name').''; + print $form->showrefnav($soc,'socid','',1,'rowid','nom'); + print '
'.$langs->trans('Prefix').''.$soc->prefix_comm.'