This commit is contained in:
Laurent Destailleur 2012-01-05 12:13:42 +01:00
parent eb507e0677
commit e340aa3622
14 changed files with 68 additions and 57 deletions

View File

@ -46,9 +46,9 @@ class Adherent extends CommonObject
var $ref; var $ref;
var $civilite_id; var $civilite_id;
var $firstname; var $firstname;
var $prenom; // TODO deprecated var $prenom; // deprecated
var $lastname; var $lastname;
var $nom; // TODO deprecated var $nom; // deprecated
var $login; var $login;
var $pass; var $pass;
var $societe; var $societe;
@ -62,16 +62,16 @@ class Adherent extends CommonObject
var $state_id; // Id of department var $state_id; // Id of department
var $state_code; // Code of department var $state_code; // Code of department
var $state; // Label of department var $state; // Label of department
var $fk_departement; // TODO deprecated var $fk_departement; // deprecated
var $departement_code; // TODO deprecated var $departement_code; // deprecated
var $departement; // TODO deprecated var $departement; // deprecated
var $country_id; var $country_id;
var $country_code; var $country_code;
var $country; var $country;
var $pays_id; // TODO deprecated var $pays_id; // deprecated
var $pays_code; // TODO deprecated var $pays_code; // deprecated
var $pays; // TODO deprecated var $pays; // deprecated
var $email; var $email;
var $phone; var $phone;
@ -193,13 +193,13 @@ class Adherent extends CommonObject
$infos=''; $infos='';
if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->nom."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->prenom."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n"; $infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
$infos.= $langs->transnoentities("Address").": ".$this->adresse."\n"; $infos.= $langs->transnoentities("Address").": ".$this->address."\n";
$infos.= $langs->transnoentities("Zip").": ".$this->cp."\n"; $infos.= $langs->transnoentities("Zip").": ".$this->zip."\n";
$infos.= $langs->transnoentities("Town").": ".$this->ville."\n"; $infos.= $langs->transnoentities("Town").": ".$this->town."\n";
$infos.= $langs->transnoentities("Country").": ".$this->pays."\n"; $infos.= $langs->transnoentities("Country").": ".$this->country."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n"; $infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
$infos.= $langs->transnoentities("Login").": ".$this->login."\n"; $infos.= $langs->transnoentities("Login").": ".$this->login."\n";
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n"; $infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
@ -212,13 +212,13 @@ class Adherent extends CommonObject
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1), '%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->prenom):$this->prenom, '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->nom):$this->nom, '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->adresse):$this->adresse, '%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->cp):$this->cp, '%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->ville):$this->ville, '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->pays):$this->pays, '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, '%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, '%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, '%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,

View File

@ -1430,19 +1430,23 @@ if ($rowid && $action != 'edit')
} }
} }
// Envoi fiche par mail // Send card by email
if ($object->statut >= 1)
{
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{
if ($object->statut >= 1)
{ {
if ($object->email) print "<a class=\"butAction\" href=\"fiche.php?rowid=$object->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n"; if ($object->email) print "<a class=\"butAction\" href=\"fiche.php?rowid=$object->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n";
else print "<a class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NoEMail"))."\">".$langs->trans("SendCardByMail")."</a>\n"; else print "<a class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NoEMail"))."\">".$langs->trans("SendCardByMail")."</a>\n";
} }
else else
{ {
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("SendCardByMail")."</font>"; print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("ValidateBefore"))."\">".$langs->trans("SendCardByMail")."</font>";
} }
} }
else
{
print "<font class=\"butActionRefused\" href=\"#\" title=\"".dol_escape_htmltag($langs->trans("NotEnoughPermissions"))."\">".$langs->trans("SendCardByMail")."</font>";
}
// Resilier // Resilier
if ($object->statut >= 1) if ($object->statut >= 1)

View File

@ -53,7 +53,6 @@ $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 .= " 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 .= " WHERE r.products_id = p.products_id";
$sql .= " GROUP BY r.products_id, p.products_model, p.products_quantity, p.products_status"; $sql .= " GROUP BY r.products_id, p.products_model, p.products_quantity, p.products_status";
$sql .= " ORDER BY $sortfield $sortorder "; $sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $dbosc->plimit($limit,$offset); $sql .= $dbosc->plimit($limit,$offset);

View File

@ -26,22 +26,31 @@
* \class Critique * \class Critique
* \brief Classe permettant la gestion des critiques OSCommerce * \brief Classe permettant la gestion des critiques OSCommerce
*/ */
class Critique { class Critique
{
var $db; var $db;
var $id; var $id;
var $nom; var $nom;
function Critique($DB, $id=0) { /**
$this->db = $DB; * Constructor
$this->id = $id ;
}
/*
*
*
* *
* @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; global $conf;
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name"; $sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name";
@ -67,8 +76,7 @@ class Critique {
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
print "<p>$sql";
} }
return $result; return $result;

View File

@ -61,14 +61,14 @@ if ($reqstock=='epuise')
$sql .= $dbosc->plimit($limit,$offset); $sql .= $dbosc->plimit($limit,$offset);
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">'; print '<tr class="liste_titre">';
print "<td>id</td>"; print "<td>id</td>";
print "<td>Ref</td>"; print "<td>Ref</td>";
print "<td>Titre</td>"; print "<td>Titre</td>";
print "<td>Groupe</td>"; print "<td>Groupe</td>";
print '<td align="center">Stock</td>'; print '<td align="center">Stock</td>';
print '<TD align="center">Status</TD>'; print '<td align="center">Status</td>';
print "</TR>\n"; print '</tr>'."\n";
$resql=$dbosc->query($sql); $resql=$dbosc->query($sql);
if ($resql) if ($resql)

View File

@ -179,7 +179,7 @@ MembersStatisticsDesc=Choose statistics you want to read...
MenuMembersStats=Statistics MenuMembersStats=Statistics
LastMemberDate=Last member date LastMemberDate=Last member date
Nature=Nature Nature=Nature
Public=Information are public (no=private) Public=Information are public
Exports=Exports Exports=Exports
NewMemberbyWeb=New member added. Awaiting approval NewMemberbyWeb=New member added. Awaiting approval
NewMemberForm=New member form NewMemberForm=New member form

View File

@ -183,7 +183,7 @@ MembersStatisticsDesc=Choisissez les statistiques que vous désirez consulter...
MenuMembersStats=Statistiques MenuMembersStats=Statistiques
LastMemberDate=Date dernier adhérent LastMemberDate=Date dernier adhérent
Nature=Nature Nature=Nature
Public=Informations publiques (no=privées) Public=Informations publiques
Exports=Exports Exports=Exports
NewMemberbyWeb=Nouvel Adherent ajoute. En attente de validation NewMemberbyWeb=Nouvel Adherent ajoute. En attente de validation
NewMemberForm=Nouvel Adherent form NewMemberForm=Nouvel Adherent form