2
0
forked from Wavyzz/dolibarr

Fix: Gestion erreur sur creation commande

Rend date livraison optionnelle
This commit is contained in:
Laurent Destailleur
2006-03-18 19:58:33 +00:00
parent 39ddb8d5ea
commit d0e09f5475
5 changed files with 178 additions and 132 deletions

View File

@@ -40,7 +40,7 @@ class Commande
var $db ; var $db ;
var $id ; var $id ;
var $socidp; var $socidp;
var $contactid; var $contactid;
var $brouillon; var $brouillon;
var $cond_reglement_id; var $cond_reglement_id;
var $cond_reglement_code; var $cond_reglement_code;
@@ -60,6 +60,7 @@ class Commande
global $langs; global $langs;
$langs->load('orders'); $langs->load('orders');
$this->db = $DB; $this->db = $DB;
$this->statuts[-1] = $langs->trans('StatusOrderCanceled'); $this->statuts[-1] = $langs->trans('StatusOrderCanceled');
$this->statuts[0] = $langs->trans('StatusOrderDraft'); $this->statuts[0] = $langs->trans('StatusOrderDraft');
$this->statuts[1] = $langs->trans('StatusOrderValidated'); $this->statuts[1] = $langs->trans('StatusOrderValidated');
@@ -78,6 +79,7 @@ class Commande
$this->sources[3] = $langs->trans('OrderSource3'); $this->sources[3] = $langs->trans('OrderSource3');
$this->sources[4] = $langs->trans('OrderSource4'); $this->sources[4] = $langs->trans('OrderSource4');
$this->sources[5] = $langs->trans('OrderSource5'); $this->sources[5] = $langs->trans('OrderSource5');
$this->products = array(); $this->products = array();
} }
@@ -107,9 +109,9 @@ class Commande
} }
$this->soc_id = $propal->soc_id; $this->soc_id = $propal->soc_id;
$this->cond_reglement_id = $propal->cond_reglement_id; $this->cond_reglement_id = $propal->cond_reglement_id;
$this->mode_reglement_id = $propal->mode_reglement_id; $this->mode_reglement_id = $propal->mode_reglement_id;
$this->date_livraison = $propal->date_livraison; $this->date_livraison = $propal->date_livraison;
/* D<>finit la soci<63>t<EFBFBD> comme un client */ /* D<>finit la soci<63>t<EFBFBD> comme un client */
$soc = new Societe($this->db); $soc = new Societe($this->db);
@@ -222,26 +224,43 @@ class Commande
} }
} }
} }
/**
* Cr<43><72> la commande /**
* * \brief Cr<43><72> la commande
*/ * \param user Id utilisateur qui cr<63>e
*/
function create($user) function create($user)
{ {
global $conf; global $conf,$langs;
/* On positionne en mode brouillon la commande */
// V<>rification param<61>tres
if ($this->source < 0)
{
$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Source"));
return -1;
}
// On positionne en mode brouillon la commande
$this->brouillon = 1; $this->brouillon = 1;
if (! $remise) if (! $remise)
{ {
$remise = 0 ; $remise = 0 ;
} }
if (! $this->projetid) if (! $this->projetid)
{ {
$this->projetid = 0; $this->projetid = 0;
} }
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commande (fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note, ref_client, model_pdf, fk_cond_reglement, fk_mode_reglement, date_livraison) ';
$sql .= ' VALUES ('.$this->soc_id.', now(), '.$user->id.', '.$this->projetid.', '.$this->db->idate($this->date_commande).', '.$this->source.', \''.$this->note.'\', \''.$this->ref_client.'\', \''.$this->modelpdf.'\', \''.$this->cond_reglement_id.'\', \''.$this->mode_reglement_id.'\', \''.$this->date_livraison.'\')'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commande (';
$sql.= 'fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note, ref_client, model_pdf, fk_cond_reglement, fk_mode_reglement, date_livraison) ';
$sql.= ' VALUES ('.$this->soc_id.', now(), '.$user->id.', '.$this->projetid.',';
$sql.= ' '.$this->db->idate($this->date_commande).',';
$sql.= ' '.$this->source.', ';
$sql.= " '".addslashes($this->note)."', ";
$sql.= " '".$this->ref_client."', '".$this->modelpdf.'\', \''.$this->cond_reglement_id.'\', \''.$this->mode_reglement_id.'\',';
$sql.= " ".($this->date_livraison?$this->db->idate($this->date_livraison):'null').")";
dolibarr_syslog("Commande.class.php::create sql=$sql");
if ( $this->db->query($sql) ) if ( $this->db->query($sql) )
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commande'); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commande');
@@ -565,7 +584,7 @@ class Commande
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_id = $obj->fk_cond_reglement;
$this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_id = $obj->fk_mode_reglement;
$this->date_livraison = $obj->date_livraison; $this->date_livraison = $obj->date_livraison;
$this->db->free(); $this->db->free();
if ($this->statut == 0) if ($this->statut == 0)
@@ -804,9 +823,9 @@ class Commande
} }
/** /**
* \brief D<>finit une date de livraison * \brief D<>finit une date de livraison
* \param user Objet utilisateur qui modifie * \param user Objet utilisateur qui modifie
* \param date_livraison date de livraison * \param date_livraison Date de livraison
* \return int <0 si ko, >0 si ok * \return int <0 si ko, >0 si ok
*/ */
function set_date_livraison($user, $date_livraison) function set_date_livraison($user, $date_livraison)
{ {
@@ -1177,10 +1196,11 @@ class Commande
return -1; return -1;
} }
} }
/**
* \brief Classer la commande dans un projet /**
* \param cat_id Id du projet * \brief Classer la commande dans un projet
*/ * \param cat_id Id du projet
*/
function classin($cat_id) function classin($cat_id)
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET fk_projet = $cat_id"; $sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET fk_projet = $cat_id";
@@ -1197,6 +1217,7 @@ class Commande
} }
} }
/** /**
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord * \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord
* \param user Objet user * \param user Objet user

View File

@@ -32,6 +32,9 @@
require('./pre.inc.php'); require('./pre.inc.php');
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/commande/modules_commande.php"); require_once(DOL_DOCUMENT_ROOT ."/includes/modules/commande/modules_commande.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
$langs->load('orders'); $langs->load('orders');
$langs->load('sendings'); $langs->load('sendings');
@@ -44,13 +47,6 @@ $user->getrights('expedition');
if (!$user->rights->commande->lire) accessforbidden(); if (!$user->rights->commande->lire) accessforbidden();
if ($conf->projet->enabled)
{
require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
}
require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
// S<>curit<69> acc<63>s client // S<>curit<69> acc<63>s client
$socidp=0; $socidp=0;
@@ -77,7 +73,8 @@ if ($_POST['action'] == 'classin' && $user->rights->commande->creer)
if ($_POST['action'] == 'add' && $user->rights->commande->creer) if ($_POST['action'] == 'add' && $user->rights->commande->creer)
{ {
$datecommande=''; $datecommande='';
$datecommande = @mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datecommande = @mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
$datelivraison = @mktime(12, 0, 0, $_POST['liv_month'],$_POST['liv_day'],$_POST['liv_year']);
$commande = new Commande($db); $commande = new Commande($db);
@@ -91,7 +88,7 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
$commande->modelpdf = $_POST['model']; $commande->modelpdf = $_POST['model'];
$commande->cond_reglement_id = $_POST['cond_reglement_id']; $commande->cond_reglement_id = $_POST['cond_reglement_id'];
$commande->mode_reglement_id = $_POST['mode_reglement_id']; $commande->mode_reglement_id = $_POST['mode_reglement_id'];
$commande->date_livraison = $_POST['liv_year']."-".$_POST['liv_month']."-".$_POST['liv_day']; $commande->date_livraison = $datelivraison;
$commande->add_product($_POST['idprod1'],$_POST['qty1'],$_POST['remise_percent1']); $commande->add_product($_POST['idprod1'],$_POST['qty1'],$_POST['remise_percent1']);
$commande->add_product($_POST['idprod2'],$_POST['qty2'],$_POST['remise_percent2']); $commande->add_product($_POST['idprod2'],$_POST['qty2'],$_POST['remise_percent2']);
@@ -104,9 +101,17 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
$commande_id = $commande->create($user); $commande_id = $commande->create($user);
$_GET['id'] = $commande->id; if ($commande_id <= 0)
{
$action = ''; $_GET['action']='create';
$_GET['socidp']=$_POST['soc_id'];
$mesg='<div class="error">'.$commande->error.'</div>';
}
else
{
$_GET['id'] = $commande->id;
$action = '';
}
} }
// Positionne ref commande client // Positionne ref commande client
@@ -215,6 +220,7 @@ if ($_GET['action'] == 'deleteline' && $user->rights->commande->creer)
$commande->fetch($_GET['id']); $commande->fetch($_GET['id']);
$result = $commande->delete_line($_GET['lineid']); $result = $commande->delete_line($_GET['lineid']);
Header('Location: fiche.php?id='.$_GET['id']); Header('Location: fiche.php?id='.$_GET['id']);
exit;
} }
if ($_POST['action'] == 'confirm_valid' && $_POST['confirm'] == 'yes' && $user->rights->commande->valider) if ($_POST['action'] == 'confirm_valid' && $_POST['confirm'] == 'yes' && $user->rights->commande->valider)
@@ -248,6 +254,7 @@ if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes')
$commande->id = $_GET['id']; $commande->id = $_GET['id'];
$commande->delete(); $commande->delete();
Header('Location: index.php'); Header('Location: index.php');
exit;
} }
} }
@@ -271,7 +278,6 @@ if($_GET['action'] == 'builddoc')
llxHeader('',$langs->trans('OrderCard'),'Commande'); llxHeader('',$langs->trans('OrderCard'),'Commande');
$html = new Form($db); $html = new Form($db);
/********************************************************************* /*********************************************************************
@@ -283,6 +289,8 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
{ {
print_titre($langs->trans('CreateOrder')); print_titre($langs->trans('CreateOrder'));
if ($mesg) print $mesg.'<br>';
$new_commande = new Commande($db); $new_commande = new Commande($db);
if ($propalid) if ($propalid)
@@ -338,30 +346,29 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
$html->select_date('','re','','','',"crea_commande"); $html->select_date('','re','','','',"crea_commande");
print '</td></tr>'; print '</td></tr>';
// date de livraison // Date de livraison
print "<tr><td>".$langs->trans("DateDelivery")."</td><td>"; print "<tr><td>".$langs->trans("DateDelivery")."</td><td>";
if(DATE_LIVRAISON_WEEK_DELAY != "") if ($conf->global->DATE_LIVRAISON_WEEK_DELAY)
{ {
$tmpdte = time() + ((7*DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); $tmpdte = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
$syear = date("Y", $tmpdte); $html->select_date($tmpdte,'liv_','','',1,"crea_commande");
$smonth = date("m", $tmpdte);
$sday = date("d", $tmpdte);
$html->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"crea_commande");
} }
else else
$html->select_date('','liv_','','','',"crea_commande"); {
$html->select_date(-1,'liv_','','',1,"crea_commande");
}
print "</td></tr>"; print "</td></tr>";
// Conditions de r<>glement // Conditions de r<>glement
print '<tr><td nowrap>'.$langs->trans('PaymentConditions').'</td><td>'; print '<tr><td nowrap>'.$langs->trans('PaymentConditions').'</td><td>';
$html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); $html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1);
print '</td></tr>'; print '</td></tr>';
// Mode de r<>glement // Mode de r<>glement
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'; print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
$html->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); $html->select_types_paiements($soc->mode_reglement,'mode_reglement_id');
print '</td></tr>'; print '</td></tr>';
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
@@ -371,16 +378,15 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
} }
print '<tr><td>'.$langs->trans('Source').'</td><td>'; print '<tr><td>'.$langs->trans('Source').'</td><td>';
$html->select_array('source_id',$new_commande->sources,2); $html->selectSourcesCommande('','source_id',1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>Mod<6F>le</td>'; print '<tr><td>Mod<6F>le</td>';
print '<td>'; print '<td>';
// pdf // pdf
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php'); include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php');
$form=new Form($db);
$model=new ModelePDFCommandes(); $model=new ModelePDFCommandes();
$liste=$model->liste_modeles($db); $liste=$model->liste_modeles($db);
$form->select_array("model",$liste,$conf->global->COMMANDE_ADDON_PDF); $html->select_array("model",$liste,$conf->global->COMMANDE_ADDON_PDF);
print "</td></tr>"; print "</td></tr>";
if ($propalid > 0) if ($propalid > 0)

View File

@@ -220,24 +220,46 @@ class Form
} }
} }
/**
* \brief Retourne la liste d<>roulante des pays actifs, dans la langue de l'utilisateur /**
* \param selected Code pays pr<70>-s<>lectionn<6E> * \brief Renvoie la liste des sources de commandes
* \param htmlname Nom de la liste deroulante * \param selected Id de la source pr<70>-s<>lectionn<6E>e
* \param htmloption Options html sur le select * \param htmlname Nom de la liste deroulante
* \todo trier liste sur noms apr<70>s traduction plutot que avant * \param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
*/ * \return array Tableau des sources de commandes
*/
function select_pays($selected='',$htmlname='pays_id',$htmloption='') function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
{ {
global $conf,$langs; global $conf,$langs;
$langs->load("dict"); print '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
if ($addempty) print '<option value="-1" selected="true">&nbsp;</option>';
$sql = "SELECT rowid, libelle, code, active FROM ".MAIN_DB_PREFIX."c_pays"; print '<option value="0"'.($selected=='0'?' selected="true"':'').'>'.$langs->trans('OrderSource0').'</option>';
$sql .= " WHERE active = 1"; print '<option value="1"'.($selected=='1'?' selected="true"':'').'>'.$langs->trans('OrderSource1').'</option>';
$sql .= " ORDER BY code ASC;"; print '<option value="2"'.($selected=='2'?' selected="true"':'').'>'.$langs->trans('OrderSource2').'</option>';
print '<option value="3"'.($selected=='3'?' selected="true"':'').'>'.$langs->trans('OrderSource3').'</option>';
if ($this->db->query($sql)) print '<option value="4"'.($selected=='4'?' selected="true"':'').'>'.$langs->trans('OrderSource4').'</option>';
print '<option value="5"'.($selected=='5'?' selected="true"':'').'>'.$langs->trans('OrderSource5').'</option>';
print '</select>';
}
/**
* \brief Retourne la liste d<>roulante des pays actifs, dans la langue de l'utilisateur
* \param selected Code pays pr<70>-s<>lectionn<6E>
* \param htmlname Nom de la liste deroulante
* \param htmloption Options html sur le select
* \todo trier liste sur noms apr<70>s traduction plutot que avant
*/
function select_pays($selected='',$htmlname='pays_id',$htmloption='')
{
global $conf,$langs;
$langs->load("dict");
$sql = "SELECT rowid, libelle, code, active FROM ".MAIN_DB_PREFIX."c_pays";
$sql .= " WHERE active = 1";
$sql .= " ORDER BY code ASC;";
if ($this->db->query($sql))
{ {
print '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>'; print '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
$num = $this->db->num_rows(); $num = $this->db->num_rows();

View File

@@ -399,7 +399,7 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
\brief Formattage de la date en fonction de la langue $conf->langage \brief Formattage de la date en fonction de la langue $conf->langage
\param time Date 'timestamp' ou format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS' \param time Date 'timestamp' ou format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
\param format Format d'affichage de la date ("%d %b %Y", "%d/%m/%Y", ...) \param format Format d'affichage de la date ("%d %b %Y", "%d/%m/%Y", ...)
\return string Date format<61>e ou '?' si time null \return string Date format<61>e ou '' si time null
*/ */
function dolibarr_print_date($time,$format='') function dolibarr_print_date($time,$format='')
{ {
@@ -408,8 +408,8 @@ function dolibarr_print_date($time,$format='')
// Si format non d<>fini, on prend $conf->format_date_text_short // Si format non d<>fini, on prend $conf->format_date_text_short
if (! $format) $format=$conf->format_date_text_short; if (! $format) $format=$conf->format_date_text_short;
// Si date non d<>finie, on renvoie '?' // Si date non d<>finie, on renvoie ''
if (! $time) return '?'; if (! $time) return '';
// Analyse de la date // Analyse de la date
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$time,$reg)) if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$time,$reg))

View File

@@ -46,53 +46,52 @@
class User class User
{ {
var $db; var $db;
var $id; var $id;
var $fullname; var $fullname;
var $nom; var $nom;
var $prenom; var $prenom;
var $note; var $note;
var $code; var $code;
var $email; var $email;
var $office_tel; var $office_tel;
var $office_fax; var $office_fax;
var $user_mobile; var $user_mobile;
var $admin; var $admin;
var $login; var $login;
var $pass; var $pass;
var $lang; var $lang;
var $datec; var $datec;
var $datem; var $datem;
var $societe_id; var $societe_id;
var $webcal_login; var $webcal_login;
var $datelastaccess; var $datelastaccess;
var $error; var $error;
var $userpref_limite_liste; var $userpref_limite_liste;
var $all_permissions_are_loaded; /**< \private all_permissions_are_loaded */ var $all_permissions_are_loaded; /**< \private all_permissions_are_loaded */
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
* \param $DB handler acc<63>s base de donn<6E>es * \param $DB handler acc<63>s base de donn<6E>es
* \param $id id de l'utilisateur (0 par d<>faut) * \param $id id de l'utilisateur (0 par d<>faut)
*/ */
function User($DB, $id=0)
function User($DB, $id=0) {
{ $this->db = $DB;
$this->id = $id;
$this->db = $DB;
$this->id = $id; // Preference utilisateur
$this->liste_limit = 0;
// Preference utilisateur $this->clicktodial_enabled = 0;
$this->liste_limit = 0;
$this->clicktodial_enabled = 0;
$this->all_permissions_are_loaded = 0; $this->all_permissions_are_loaded = 0;
$this->admin=0;
return 1; return 1;
} }
/** /**
@@ -564,7 +563,8 @@ class User
$this->db->begin(); $this->db->begin();
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='".addslashes($this->login)."'"; $sql = "SELECT login FROM ".MAIN_DB_PREFIX."user";
$sql.= " WHERE login ='".addslashes($this->login)."'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@@ -574,7 +574,7 @@ class User
if ($num) if ($num)
{ {
$this->error = $langs->trans("ErrorLoginAlreadyExists"); $this->error = $langs->trans("ErrorLoginAlreadyExists");
return -5; return -6;
} }
else else
{ {
@@ -589,19 +589,17 @@ class User
// Set default rights // Set default rights
if ($this->set_default_rights() < 0) if ($this->set_default_rights() < 0)
{ {
$this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->error();
return -4; $this->db->rollback();
return -5;
} }
// Update minor fields // Update minor fields
if ($this->update() < 0) if ($this->update() < 0)
{ {
$this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->error();
return -5; $this->db->rollback();
return -4;
} }
// Appel des triggers // Appel des triggers
@@ -614,29 +612,27 @@ class User
if (! $error) if (! $error)
{ {
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else
{ {
$this->db->rollback();
$this->error=$interface->error; $this->error=$interface->error;
$this->db->rollback();
return -3; return -3;
} }
} }
else else
{ {
$this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->error();
$this->db->rollback();
return -2; return -2;
} }
} }
} }
else else
{ {
$this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->error();
$this->db->rollback();
return -1; return -1;
} }
} }
@@ -767,6 +763,7 @@ class User
$this->pass=trim($this->pass); $this->pass=trim($this->pass);
$this->email=trim($this->email); $this->email=trim($this->email);
$this->note=trim($this->note); $this->note=trim($this->note);
$this->admin=$this->admin?$this->admin:0;
$error=0; $error=0;
@@ -777,7 +774,7 @@ class User
$sql .= ", firstname = '".addslashes($this->prenom)."'"; $sql .= ", firstname = '".addslashes($this->prenom)."'";
$sql .= ", login = '".addslashes($this->login)."'"; $sql .= ", login = '".addslashes($this->login)."'";
if ($this->pass) $sql .= ", pass = '".addslashes($this->pass)."'"; if ($this->pass) $sql .= ", pass = '".addslashes($this->pass)."'";
$sql .= ", admin = $this->admin"; $sql .= ", admin = ".$this->admin;
$sql .= ", office_phone = '$this->office_phone'"; $sql .= ", office_phone = '$this->office_phone'";
$sql .= ", office_fax = '$this->office_fax'"; $sql .= ", office_fax = '$this->office_fax'";
$sql .= ", user_mobile = '$this->user_mobile'"; $sql .= ", user_mobile = '$this->user_mobile'";