[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php
From: |
Regis Houssin |
Subject: |
[Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php |
Date: |
Thu, 08 Jun 2006 14:52:18 +0000 |
CVSROOT: /cvsroot/dolibarr
Module name: dolibarr
Changes by: Regis Houssin <hregis> 06/06/08 14:52:18
Modified files:
htdocs/commande: commande.class.php
Log message:
fix: manquait les fonctions pour changer l'état d'un contact
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dolibarr/htdocs/commande/commande.class.php?cvsroot=dolibarr&r1=1.148&r2=1.149
Patches:
Index: commande.class.php
===================================================================
RCS file: /cvsroot/dolibarr/dolibarr/htdocs/commande/commande.class.php,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -b -r1.148 -r1.149
--- commande.class.php 7 Jun 2006 21:04:45 -0000 1.148
+++ commande.class.php 8 Jun 2006 14:52:18 -0000 1.149
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id: commande.class.php,v 1.148 2006/06/07 21:04:45 eldy Exp $
+ * $Id: commande.class.php,v 1.149 2006/06/08 14:52:18 hregis Exp $
* $Source: /cvsroot/dolibarr/dolibarr/htdocs/commande/commande.class.php,v $
*/
@@ -26,7 +26,7 @@
\file htdocs/commande/commande.class.php
\ingroup commande
\brief Fichier des classes de commandes
- \version $Revision: 1.148 $
+ \version $Revision: 1.149 $
*/
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
@@ -1790,6 +1790,64 @@
}
/**
+ * \brief Le détail d'un contact
+ * \param rowid L'identifiant du contact
+ * \return object L'objet construit par DoliDb.fetch_object
+ */
+ function detail_contact($rowid)
+ {
+ $element='commande';
+
+ $sql = "SELECT ec.datecreate, ec.statut, ec.fk_socpeople,
ec.fk_c_type_contact,";
+ $sql.= " tc.code, tc.libelle, s.fk_soc";
+ $sql.= " FROM ".MAIN_DB_PREFIX."element_contact as ec,
".MAIN_DB_PREFIX."c_type_contact as tc, ";
+ $sql.= " ".MAIN_DB_PREFIX."socpeople as s";
+ $sql.= " WHERE ec.rowid =".$rowid;
+ $sql.= " AND ec.fk_socpeople=s.idp";
+ $sql.= " AND ec.fk_c_type_contact=tc.rowid";
+ $sql.= " AND tc.element = '".$element."'";
+
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ $obj = $this->db->fetch_object($resql);
+ return $obj;
+ }
+ else
+ {
+ $this->error=$this->db->error();
+ dolibarr_print_error($this->db);
+ return null;
+ }
+ }
+
+ /**
+ * \brief Mise a jour du contact associé à une commande
+ * \param rowid La reference du lien
commande-contact
+ * \param statut Le nouveau statut
+ * \param type_contact_id Description du type de contact
+ * \return int <0 si erreur, =0 si ok
+ */
+ function update_contact($rowid, $statut, $type_contact_id)
+ {
+ // Insertion dans la base
+ $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
+ $sql.= " statut = $statut,";
+ $sql.= " fk_c_type_contact = '".$type_contact_id ."'";
+ $sql.= " where rowid = ".$rowid;
+ // Retour
+ if ( $this->db->query($sql) )
+ {
+ return 0;
+ }
+ else
+ {
+ dolibarr_print_error($this->db);
+ return -1;
+ }
+ }
+
+ /**
*
*
*
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/01
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/01
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php,
Regis Houssin <=
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/08
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/09
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/20
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/20
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/20
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/20
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/22
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/22
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/26
- [Dolibarr-cvs] dolibarr/htdocs/commande commande.class.php, Regis Houssin, 2006/06/27