diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 244418e2fb1..a26a7dfba67 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -46,9 +46,9 @@ class Adherent extends CommonObject var $ref; var $civilite_id; var $firstname; - var $prenom; // TODO deprecated + var $prenom; // deprecated var $lastname; - var $nom; // TODO deprecated + var $nom; // deprecated var $login; var $pass; var $societe; @@ -62,16 +62,16 @@ class Adherent extends CommonObject var $state_id; // Id of department var $state_code; // Code of department var $state; // Label of department - var $fk_departement; // TODO deprecated - var $departement_code; // TODO deprecated - var $departement; // TODO deprecated + var $fk_departement; // deprecated + var $departement_code; // deprecated + var $departement; // deprecated var $country_id; var $country_code; var $country; - var $pays_id; // TODO deprecated - var $pays_code; // TODO deprecated - var $pays; // TODO deprecated + var $pays_id; // deprecated + var $pays_code; // deprecated + var $pays; // deprecated var $email; var $phone; @@ -193,13 +193,13 @@ class Adherent extends CommonObject $infos=''; if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; - $infos.= $langs->transnoentities("Lastname").": ".$this->nom."\n"; - $infos.= $langs->transnoentities("Firstname").": ".$this->prenom."\n"; + $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; + $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; $infos.= $langs->transnoentities("Company").": ".$this->societe."\n"; - $infos.= $langs->transnoentities("Address").": ".$this->adresse."\n"; - $infos.= $langs->transnoentities("Zip").": ".$this->cp."\n"; - $infos.= $langs->transnoentities("Town").": ".$this->ville."\n"; - $infos.= $langs->transnoentities("Country").": ".$this->pays."\n"; + $infos.= $langs->transnoentities("Address").": ".$this->address."\n"; + $infos.= $langs->transnoentities("Zip").": ".$this->zip."\n"; + $infos.= $langs->transnoentities("Town").": ".$this->town."\n"; + $infos.= $langs->transnoentities("Country").": ".$this->country."\n"; $infos.= $langs->transnoentities("EMail").": ".$this->email."\n"; $infos.= $langs->transnoentities("Login").": ".$this->login."\n"; $infos.= $langs->transnoentities("Password").": ".$this->pass."\n"; @@ -212,13 +212,13 @@ class Adherent extends CommonObject '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1), - '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->prenom):$this->prenom, - '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->nom):$this->nom, + '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, + '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, - '%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->adresse):$this->adresse, - '%CP%'=>$msgishtml?dol_htmlentitiesbr($this->cp):$this->cp, - '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->ville):$this->ville, - '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->pays):$this->pays, + '%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address, + '%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, + '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, + '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, '%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, '%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, '%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 36e412ac105..eeb716938ca 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1430,18 +1430,22 @@ if ($rowid && $action != 'edit') } } - // Envoi fiche par mail - if ($object->statut >= 1) + // Send card by email + if ($user->rights->adherent->creer) { - if ($user->rights->adherent->creer) - { + if ($object->statut >= 1) + { if ($object->email) print "id&action=sendinfo\">".$langs->trans("SendCardByMail")."\n"; else print "trans("NoEMail"))."\">".$langs->trans("SendCardByMail")."\n"; - } - else - { - print "trans("NotEnoughPermissions"))."\">".$langs->trans("SendCardByMail").""; - } + } + else + { + print "trans("ValidateBefore"))."\">".$langs->trans("SendCardByMail").""; + } + } + else + { + print "trans("NotEnoughPermissions"))."\">".$langs->trans("SendCardByMail").""; } // Resilier diff --git a/htdocs/boutique/client/index.php b/htdocs/boutique/client/index.php index 9e364f082a3..c74a6d8ec03 100644 --- a/htdocs/boutique/client/index.php +++ b/htdocs/boutique/client/index.php @@ -52,7 +52,7 @@ print_barre_liste("Liste des clients", $page, "index.php"); $sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter"; $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."customers as c"; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $dbosc->plimit($limit ,$offset); +$sql .= $dbosc->plimit($limit,$offset); $resql=$dbosc->query($sql); if ($resql) diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php index 584738e454f..7a55172367d 100644 --- a/htdocs/boutique/commande/index.php +++ b/htdocs/boutique/commande/index.php @@ -50,7 +50,7 @@ print_barre_liste("Liste des commandes", $page, "commande.php"); $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t"; $sql .= " WHERE o.orders_id = t.orders_id AND t.class = 'ot_total'"; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $dbosc->plimit($limit ,$offset); +$sql .= $dbosc->plimit($limit,$offset); $resql=$dbosc->query($sql); if ($resql) diff --git a/htdocs/boutique/critiques/bestproduct.php b/htdocs/boutique/critiques/bestproduct.php index bb956db8dfb..e8f67b59c2e 100644 --- a/htdocs/boutique/critiques/bestproduct.php +++ b/htdocs/boutique/critiques/bestproduct.php @@ -53,9 +53,8 @@ $sql = "SELECT sum(r.reviews_rating)/count(r.reviews_rating) as rat, r.products_ $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."reviews as r,".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products as p "; $sql .= " WHERE r.products_id = p.products_id"; $sql .= " GROUP BY r.products_id, p.products_model, p.products_quantity, p.products_status"; - $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $dbosc->plimit($limit ,$offset); +$sql .= $dbosc->plimit($limit,$offset); print "
| ".$langs->trans("Ref");
diff --git a/htdocs/boutique/critiques/class/critique.class.php b/htdocs/boutique/critiques/class/critique.class.php
index d15471de94e..e47385d3876 100644
--- a/htdocs/boutique/critiques/class/critique.class.php
+++ b/htdocs/boutique/critiques/class/critique.class.php
@@ -26,22 +26,31 @@
* \class Critique
* \brief Classe permettant la gestion des critiques OSCommerce
*/
-class Critique {
- var $db ;
+class Critique
+{
+ var $db;
- var $id ;
+ var $id;
var $nom;
- function Critique($DB, $id=0) {
- $this->db = $DB;
- $this->id = $id ;
- }
- /*
- *
- *
+ /**
+ * Constructor
*
+ * @param DoliDB $db Database handler
*/
- function fetch ($id) {
+ function Critique($db)
+ {
+ $this->db = $DB;
+ }
+
+ /**
+ * Load instance
+ *
+ * @param int $id Id to load
+ * @return int <0 if KO, >0 if OK
+ */
+ function fetch ($id)
+ {
global $conf;
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name";
@@ -67,8 +76,7 @@ class Critique {
}
else
{
- print $this->db->error();
- print " $sql"; + print $this->db->lasterror(); } return $result; diff --git a/htdocs/boutique/critiques/index.php b/htdocs/boutique/critiques/index.php index f874d020d64..c6dbbba4b1e 100644 --- a/htdocs/boutique/critiques/index.php +++ b/htdocs/boutique/critiques/index.php @@ -51,7 +51,7 @@ $sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name F $sql .= " WHERE r.reviews_id = d.reviews_id AND r.products_id=p.products_id"; $sql .= " AND p.language_id = ".$conf->global->OSC_LANGUAGE_ID. " AND d.languages_id=".$conf->global->OSC_LANGUAGE_ID; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $dbosc->plimit($limit ,$offset); +$sql .= $dbosc->plimit($limit,$offset); print "
|