Fix: Fix ton of regression due to field name change

This commit is contained in:
Laurent Destailleur 2013-03-09 20:34:38 +01:00
parent 60f16e1a88
commit 746e005726
38 changed files with 100 additions and 118 deletions

View File

@ -394,7 +394,7 @@ abstract class ActionsAdherentCardCommon
$this->object->old_firstname = $_POST["old_firstname"];
$this->object->fk_soc = $_POST["fk_soc"];
$this->object->name = $_POST["name"];
$this->object->lastname = $_POST["lastname"];
$this->object->firstname = $_POST["firstname"];
$this->object->civilite_id = $_POST["civilite_id"];
$this->object->address = $_POST["address"];

View File

@ -829,7 +829,7 @@ if ($rowid)
print '<input type="hidden" name="action" value="cotisation">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->name).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->societe).'">';
print "<table class=\"border\" width=\"100%\">\n";
$today=dol_now();

View File

@ -49,6 +49,7 @@ class Adherent extends CommonObject
var $login;
var $pass;
var $societe;
var $company;
var $address;
var $zip;
var $town;
@ -1005,7 +1006,7 @@ class Adherent extends CommonObject
{
global $langs;
$sql = "SELECT d.rowid, d.civilite, d.firstname, d.lastname, d.societe, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql = "SELECT d.rowid, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,";
@ -1047,7 +1048,8 @@ class Adherent extends CommonObject
$this->lastname = $obj->lastname;
$this->login = $obj->login;
$this->pass = $obj->pass;
$this->societe = $obj->societe;
$this->societe = $obj->company;
$this->company = $obj->company;
$this->fk_soc = $obj->fk_soc;
$this->address = $obj->address;
$this->zip = $obj->zip;

View File

@ -212,26 +212,6 @@ $list=array('COMPTA_PRODUCT_BUY_ACCOUNT','COMPTA_PRODUCT_SOLD_ACCOUNT','COMPTA_S
'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER'
);
/*$sql = "SELECT rowid, name, value, type, note";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE name LIKE 'COMPTA_%'";
$sql.= " AND name NOT IN ('COMPTA_MODE')";
$sql.= " AND entity = ".$conf->entity;
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$var=!$var;
$list[$obj->name]=$obj->value;
$i++;
}
}*/
$num=count($list);
if ($num)
{

View File

@ -165,8 +165,8 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
$langs->load("mails");
print_titre($langs->trans("Notifications"));
$sql = "SELECT rowid, name, firstname, fk_societe, email";
$sql.= " FROM ".MAIN_DB_PREFIX."user";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.fk_societe, u.email";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE entity IN (0,".$conf->entity.")";
$resql=$db->query($sql);
@ -181,7 +181,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
$var=!$var;
if (!$obj->fk_societe)
{
$username= $obj->firstname.' '.$obj->name;
$username= $obj->firstname.' '.$obj->lastname;
$internalusers[$obj->rowid] = $username;
}
@ -233,11 +233,11 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
}
// List of current notifications for objet_type='withdraw'
$sql = "SELECT u.lastname, u.firstname";
$sql.= ", nd.rowid, ad.code, ad.label";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= ", ".MAIN_DB_PREFIX."notify_def as nd";
$sql.= ", ".MAIN_DB_PREFIX."c_action_trigger as ad";
$sql = "SELECT u.lastname, u.firstname,";
$sql.= " nd.rowid, ad.code, ad.label";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad";
$sql.= " WHERE u.rowid = nd.fk_user";
$sql.= " AND nd.fk_action = ad.rowid";
$sql.= " AND u.entity IN (0,".$conf->entity.")";
@ -253,8 +253,8 @@ if ($resql)
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]>";
print '<td>'.$obj->firstname." ".$obj->name.'</td>';
print "<tr ".$bc[$var].">";
print '<td>'.$obj->firstname." ".$obj->lastname.'</td>';
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
print '<td>'.$label.'</td>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&amp;notif='.$obj->rowid.'">'.img_delete().'</a></td>';

View File

@ -40,7 +40,7 @@ if (empty($phone))
exit;
}
$sql = "SELECT nom as name FROM ".MAIN_DB_PREFIX."societe as s";
$sql = "SELECT s.nom as name FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid";
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
$sql.= " AND (s.phone='".$db->escape($phone)."'";

View File

@ -75,24 +75,24 @@ class BoutiqueCommande
$array = $this->db->fetch_array($result);
$this->id = $array["orders_id"];
$this->client_id = stripslashes($array["customers_id"]);
$this->client_name = stripslashes($array["customers_name"]);
$this->client_id = $array["customers_id"];
$this->client_name = $array["customers_name"];
$this->payment_method = stripslashes($array["payment_method"]);
$this->payment_method = $array["payment_method"];
$this->date = $this->db->jdate($array["date_purchased"]);
$this->delivery_adr->name = stripslashes($array["delivery_name"]);
$this->delivery_adr->street = stripslashes($array["delivery_street_address"]);
$this->delivery_adr->zip = stripslashes($array["delivery_zipcode"]);
$this->delivery_adr->city = stripslashes($array["delivery_city"]);
$this->delivery_adr->country = stripslashes($array["delivery_country"]);
$this->delivery_adr->name = $array["delivery_name"];
$this->delivery_adr->street = $array["delivery_street_address"];
$this->delivery_adr->zip = $array["delivery_zipcode"];
$this->delivery_adr->city = $array["delivery_city"];
$this->delivery_adr->country = $array["delivery_country"];
$this->billing_adr->name = stripslashes($array["billing_name"]);
$this->billing_adr->street = stripslashes($array["billing_street_address"]);
$this->billing_adr->zip = stripslashes($array["billing_zipcode"]);
$this->billing_adr->city = stripslashes($array["billing_city"]);
$this->billing_adr->country = stripslashes($array["billing_country"]);
$this->billing_adr->name = $array["billing_name"];
$this->billing_adr->street = $array["billing_street_address"];
$this->billing_adr->zip = $array["billing_zipcode"];
$this->billing_adr->city = $array["billing_city"];
$this->billing_adr->country = $array["billing_country"];
$this->db->free();
@ -106,7 +106,7 @@ class BoutiqueCommande
if ( $result )
{
$num = $this->db->num_rows($result);
$i=0;
while ($i < $num)
{

View File

@ -38,7 +38,7 @@ class ActionComm extends CommonObject
protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id;
var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
@ -109,7 +109,7 @@ class ActionComm extends CommonObject
function add($user,$notrigger=0)
{
global $langs,$conf,$hookmanager;
$error=0;
$now=dol_now();
@ -309,7 +309,7 @@ class ActionComm extends CommonObject
$transcode=$langs->trans("Action".$obj->type_code);
$type_libelle=($transcode!="Action".$obj->type_code?$transcode:$obj->libelle);
$this->type = $type_libelle;
$this->code = $obj->code;
$this->label = $obj->label;
$this->datep = $this->db->jdate($obj->datep);
@ -948,7 +948,7 @@ class ActionComm extends CommonObject
$event['startdate']=$datestart;
$event['duration']=$duration; // Not required with type 'journal'
$event['enddate']=$dateend; // Not required with type 'journal'
$event['author']=$obj->firstname.($obj->name?" ".$obj->name:"");
$event['author']=$obj->firstname.($obj->lastname?" ".$obj->lastname:"");
$event['priority']=$obj->priority;
$event['fulldayevent']=$obj->fulldayevent;
$event['location']=$obj->location;

View File

@ -486,7 +486,7 @@ if ($showbirthday)
$event->datep=dol_mktime(0,0,0,$datearray['mon'],$datearray['mday'],$year,true); // For full day events, date are also GMT but they wont but converted during output
$event->datef=$event->datep;
$event->type_code='BIRTHDAY';
$event->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->name;
$event->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->lastname;
$event->percentage=100;
$event->fulldayevent=true;

View File

@ -306,7 +306,7 @@ if ($resql)
print '<td>';
if ($obj->fk_contact > 0)
{
$contactstatic->name=$obj->name;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
print $contactstatic->getNomUrl(1,'',10);

View File

@ -87,7 +87,7 @@ if ($_GET["action"] == 'delete')
print_fiche_titre($langs->trans("Bookmarks"));
$sql = "SELECT s.rowid, s.nom, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.lastname, u.firstname";
$sql = "SELECT s.rowid, s.nom as name, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.lastname, u.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE b.fk_soc = s.rowid AND b.fk_user=u.rowid";
if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id;
@ -125,9 +125,9 @@ if ($resql)
print "<tr $bc[$var]>";
//print "<td>" . ($i + 1 + ($limit * $page)) . "</td>";
print "<td align=\"center\"><b>".$obj->bid."</b></td>";
print "<td><a href='".DOL_URL_ROOT."/user/fiche.php?id=".$obj->fk_user."'>".img_object($langs->trans("ShowUser"),"user").' '.$obj->name." ".$obj->firstname."</a></td>\n";
print "<td><a href='".DOL_URL_ROOT."/user/fiche.php?id=".$obj->fk_user."'>".img_object($langs->trans("ShowUser"),"user").' '.$obj->lastname." ".$obj->firstname."</a></td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->dateb))."</td>";
print "<td><a href=\"index.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom."</a></td>\n";
print "<td><a href=\"index.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->name."</a></td>\n";
print '<td align="center">'.$obj->url."</td>";
print '<td align="center">'.$obj->target."</td>";
print "<td><a href=\"bookmark.php?action=delete&bid=".$obj->bid."\">".img_delete()."</a></td>\n";

View File

@ -168,7 +168,7 @@ if ($result)
$deplacementstatic->ref=$obj->rowid;
$deplacementstatic->id=$obj->rowid;
$userstatic->id=$obj->uid;
$userstatic->lastname=$obj->name;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
print '<tr '.$bc[$var].'>';
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';

View File

@ -613,7 +613,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
$deplacementstatic->ref=$objp->rowid;
$deplacementstatic->id=$objp->rowid;
$userstatic->id=$objp->uid;
$userstatic->lastname=$objp->name;
$userstatic->lastname=$objp->lastname;
$userstatic->firstname=$objp->firstname;
print '<tr '.$bc[$var].'>';
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';

View File

@ -171,7 +171,7 @@ if ($result)
{
$obj = $db->fetch_object($result);
$amount[$obj->rowid] = $obj->amount_ttc;
$name[$obj->rowid] = $obj->name.' '.$obj->firstname;
$name[$obj->rowid] = $obj->lastname.' '.$obj->firstname;
$catotal+=$obj->amount_ttc;
$i++;
}
@ -183,7 +183,7 @@ else {
// On ajoute les paiements ancienne version, non lies par paiement_facture donc sans user
if ($modecompta != 'CREANCES-DETTES')
{
$sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(p.amount) as amount_ttc";
$sql = "SELECT -1 as rowidx, '' as lastname, '' as firstname, sum(p.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."paiement as p";
@ -205,7 +205,7 @@ if ($modecompta != 'CREANCES-DETTES')
{
$obj = $db->fetch_object($result);
$amount[$obj->rowidx] = $obj->amount_ttc;
$name[$obj->rowidx] = $obj->name.' '.$obj->firstname;
$name[$obj->rowidx] = $obj->lastname.' '.$obj->firstname;
$catotal+=$obj->amount_ttc;
$i++;
}

View File

@ -425,7 +425,7 @@ abstract class ActionsContactCardCommon
$this->object->old_firstname = $_POST["old_firstname"];
$this->object->socid = $_POST["socid"];
$this->object->name = $_POST["name"];
$this->object->lastname = $_POST["name"];
$this->object->firstname = $_POST["firstname"];
$this->object->civilite_id = $_POST["civilite_id"];
$this->object->poste = $_POST["poste"];

View File

@ -64,7 +64,7 @@ print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->name.'</td>';
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company

View File

@ -198,7 +198,7 @@ if (empty($reshook))
{
$result=$object->fetch($_GET["id"]);
$object->old_name = $_POST["old_name"];
$object->old_lastname = $_POST["old_lastname"];
$object->old_firstname = $_POST["old_firstname"];
$result = $object->delete();
@ -227,7 +227,7 @@ if (empty($reshook))
$object->oldcopy=dol_clone($object);
$object->old_name = $_POST["old_name"];
$object->old_lastname = $_POST["old_lastname"];
$object->old_firstname = $_POST["old_firstname"];
$object->socid = $_POST["socid"];
@ -265,7 +265,7 @@ if (empty($reshook))
if ($result > 0)
{
$object->old_name='';
$object->old_lastname='';
$object->old_firstname='';
$action = 'view';
}
@ -620,7 +620,7 @@ else
print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="contactid" value="'.$object->id.'">';
print '<input type="hidden" name="old_name" value="'.$object->name.'">';
print '<input type="hidden" name="old_lastname" value="'.$object->lastname.'">';
print '<input type="hidden" name="old_firstname" value="'.$object->firstname.'">';
if (! empty($backtopage)) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';

View File

@ -96,7 +96,7 @@ print $form->showrefnav($contact,'id');
print '</td></tr>';
// Name
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->name.'</td>';
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td>'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company

View File

@ -46,7 +46,7 @@ $v = new vCard();
$v->setProdId('Dolibarr '.DOL_VERSION);
$v->setUid('DOLIBARR-CONTACTID-'.$contact->id);
$v->setName($contact->name, $contact->firstname, "", "", "");
$v->setName($contact->lastname, $contact->firstname, "", "", "");
$v->setFormattedName($contact->getFullName($langs));
// By default, all informations are for work (except phone_perso and phone_mobile)

View File

@ -63,7 +63,7 @@ abstract class CommonObject
$lastname=$this->lastname;
$firstname=$this->firstname;
if (empty($lastname)) $lastname=($this->name?$this->name:$this->nom);
if (empty($lastname)) $lastname=($this->lastname?$this->lastname:($this->name?$this->name:$this->nom));
if (empty($firstname)) $firstname=$this->firstname;
$ret='';

View File

@ -898,8 +898,7 @@ class Form
$obj = $this->db->fetch_object($resql);
$contactstatic->id=$obj->rowid;
$contactstatic->name=$obj->name;
$contactstatic->lastname=$obj->name;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
if ($htmlname != 'none')

View File

@ -135,7 +135,7 @@ class Notify
dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file");
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.name, c.firstname,";
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname,";
$sql.= " a.rowid as adid, a.label, a.code, n.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
@ -157,7 +157,7 @@ class Notify
{
$obj = $this->db->fetch_object($result);
$sendto = $obj->firstname . " " . $obj->name . " <".$obj->email.">";
$sendto = $obj->firstname . " " . $obj->lastname . " <".$obj->email.">";
$actiondefid = $obj->adid;
if (dol_strlen($sendto))

View File

@ -200,7 +200,7 @@ class mailing_contacts1 extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname, other
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
$sql.= " c.name as name, c.firstname as firstname, c.civilite,";
$sql.= " c.lastname, c.firstname, c.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
@ -238,7 +238,7 @@ class mailing_contacts1 extends MailingTargets
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.

View File

@ -104,7 +104,7 @@ class mailing_contacts3 extends MailingTargets
$target[] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.

View File

@ -197,7 +197,7 @@ class mailing_fraise extends MailingTargets
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
($langs->transnoentities("Login").'='.$obj->login).';'.

View File

@ -95,7 +95,7 @@ class mailing_framboise extends MailingTargets
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''),
'source_url' => $this->url($obj->id),

View File

@ -176,7 +176,7 @@ class mailing_pomme extends MailingTargets
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
($langs->transnoentities("Login").'='.$obj->login).';'.

View File

@ -105,7 +105,7 @@ class mailing_thirdparties extends MailingTargets
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'name' => $obj->name,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''),
'source_url' => $this->url($obj->id),

View File

@ -122,7 +122,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
{
$cibles[$j] = array(
'email' => $obj->email,
'name' => $obj->name,
'lastname' => $obj->lastname,
'other' =>
('StartDate='.dol_print_date($this->db->jdate($obj->date_ouverture),'day')).';'.
('EndDate='.dol_print_date($this->db->jdate($obj->date_fin_validite),'day')).';'.

View File

@ -276,7 +276,7 @@ if ($resql)
print "<tr $bc[$var]>";
print '<td>';
$userstatic->id=$obj->rowid;
$userstatic->lastname=$obj->name;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
print $userstatic->getNomUrl(1);
print '</td>';

View File

@ -57,7 +57,7 @@ $limit = $conf->liste_limit;
* Mode liste
*/
$sql = "SELECT s.rowid as socid, s.nom, st.libelle as stcomm, p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
$sql = "SELECT s.rowid as socid, s.nom as name, st.libelle as stcomm, p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."socpeople as p, ".MAIN_DB_PREFIX."c_stcomm as st";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -85,13 +85,14 @@ if ($socid) {
$sql .= " AND s.rowid = ".$socid;
}
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($limit, $offset);
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit($limit, $offset);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
print_barre_liste($title." (".$langs->trans("Suppliers").")",$page, "contact.php", "",$sortfield,$sortorder,"",$num);
@ -111,11 +112,11 @@ if ($result)
$var=!$var;
print "<tr $bc[$var]>";
print "<tr ".$bc[$var].">";
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$obj->name.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$obj->lastname.'</a></td>';
print '<td>'.$obj->firstname.'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td>'.$obj->email.'</td>';
print '<td>'.$obj->phone.'</td>';
@ -131,7 +132,8 @@ else
dol_print_error($db);
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -46,7 +46,7 @@ $hookmanager->initHooks(array('salesrepresentativescard'));
if($_GET["socid"] && $_GET["commid"])
{
$action = 'add';
if ($user->rights->societe->creer)
{
@ -54,10 +54,10 @@ if($_GET["socid"] && $_GET["commid"])
$soc->id = $_GET["socid"];
$soc->fetch($_GET["socid"]);
$parameters=array('id'=>$_GET["commid"]);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$soc,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
if (empty($reshook)) $soc->add_commercial($user, $_GET["commid"]);
@ -74,19 +74,19 @@ if($_GET["socid"] && $_GET["commid"])
if($_GET["socid"] && $_GET["delcommid"])
{
$action = 'delete';
$action = 'delete';
if ($user->rights->societe->creer)
{
$soc = new Societe($db);
$soc->id = $_GET["socid"];
$soc->fetch($_GET["socid"]);
$parameters=array('id'=>$_GET["delcommid"]);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$soc,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
if (empty($reshook)) $soc->del_commercial($user, $_GET["delcommid"]);
header("Location: commerciaux.php?socid=".$soc->id);
@ -116,7 +116,7 @@ if ($_GET["socid"])
$result=$soc->fetch($_GET["socid"]);
$action='view';
$head=societe_prepare_head2($soc);
dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"),0,'company');
@ -182,13 +182,13 @@ if ($_GET["socid"])
$parameters=array('socid'=>$soc->id);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
null; // actions in normal case
}
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';
print $obj->firstname." " .$obj->name."\n";
print $obj->firstname." " .$obj->lastname."\n";
print '</a>&nbsp;';
if ($user->rights->societe->creer)
{
@ -254,7 +254,7 @@ if ($_GET["socid"])
print "<tr $bc[$var]><td>";
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';
print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n";
print $obj->firstname." " .$obj->lastname."\n";
print '</a>';
print '</td><td>'.$obj->login.'</td>';
print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';

View File

@ -301,7 +301,7 @@ if ($result > 0)
$obj = $db->fetch_object($resql);
$contactstatic->id=$obj->contactid;
$contactstatic->name=$obj->name;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
if ($obj->type == 'email')
@ -378,7 +378,7 @@ if ($result > 0)
$obj = $db->fetch_object($resql);
$contactstatic->id=$obj->id;
$contactstatic->name=$obj->name;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
print $obj->email?' &lt;'.$obj->email.'&gt;':$langs->trans("NoMail");

View File

@ -57,7 +57,7 @@ $pagenext = $page + 1;
llxHeader();
$sql = "SELECT s.nom, s.rowid as socid, c.name, c.firstname, a.label, n.rowid";
$sql = "SELECT s.nom, s.rowid as socid, c.lastname, c.firstname, a.label, n.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
@ -83,7 +83,7 @@ if ($result)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","",'valign="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Contact"),"index.php","c.name","","",'valign="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Contact"),"index.php","c.lastname","","",'valign="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),"index.php","a.titre","","",'valign="center"',$sortfield,$sortorder);
print "</tr>\n";
$var=True;
@ -95,7 +95,7 @@ if ($result)
print "<tr $bc[$var]>";
print "<td><a href=\"fiche.php?socid=".$obj->socid."\">$obj->nom</A></td>\n";
print "<td>".$obj->firstname." ".$obj->name."</td>\n";
print "<td>".$obj->firstname." ".$obj->lastname."</td>\n";
print "<td>".$obj->titre."</td>\n";
print "</tr>\n";
$i++;

View File

@ -188,7 +188,7 @@ class User extends CommonObject
$this->ref_ext = $obj->ref_ext;
$this->ldap_sid = $obj->ldap_sid;
$this->lastname = $obj->name;
$this->lastname = $obj->lastname;
$this->firstname = $obj->firstname;
$this->login = $obj->login;
@ -2194,7 +2194,7 @@ class User extends CommonObject
$this->users[$obj->rowid]['id'] = $obj->rowid;
$this->users[$obj->rowid]['fk_user'] = $obj->fk_user;
$this->users[$obj->rowid]['firstname'] = $obj->firstname;
$this->users[$obj->rowid]['name'] = $obj->name;
$this->users[$obj->rowid]['lastname'] = $obj->lastname;
$this->users[$obj->rowid]['login'] = $obj->login;
$this->users[$obj->rowid]['statut'] = $obj->statut;
$i++;

View File

@ -96,7 +96,6 @@ class UserGroup extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->entity = $obj->entity;
$this->nom = $obj->name; // depecated
$this->name = $obj->name;
$this->note = $obj->note;
$this->datec = $obj->datec;

View File

@ -2,7 +2,7 @@
<?php
/*
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2009-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2013 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
@ -57,8 +57,8 @@ $fname = DOL_DATA_ROOT.'/export-contacts.xls';
//$objPHPExcel = new writeexcel_workbook($fname);
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw");
$objPHPExcel->getProperties()->setLastModifiedBy("Maarten Balliauw");
$objPHPExcel->getProperties()->setCreator("Dolibarr script");
$objPHPExcel->getProperties()->setLastModifiedBy("Dolibarr script");
$objPHPExcel->getProperties()->setTitle("Test Document");
$objPHPExcel->getProperties()->setSubject("Test Document");
$objPHPExcel->getProperties()->setDescription("Test document, generated using PHP classes.");
@ -70,7 +70,7 @@ $objPHPExcel->getActiveSheet()->setTitle('Contacts');
//$page->set_column(0,4,18); // A
$sql = "SELECT distinct c.name as lastname, c.firstname, c.email, s.nom as name";
$sql = "SELECT distinct c.lastname, c.firstname, c.email, s.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = c.fk_soc";

View File

@ -85,7 +85,7 @@ if ($resql)
$total = 0;
}
$message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n";
$message .= $langs->trans("Invoice")." ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n";
$total += $obj->total_ttc;
dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email);