Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into
develop Conflicts: ChangeLog
This commit is contained in:
commit
43a248b88b
@ -36,7 +36,7 @@ jQuery blockUI 2.43 GPL and MIT Licence Yes JS libra
|
||||
jQuery jPicker 1.1.00 GPL and MIT Licence Yes JS library for color picker with not defined list of colors
|
||||
jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15)
|
||||
jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows)
|
||||
jQuery Mobile 1.0rc2 GPL and MIT Licence Yes JS library for smartphone (not used)
|
||||
jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used)
|
||||
jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips
|
||||
JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports)
|
||||
|
||||
|
||||
@ -30,6 +30,8 @@ For developers:
|
||||
- Add hook getFormMail.
|
||||
- Function plimit of databases drivers accept -1 as value (it means default value set
|
||||
into conf->liste_limit).
|
||||
- New: Add option dol_hide_topmenu and dol_hide_leftmenu onto login page.
|
||||
|
||||
For translators:
|
||||
- Update language files.
|
||||
|
||||
|
||||
71
dev/test/testdiv.php
Normal file
71
dev/test/testdiv.php
Normal file
@ -0,0 +1,71 @@
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<meta name="author" content="Dolibarr Development Team">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/dolibarrnew/theme/eldy/img/favicon.ico"/>
|
||||
<title>Login Dolibarr 3.4.0-alpha</title>
|
||||
<!-- Includes for JQuery (Ajax library) -->
|
||||
<link rel="stylesheet" type="text/css" href="/dolibarrnew/includes/jquery/css/smoothness/jquery-ui-latest.custom.css" />
|
||||
<link rel="stylesheet" type="text/css" title="default" href="/dolibarrnew/custom/filemanager/css/filemanager.css.php"><!-- Added by module filemanager-->
|
||||
<!-- Includes JS for JQuery -->
|
||||
<script type="text/javascript" src="/dolibarrnew/includes/jquery/js/jquery-latest.min.js"></script>
|
||||
<script type="text/javascript" src="/dolibarrnew/core/js/dst.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/dolibarrnew/theme/eldy/style.css.php?lang=fr_FR" />
|
||||
<!-- HTTP_USER_AGENT = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22 -->
|
||||
</head>
|
||||
<body class="body">
|
||||
|
||||
<center>
|
||||
|
||||
<div class="login_table" align="center">
|
||||
|
||||
<!-- <tr><td colspan="2" valign="middle"> -->
|
||||
<div id="login_line1" align="center">
|
||||
|
||||
<div id="login_left" style="display: inline-block; min-width: 250px; margin: 0 auto;"><center>
|
||||
|
||||
<table class="none" summary="Login pass" cellpadding="2" align="center">
|
||||
|
||||
<!-- Login -->
|
||||
<tr>
|
||||
<td valign="bottom"> <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r </td>
|
||||
<td valign="bottom" nowrap="nowrap">
|
||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="" tabindex="1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Password -->
|
||||
<tr><td valign="top" nowrap="nowrap"> <strong><label for="password">Mot de passe</label></strong> </td>
|
||||
<td valign="top" nowrap="nowrap">
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="" tabindex="2" autocomplete="off" />
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</div> <!-- end div left -->
|
||||
|
||||
<!-- </td>
|
||||
<td align="center" valign="middle">-->
|
||||
<div id="login_right" style="display: inline-block; min-width: 250px; margin: 0 auto;">
|
||||
|
||||
<img alt="Logo" title="" src="/dolibarrnew/theme/dolibarr_logo.png" id="img_logo" />
|
||||
|
||||
</div>
|
||||
</div> <!-- end div line1 -->
|
||||
<!--</td>
|
||||
|
||||
</tr>-->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<!-- END PHP TEMPLATE -->
|
||||
@ -364,10 +364,10 @@ abstract class ActionsAdherentCardCommon
|
||||
|
||||
if ($action == 'create_user')
|
||||
{
|
||||
// Full firstname and name separated with a dot : firstname.name
|
||||
// Full firstname and lastname separated with a dot : firstname.lastname
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$login=dol_buildlogin($this->object->nom, $this->object->prenom);
|
||||
$login=dol_buildlogin($this->object->lastname, $this->object->firstname);
|
||||
|
||||
$generated_password=getRandomPassword('');
|
||||
$password=$generated_password;
|
||||
@ -423,7 +423,6 @@ abstract class ActionsAdherentCardCommon
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
$this->object->pays_code = $obj->code;
|
||||
$this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
$this->object->country_code = $obj->code;
|
||||
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
|
||||
@ -66,7 +66,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['ville']; ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['town']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -654,7 +654,7 @@ if ($rowid)
|
||||
*/
|
||||
if ($action != 'addsubscription' && $action != 'create_thirdparty')
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,";
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||
$sql.= " c.dateadh,";
|
||||
$sql.= " c.datef,";
|
||||
|
||||
@ -61,8 +61,8 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
$arrayofmembers=array();
|
||||
|
||||
// requete en prenant que les adherents a jour de cotisation
|
||||
$sql = "SELECT d.rowid, d.prenom as firstname, d.nom as lastname, d.login, d.societe as company, d.datefin,";
|
||||
$sql.= " d.address, d.cp as zip, d.ville as town, d.naiss, d.email, d.photo,";
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,";
|
||||
$sql.= " d.address, d.zip, d.town, d.naiss, d.email, d.photo,";
|
||||
$sql.= " t.libelle as type,";
|
||||
$sql.= " p.code as country_code, p.libelle as country";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||
@ -109,12 +109,8 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/", // deprecated
|
||||
// For backward compatibility
|
||||
'%PRENOM%'=>$objp->firstname,
|
||||
'%NOM%'=>$objp->lastname,
|
||||
'%SOCIETE%'=>$objp->company,
|
||||
'%ADDRESS%'=>$objp->address,
|
||||
'%CP%'=>$objp->zip,
|
||||
'%VILLE%'=>$objp->town,
|
||||
'%ZIP%'=>$objp->zip,
|
||||
'%PAYS%'=>$objp->country,
|
||||
'%ANNEE%'=>$year,
|
||||
'%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/" // deprecated
|
||||
|
||||
@ -45,16 +45,12 @@ class Adherent extends CommonObject
|
||||
var $ref;
|
||||
var $civilite_id;
|
||||
var $firstname;
|
||||
var $prenom; // deprecated
|
||||
var $lastname;
|
||||
var $nom; // deprecated
|
||||
var $login;
|
||||
var $pass;
|
||||
var $societe;
|
||||
var $address;
|
||||
var $cp;
|
||||
var $zip;
|
||||
var $ville;
|
||||
var $town;
|
||||
|
||||
var $state_id; // Id of department
|
||||
@ -67,8 +63,6 @@ class Adherent extends CommonObject
|
||||
var $country_id;
|
||||
var $country_code;
|
||||
var $country;
|
||||
var $pays_id; // deprecated
|
||||
var $pays_code; // deprecated
|
||||
var $pays; // deprecated
|
||||
|
||||
var $email;
|
||||
@ -229,12 +223,8 @@ class Adherent extends CommonObject
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
// For backward compatibility
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%ADDRESS%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
);
|
||||
|
||||
@ -401,11 +391,11 @@ class Adherent extends CommonObject
|
||||
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass.", email=".$this->email);
|
||||
|
||||
// Clean parameters
|
||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->nom);
|
||||
$this->firstname=trim($this->firstname)?trim($this->firstname):trim($this->prenom);
|
||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname);
|
||||
$this->firstname=trim($this->firstname)?trim($this->firstname):trim($this->firstname);
|
||||
$this->address=($this->address?$this->address:$this->address);
|
||||
$this->zip=($this->zip?$this->zip:$this->cp);
|
||||
$this->town=($this->town?$this->town:$this->ville);
|
||||
$this->zip=($this->zip?$this->zip:$this->zip);
|
||||
$this->town=($this->town?$this->town:$this->town);
|
||||
$this->country_id=($this->country_id > 0?$this->country_id:$this->fk_pays);
|
||||
$this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement);
|
||||
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords(trim($this->lastname));
|
||||
@ -423,14 +413,14 @@ class Adherent extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql.= " civilite = ".(!is_null($this->civilite_id)?"'".$this->civilite_id."'":"null");
|
||||
$sql.= ", prenom = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
||||
$sql.= ", nom=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
||||
$sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
||||
$sql.= ", lastname=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
||||
$sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null");
|
||||
$sql.= ", societe=" .($this->societe?"'".$this->db->escape($this->societe)."'":"null");
|
||||
$sql.= ", fk_soc=" .($this->fk_soc > 0?"'".$this->fk_soc."'":"null");
|
||||
$sql.= ", address=" .($this->address?"'".$this->db->escape($this->address)."'":"null");
|
||||
$sql.= ", cp=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null");
|
||||
$sql.= ", ville=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
|
||||
$sql.= ", zip=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null");
|
||||
$sql.= ", town=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
|
||||
$sql.= ", pays=" .($this->country_id>0?"'".$this->country_id."'":"null");
|
||||
$sql.= ", fk_departement=".($this->state_id>0?"'".$this->state_id."'":"null");
|
||||
$sql.= ", email='".$this->email."'";
|
||||
@ -525,8 +515,6 @@ class Adherent extends CommonObject
|
||||
$luser->civilite_id=$this->civilite_id;
|
||||
$luser->firstname=$this->firstname;
|
||||
$luser->lastname=$this->lastname;
|
||||
$luser->prenom=$this->firstname; // deprecated
|
||||
$luser->nom=$this->lastname; // deprecated
|
||||
$luser->login=$this->user_login;
|
||||
$luser->pass=$this->pass;
|
||||
$luser->societe_id=$this->societe;
|
||||
@ -573,7 +561,7 @@ class Adherent extends CommonObject
|
||||
$lthirdparty->tel=$this->phone;
|
||||
$lthirdparty->state_id=$this->state_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
$lthirdparty->pays_id=$this->country_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
//$lthirdparty->phone_mobile=$this->phone_mobile;
|
||||
|
||||
$result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates
|
||||
@ -1018,7 +1006,7 @@ class Adherent extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT d.rowid, d.civilite, d.prenom as firstname, d.nom as lastname, d.societe, d.fk_soc, d.statut, d.public, d.address, d.cp as zip, d.ville as town, d.note,";
|
||||
$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.= " 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,";
|
||||
@ -1056,18 +1044,14 @@ class Adherent extends CommonObject
|
||||
$this->ref = $obj->rowid;
|
||||
$this->id = $obj->rowid;
|
||||
$this->civilite_id = $obj->civilite;
|
||||
$this->prenom = $obj->firstname; // deprecated
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->nom = $obj->lastname; // deprecated
|
||||
$this->lastname = $obj->lastname;
|
||||
$this->login = $obj->login;
|
||||
$this->pass = $obj->pass;
|
||||
$this->societe = $obj->societe;
|
||||
$this->fk_soc = $obj->fk_soc;
|
||||
$this->address = $obj->address;
|
||||
$this->cp = $obj->zip; // deprecated
|
||||
$this->zip = $obj->zip;
|
||||
$this->ville = $obj->town; // deprecated
|
||||
$this->town = $obj->town;
|
||||
|
||||
$this->state_id = $obj->fk_departement;
|
||||
@ -1083,8 +1067,6 @@ class Adherent extends CommonObject
|
||||
$this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code);
|
||||
else
|
||||
$this->country=$obj->country;
|
||||
$this->pays_id = $obj->country_id; // deprecated
|
||||
$this->pays_code = $obj->country_code; // deprecated
|
||||
$this->pays = $this->country; // deprecated
|
||||
|
||||
$this->phone = $obj->phone;
|
||||
@ -1817,14 +1799,14 @@ class Adherent extends CommonObject
|
||||
|
||||
// Member
|
||||
if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
|
||||
if ($this->nom && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom;
|
||||
if ($this->prenom && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom;
|
||||
if ($this->lastname && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->lastname;
|
||||
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
||||
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
||||
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
||||
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
||||
if ($this->cp && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp;
|
||||
if ($this->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
|
||||
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
||||
if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town;
|
||||
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
|
||||
if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
|
||||
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
|
||||
|
||||
@ -64,7 +64,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu
|
||||
if ($msg) print $msg.'<br>';
|
||||
|
||||
// Liste des cotisations
|
||||
$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe,";
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe,";
|
||||
$sql.= " c.rowid as crowid, c.cotisation,";
|
||||
$sql.= " c.dateadh,";
|
||||
$sql.= " c.datef,";
|
||||
@ -96,7 +96,7 @@ if ($result)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"cotisations.php","c.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled))
|
||||
@ -141,7 +141,7 @@ if ($result)
|
||||
// Ref
|
||||
print '<td>'.$cotisation->getNomUrl(1).'</td>';
|
||||
|
||||
// Nom
|
||||
// Lastname
|
||||
print '<td>'.$adherent->getNomUrl(1).'</td>';
|
||||
|
||||
// Login
|
||||
|
||||
@ -159,11 +159,11 @@ if ($id > 0)
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Nom
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -251,23 +251,18 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
|
||||
// Change values
|
||||
$object->civilite_id = trim($_POST["civilite_id"]);
|
||||
$object->prenom = trim($_POST["prenom"]); // deprecated
|
||||
$object->nom = trim($_POST["nom"]); // deprecated
|
||||
$object->firstname = trim($_POST["prenom"]);
|
||||
$object->lastname = trim($_POST["nom"]);
|
||||
$object->firstname = trim($_POST["firstname"]);
|
||||
$object->lastname = trim($_POST["lastname"]);
|
||||
$object->login = trim($_POST["login"]);
|
||||
$object->pass = trim($_POST["pass"]);
|
||||
|
||||
$object->societe = trim($_POST["societe"]);
|
||||
$object->address = trim($_POST["address"]);
|
||||
$object->cp = trim($_POST["zipcode"]); // deprecated
|
||||
$object->zip = trim($_POST["zipcode"]);
|
||||
$object->ville = trim($_POST["town"]); // deprecated
|
||||
$object->town = trim($_POST["town"]);
|
||||
$object->state_id = $_POST["departement_id"];
|
||||
$object->country_id = $_POST["country_id"];
|
||||
$object->fk_departement = $_POST["departement_id"]; // deprecated
|
||||
$object->pays_id = $_POST["country_id"]; // deprecated
|
||||
|
||||
$object->phone = trim($_POST["phone"]);
|
||||
$object->phone_perso = trim($_POST["phone_perso"]);
|
||||
@ -409,8 +404,8 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
|
||||
$typeid=$_POST["typeid"];
|
||||
$civilite_id=$_POST["civilite_id"];
|
||||
$nom=$_POST["nom"];
|
||||
$prenom=$_POST["prenom"];
|
||||
$lastname=$_POST["lastname"];
|
||||
$firstname=$_POST["firstname"];
|
||||
$societe=$_POST["societe"];
|
||||
$address=$_POST["address"];
|
||||
$zip=$_POST["zipcode"];
|
||||
@ -434,19 +429,14 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$socid=$_POST["socid"];
|
||||
|
||||
$object->civilite_id = $civilite_id;
|
||||
$object->prenom = $prenom; // deprecated
|
||||
$object->nom = $nom; // deprecated
|
||||
$object->firstname = $prenom;
|
||||
$object->lastname = $nom;
|
||||
$object->firstname = $firstname;
|
||||
$object->lastname = $lastname;
|
||||
$object->societe = $societe;
|
||||
$object->address = $address;
|
||||
$object->cp = $zip; // deprecated
|
||||
$object->zip = $zip;
|
||||
$object->ville = $town; // deprecated
|
||||
$object->town = $town;
|
||||
$object->fk_departement = $state_id;
|
||||
$object->state_id = $state_id;
|
||||
$object->pays_id = $country_id;
|
||||
$object->country_id = $country_id;
|
||||
$object->phone = $phone;
|
||||
$object->phone_perso = $phone_perso;
|
||||
@ -501,12 +491,12 @@ if ($action == 'add' && $user->rights->adherent->creer)
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."<br>\n";
|
||||
}
|
||||
}
|
||||
if (empty($nom)) {
|
||||
if (empty($lastname)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."<br>\n";
|
||||
}
|
||||
if ($morphy != 'mor' && (!isset($prenom) || $prenom=='')) {
|
||||
if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."<br>\n";
|
||||
@ -738,7 +728,6 @@ else
|
||||
if ($object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
$object->pays_code=$tmparray['code'];
|
||||
$object->pays=$tmparray['code'];
|
||||
$object->country_code=$tmparray['code'];
|
||||
$object->country=$tmparray['label'];
|
||||
@ -821,11 +810,11 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" value="'.(GETPOST('nom','alpha')?GETPOST('nom','alpha'):$object->lastname).'" size="40"></td>';
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.(GETPOST('lastname','alpha')?GETPOST('lastname','alpha'):$object->lastname).'" size="40"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(GETPOST('prenom','alpha')?GETPOST('prenom','alpha'):$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(GETPOST('firstname','alpha')?GETPOST('firstname','alpha'):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Password
|
||||
@ -967,8 +956,6 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$object->pays_id=$obj->rowid;
|
||||
$object->pays_code=$obj->code;
|
||||
$object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label;
|
||||
$object->country_id=$obj->rowid;
|
||||
$object->country_code=$obj->code;
|
||||
@ -1077,12 +1064,12 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Name
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->lastname).'"></td>';
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Password
|
||||
|
||||
@ -140,7 +140,7 @@ print $langs->trans("Ref").':</td><td><input type="text" name="search_ref" class
|
||||
print '</td><td rowspan="3"><input class="button" type="submit" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
print $langs->trans("Name").':</td><td><input type="text" name="search_nom" class="flat" size="16">';
|
||||
print $langs->trans("Name").':</td><td><input type="text" name="search_lastname" class="flat" size="16">';
|
||||
print '</td></tr>';
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
@ -205,7 +205,7 @@ $var=true;
|
||||
*/
|
||||
$max=5;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " a.tms as datem, datefin as date_end_subscription,";
|
||||
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
|
||||
@ -265,7 +265,7 @@ else
|
||||
*/
|
||||
$max=5;
|
||||
|
||||
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " datefin as date_end_subscription,";
|
||||
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c";
|
||||
|
||||
@ -108,11 +108,11 @@ print '<td class="valeur">';
|
||||
print $form->showrefnav($adh,'id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Nom
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
// Firstname
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -39,8 +39,8 @@ $filter=GETPOST("filter");
|
||||
$statut=GETPOST("statut");
|
||||
$search=GETPOST("search");
|
||||
$search_ref=GETPOST("search_ref");
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_prenom=GETPOST("search_prenom");
|
||||
$search_lastname=GETPOST("search_lastname");
|
||||
$search_firstname=GETPOST("search_firstname");
|
||||
$search_login=GETPOST("search_login");
|
||||
$type=GETPOST("type");
|
||||
$search_email=GETPOST("search_email");
|
||||
@ -56,14 +56,14 @@ $offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder=($filter=='outofdate'?"ASC":"DESC"); }
|
||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.nom"); }
|
||||
if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); }
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search="";
|
||||
$search_ref="";
|
||||
$search_nom="";
|
||||
$search_prenom="";
|
||||
$search_lastname="";
|
||||
$search_firstname="";
|
||||
$search_login="";
|
||||
$type="";
|
||||
$search_email="";
|
||||
@ -86,7 +86,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe as company, d.fk_soc,";
|
||||
$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,";
|
||||
$sql.= " d.datefin,";
|
||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||
$sql.= " t.libelle as type, t.cotisation";
|
||||
@ -103,9 +103,9 @@ if ($sall)
|
||||
{
|
||||
$sql.=" AND (";
|
||||
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
|
||||
$sql.=" d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.=" d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
|
||||
$sql.=" OR d.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
$sql.=" OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
}
|
||||
if ($type > 0)
|
||||
{
|
||||
@ -120,9 +120,9 @@ if ($search_ref)
|
||||
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$search_ref.")";
|
||||
else $sql.=" AND 1 = 2"; // Always wrong
|
||||
}
|
||||
if ($search_nom)
|
||||
if ($search_lastname)
|
||||
{
|
||||
$sql.= " AND (d.prenom LIKE '%".$search_nom."%' OR d.nom LIKE '%".$search_nom."%')";
|
||||
$sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
|
||||
}
|
||||
if ($search_login)
|
||||
{
|
||||
@ -216,7 +216,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"t.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
@ -233,7 +233,7 @@ if ($resql)
|
||||
print '<input class="flat" type="text" name="search_ref" value="'.$search_ref.'" size="4"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_nom" value="'.$search_nom.'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
|
||||
|
||||
@ -100,12 +100,12 @@ if ($mode)
|
||||
$tab='statstown';
|
||||
|
||||
$data = array();
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.ville as label2";
|
||||
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid";
|
||||
$sql.=" WHERE d.entity IN (".getEntity().")";
|
||||
$sql.=" AND d.statut = 1";
|
||||
$sql.=" GROUP BY p.libelle, p.code, d.ville";
|
||||
$sql.=" GROUP BY p.libelle, p.code, d.town";
|
||||
//print $sql;
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ $langs->load("members");
|
||||
$rowid = GETPOST('rowid','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
$search_lastname = GETPOST('search_nom','alpha');
|
||||
$search_lastname = GETPOST('search_lastname','alpha');
|
||||
$search_login = GETPOST('search_login','alpha');
|
||||
$search_email = GETPOST('search_email','alpha');
|
||||
$type = GETPOST('type','alpha');
|
||||
@ -49,7 +49,7 @@ $offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) { $sortorder="DESC"; }
|
||||
if (! $sortfield) { $sortfield="d.nom"; }
|
||||
if (! $sortfield) { $sortfield="d.lastname"; }
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
|
||||
@ -405,7 +405,7 @@ if ($rowid > 0)
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe, ";
|
||||
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, ";
|
||||
$sql.= " d.datefin,";
|
||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||
$sql.= " t.libelle as type, t.cotisation";
|
||||
@ -415,9 +415,9 @@ if ($rowid > 0)
|
||||
$sql.= " AND t.rowid = ".$adht->id;
|
||||
if ($sall)
|
||||
{
|
||||
$sql.= " AND (d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
|
||||
$sql.= " OR d.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
$sql.= " OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
@ -427,12 +427,12 @@ if ($rowid > 0)
|
||||
{
|
||||
if (isset($_POST['search']) && $_POST['search'] != '')
|
||||
{
|
||||
$sql.= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
|
||||
$sql.= " AND (d.firstname LIKE '%".$_POST['search']."%' OR d.lastname LIKE '%".$_POST['search']."%')";
|
||||
}
|
||||
}
|
||||
if (! empty($search_lastname))
|
||||
{
|
||||
$sql.= " AND (d.prenom LIKE '%".$search_lastname."%' OR d.nom LIKE '%".$search_lastname."%')";
|
||||
$sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
|
||||
}
|
||||
if (! empty($search_login))
|
||||
{
|
||||
@ -492,8 +492,8 @@ if ($rowid > 0)
|
||||
|
||||
$param="&rowid=".$rowid;
|
||||
if (! empty($status)) $param.="&status=".$status;
|
||||
if (! empty($search_lastname)) $param.="&search_nom=".$search_lastname;
|
||||
if (! empty($search_firstname)) $param.="&search_prenom=".$search_firstname;
|
||||
if (! empty($search_lastname)) $param.="&search_lastname=".$search_lastname;
|
||||
if (! empty($search_firstname)) $param.="&search_firstname=".$search_firstname;
|
||||
if (! empty($search_login)) $param.="&search_login=".$search_login;
|
||||
if (! empty($search_email)) $param.="&search_email=".$search_email;
|
||||
if (! empty($filter)) $param.="&filter=".$filter;
|
||||
@ -508,7 +508,7 @@ if ($rowid > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
|
||||
@ -524,7 +524,7 @@ if ($rowid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_nom" value="'.$search_lastname.'" size="12"></td>';
|
||||
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
|
||||
@ -556,7 +556,7 @@ if ($rowid > 0)
|
||||
$adh->lastname=$objp->lastname;
|
||||
$adh->firstname=$objp->firstname;
|
||||
|
||||
// Nom
|
||||
// Lastname
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
if ($objp->societe != '')
|
||||
|
||||
219
htdocs/admin/carrier.php
Normal file
219
htdocs/admin/carrier.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/carrier.php
|
||||
* \ingroup expedition
|
||||
* \brief Page d'administration des Transporteurs
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("sendings");
|
||||
$langs->load("deliveries");
|
||||
$langs->load('other');
|
||||
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$carrier=GETPOST('carrier','int');
|
||||
|
||||
$object = new Expedition($db);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
//if ($action==setvalue AND $carrier)
|
||||
if ($action==setvalue)
|
||||
{
|
||||
// need to add check on values
|
||||
$object->update[code]=GETPOST('code','alpha');
|
||||
$object->update[libelle]=GETPOST('libelle','alpha');
|
||||
$object->update[description]=GETPOST('description','alpha');
|
||||
$object->update[tracking]=GETPOST('tracking','alpha');
|
||||
$object->update_delivery_method($carrier);
|
||||
header("Location: carrier.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action==activate_carrier AND $carrier!='')
|
||||
{
|
||||
$object->activ_delivery_method($carrier);
|
||||
}
|
||||
|
||||
if ($action==disable_carrier AND $carrier!='')
|
||||
{
|
||||
$object->disable_delivery_method($carrier);
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader("","");
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("SendingsSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
|
||||
//if ($mesg) print $mesg.'<br>';
|
||||
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
|
||||
$head[$h][1] = $langs->trans("Carriers");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Sending");
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
/*
|
||||
* Carrier List
|
||||
*/
|
||||
if ($action=='edit_carrier' || $action=='setvalue')
|
||||
{
|
||||
// Carrier Edit
|
||||
if ($carrier!='') $object->list_delivery_methods($carrier);
|
||||
print_titre($langs->trans("CarrierEdit"));
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?carrier='.$carrier.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setvalue">';
|
||||
|
||||
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
$var=true;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="150">'.$langs->trans("CarrierParameter").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||
print $langs->trans("Code").'</td><td>';
|
||||
print '<input size="32" type="text" name="code" value="'.$object->listmeths[0][code].'">';
|
||||
print ' '.$langs->trans("Example").': CODE';
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||
print $langs->trans("Name").'</td><td>';
|
||||
print '<input size="32" type="text" name="libelle" value="'.$object->listmeths[0][libelle].'">';
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||
print $langs->trans("Description").'</td><td>';
|
||||
print '<input size="64" type="text" name="description" value="'.$object->listmeths[0][description].'">';
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||
print $langs->trans("Tracking").'</td><td>';
|
||||
print '<input size="128" type="text" name="tracking" value="'.$object->listmeths[0][tracking].'">';
|
||||
print ' '.$langs->trans("Example").': http://www.website.com/dir/{TRACKID}';
|
||||
print '</td></tr>';
|
||||
|
||||
if ($carrier)
|
||||
{
|
||||
print '<tr><td colspan="2" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="2" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Display List
|
||||
$object->list_delivery_methods();
|
||||
$var=true;
|
||||
print_titre($langs->trans("CarrierList"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="80">'.$langs->trans("Code").'</td>';
|
||||
print '<td width="150">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("TrackingUrl").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="30">'.$langs->trans("Edit").'</td>';
|
||||
print "</tr>\n";
|
||||
for ($i=0; $i<sizeof($object->listmeths); $i++)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>'.$object->listmeths[$i][code].'</td>';
|
||||
print '<td>'.$object->listmeths[$i][libelle].'</td>';
|
||||
print '<td>'.$object->listmeths[$i][description].'</td>';
|
||||
print '<td>'.$object->listmeths[$i][tracking].'</td>';
|
||||
print '<td align="center">';
|
||||
if($object->listmeths[$i][active] == 0)
|
||||
{
|
||||
print '<a href="carrier.php?action=activate_carrier&carrier='.$object->listmeths[$i][rowid].'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="carrier.php?action=disable_carrier&carrier='.$object->listmeths[$i][rowid].'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||
}
|
||||
print '</td><td align="center">';
|
||||
print '<a href="carrier.php?action=edit_carrier&carrier='.$object->listmeths[$i][rowid].'">'.img_picto($langs->trans("Edit"),'edit').'</a>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '<tr><td align="center"><a href="carrier.php?action=edit_carrier"><br>'.$langs->trans("Add").'</a></td><tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -65,9 +65,9 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADRESSE",$_POST["address"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_VILLE",$_POST["ville"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_CP",$_POST["cp"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_DEPARTEMENT",$_POST["departement_id"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity);
|
||||
@ -276,15 +276,15 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyAddress").'</td><td>';
|
||||
print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADRESSE?$conf->global->MAIN_INFO_SOCIETE_ADRESSE:$_POST["address"]) . '</textarea></td></tr>'."\n";
|
||||
print '<textarea name="address" cols="80" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:$_POST["address"]) . '</textarea></td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyZip").'</td><td>';
|
||||
print '<input name="cp" value="'. ($conf->global->MAIN_INFO_SOCIETE_CP?$conf->global->MAIN_INFO_SOCIETE_CP:$_POST["cp"]) . '" size="10"></td></tr>'."\n";
|
||||
print '<input name="zipcode" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:$_POST["zipcode"]) . '" size="10"></td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyTown").'</td><td>';
|
||||
print '<input name="ville" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_VILLE?$conf->global->MAIN_INFO_SOCIETE_VILLE:$_POST["ville"]) . '"></td></tr>'."\n";
|
||||
print '<input name="town" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:$_POST["town"]) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
$var=!$var;
|
||||
@ -646,13 +646,13 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADRESSE)?'':$conf->global->MAIN_INFO_SOCIETE_ADRESSE) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_CP)?'':$conf->global->MAIN_INFO_SOCIETE_CP) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_VILLE)?'':$conf->global->MAIN_INFO_SOCIETE_VILLE) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyCountry").'</td><td>';
|
||||
|
||||
@ -84,6 +84,10 @@ $head[$h][1] = $langs->trans("Setup");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
|
||||
$head[$h][1] = $langs->trans("Carriers");
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
|
||||
@ -128,20 +128,20 @@ $tablib[24]= "DictionnaryAccountancysystem";
|
||||
|
||||
// Requete pour extraction des donnees des dictionnaires
|
||||
$tabsql=array();
|
||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
||||
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as pays_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
|
||||
$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
||||
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
|
||||
$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays";
|
||||
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c";
|
||||
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
|
||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as pays, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
|
||||
$tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
|
||||
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
|
||||
$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
|
||||
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
|
||||
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
|
||||
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
|
||||
@ -151,7 +151,7 @@ $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREF
|
||||
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
|
||||
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
|
||||
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
|
||||
|
||||
// Critere de tri du dictionnaire
|
||||
$tabsqlsort=array();
|
||||
@ -183,19 +183,19 @@ $tabsqlsort[24]="pcg_version ASC";
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
$tabfield[1] = "code,libelle,pays";
|
||||
$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,pays_code-pays"
|
||||
$tabfield[3] = "code,libelle,pays_id,pays";
|
||||
$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,country_code-pays"
|
||||
$tabfield[3] = "code,libelle,country_id,pays";
|
||||
$tabfield[4] = "code,libelle";
|
||||
$tabfield[5] = "code,libelle";
|
||||
$tabfield[6] = "code,libelle,type,position";
|
||||
$tabfield[7] = "code,libelle,pays_id,pays,accountancy_code,deductible";
|
||||
$tabfield[7] = "code,libelle,country_id,pays,accountancy_code,deductible";
|
||||
$tabfield[8] = "code,libelle";
|
||||
$tabfield[9] = "code,label,unicode";
|
||||
$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfield[11]= "element,source,code,libelle";
|
||||
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
|
||||
$tabfield[13]= "code,libelle,type";
|
||||
$tabfield[14]= "code,libelle,price,organization,pays_id,pays";
|
||||
$tabfield[14]= "code,libelle,price,organization,country_id,pays";
|
||||
$tabfield[15]= "code,libelle,width,height,unit";
|
||||
$tabfield[16]= "code,libelle";
|
||||
$tabfield[17]= "code,libelle";
|
||||
@ -205,7 +205,7 @@ $tabfield[20]= "code,libelle";
|
||||
$tabfield[21]= "code,label";
|
||||
$tabfield[22]= "code,label";
|
||||
$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
|
||||
$tabfield[24]= "pcg_version,pays_id,pays,label";
|
||||
$tabfield[24]= "pcg_version,country_id,pays,label";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
@ -673,8 +673,8 @@ if ($id)
|
||||
|
||||
if ($sortfield)
|
||||
{
|
||||
// If sort order is "pays", we use pays_code instead
|
||||
if ($sortfield == 'pays') $sortfield='pays_code';
|
||||
// If sort order is "pays", we use country_code instead
|
||||
if ($sortfield == 'pays') $sortfield='country_code';
|
||||
$sql.= " ORDER BY ".$sortfield;
|
||||
if ($sortorder)
|
||||
{
|
||||
@ -739,7 +739,7 @@ if ($id)
|
||||
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
|
||||
@ -853,7 +853,7 @@ if ($id)
|
||||
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
||||
@ -923,14 +923,14 @@ if ($id)
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='pays') {
|
||||
if (empty($obj->pays_code))
|
||||
if (empty($obj->country_code))
|
||||
{
|
||||
$valuetoshow='-';
|
||||
}
|
||||
else
|
||||
{
|
||||
$key=$langs->trans("Country".strtoupper($obj->pays_code));
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->pays_code)?$obj->pays_code." - ".$key:$obj->pays);
|
||||
$key=$langs->trans("Country".strtoupper($obj->country_code));
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->pays);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
|
||||
@ -1014,7 +1014,7 @@ if ($id)
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
else if ($fieldlist[$field]=='unicode') {
|
||||
@ -1196,12 +1196,12 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
if ($fieldlist[$field] == 'pays') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
print '<td>';
|
||||
print $form->select_country((! empty($obj->pays_code)?$obj->pays_code:(! empty($obj->pays)?$obj->pays:'')), 'pays', '', 28);
|
||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->pays)?$obj->pays:'')), 'pays', '', 28);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'pays_id') {
|
||||
$pays_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$pays_id.'">';
|
||||
elseif ($fieldlist[$field] == 'country_id') {
|
||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region') {
|
||||
print '<td>';
|
||||
|
||||
@ -201,6 +201,10 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
|
||||
$head[$h][1] = $langs->trans("Carriers");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Sending");
|
||||
$hselected=$h;
|
||||
@ -208,9 +212,9 @@ $h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$h++;
|
||||
}
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
@ -230,7 +230,7 @@ print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
|
||||
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_ADDRESS"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked="checked"':'')."></td>";
|
||||
print '</tr>';
|
||||
|
||||
// CP
|
||||
// ZIP
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_CONTACT_FIELD_ZIP.'">';
|
||||
@ -238,7 +238,7 @@ print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
|
||||
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_ZIP"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked="checked"':'')."></td>";
|
||||
print '</tr>';
|
||||
|
||||
// Ville
|
||||
// TOWN
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_CONTACT_FIELD_TOWN.'">';
|
||||
@ -246,7 +246,7 @@ print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
|
||||
print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIELD_TOWN"'.($conf->global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked="checked"':'')."></td>";
|
||||
print '</tr>';
|
||||
|
||||
// Pays
|
||||
// COUNTRY
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_CONTACT_FIELD_COUNTRY.'">';
|
||||
|
||||
@ -271,7 +271,7 @@ print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// CP
|
||||
// ZIP
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_MEMBER_FIELD_ZIP.'">';
|
||||
@ -279,7 +279,7 @@ print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Ville
|
||||
// TOWN
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_MEMBER_FIELD_TOWN.'">';
|
||||
@ -287,7 +287,7 @@ print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Pays
|
||||
// COUNTRY
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_MEMBER_FIELD_COUNTRY.'">';
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* 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
|
||||
@ -50,13 +50,13 @@ $type='delivery';
|
||||
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstdelivery=GETPOST('maskconstdelivery','alpha');
|
||||
$maskdelivery=GETPOST('maskdelivery','alpha');
|
||||
if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity);
|
||||
$maskconstdelivery=GETPOST('maskconstdelivery','alpha');
|
||||
$maskdelivery=GETPOST('maskdelivery','alpha');
|
||||
if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
@ -68,12 +68,12 @@ if ($action == 'updateMask')
|
||||
|
||||
if ($action == 'set_DELIVERY_FREE_TEXT')
|
||||
{
|
||||
$free=GETPOST('DELIVERY_FREE_TEXT','alpha');
|
||||
$free=GETPOST('DELIVERY_FREE_TEXT','alpha');
|
||||
$res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
@ -85,58 +85,58 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
|
||||
|
||||
if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module','alpha');
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
$sending = new Livraison($db);
|
||||
$sending->initAsSpecimen();
|
||||
$sending = new Livraison($db);
|
||||
$sending->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/livraison/pdf/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Search template files
|
||||
$file=''; $classname=''; $filefound=0;
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
foreach($dirmodels as $reldir)
|
||||
{
|
||||
$file=dol_buildpath($reldir."core/modules/livraison/pdf/pdf_".$modele.".modules.php",0);
|
||||
if (file_exists($file))
|
||||
{
|
||||
$filefound=1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound)
|
||||
{
|
||||
require_once $file;
|
||||
if ($filefound)
|
||||
{
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($sending,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
if ($module->write_file($sending,$langs) > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
if ($ret > 0)
|
||||
{
|
||||
if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity);
|
||||
}
|
||||
@ -146,17 +146,17 @@ if ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->LIVRAISON_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmod')
|
||||
@ -164,7 +164,7 @@ if ($action == 'setmod')
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
||||
dolibarr_set_const($db, "LIVRAISON_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "LIVRAISON_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
|
||||
@ -189,11 +189,15 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
|
||||
$head[$h][1] = $langs->trans("Carriers");
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Sending");
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
$head[$h][1] = $langs->trans("Sending");
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
|
||||
@ -222,34 +226,34 @@ clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/livraison/");
|
||||
$dir = dol_buildpath($reldir."core/modules/livraison/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
$var=true;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
$var=true;
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/livraison/".$file.'.php';
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/livraison/".$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
$module = new $file;
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
@ -259,48 +263,48 @@ foreach ($dirmodels as $reldir)
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->LIVRAISON_ADDON == "$file")
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
if ($conf->global->LIVRAISON_ADDON == "$file")
|
||||
{
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$livraison=new Livraison($db);
|
||||
$livraison->initAsSpecimen();
|
||||
$livraison=new Livraison($db);
|
||||
$livraison->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval=$module->getNextValue($mysoc,$livraison);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval)
|
||||
{
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval=$module->getNextValue($mysoc,$livraison);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
|
||||
{
|
||||
$htmltooltip.=''.$langs->trans("NextValue").': ';
|
||||
if ($nextval)
|
||||
{
|
||||
$htmltooltip.=$nextval.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -352,77 +356,77 @@ clearstatcache();
|
||||
$var=true;
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/");
|
||||
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/");
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
$var=!$var;
|
||||
$var=!$var;
|
||||
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $name;
|
||||
print "</td><td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db);
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $name;
|
||||
print "</td><td>\n";
|
||||
require_once $dir.$file;
|
||||
$module = new $classname($db);
|
||||
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
|
||||
// Activ
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
// Activ
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_picto($langs->trans("Default"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_picto($langs->trans("Default"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||
print '</td>';
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -233,7 +233,7 @@ 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.name, u.firstname";
|
||||
$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";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -200,7 +200,6 @@ if (function_exists("imagecreatefrompng"))
|
||||
}
|
||||
else
|
||||
{
|
||||
$form = new Form($db);
|
||||
$desc = $form->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,'warning');
|
||||
print $desc;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ print_fiche_titre($langs->trans("Bookmarks"));
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
$sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
|
||||
$sql.= " u.login, u.name, u.firstname";
|
||||
$sql.= " u.login, u.lastname, u.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
|
||||
$sql.= " WHERE 1=1";
|
||||
if (! $user->admin) $sql.= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)";
|
||||
@ -91,7 +91,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Title"),'','')."</td>";
|
||||
print_liste_field_titre($langs->trans("Link"),'','')."</td>";
|
||||
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"')."</td>";
|
||||
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.name","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
|
||||
@ -65,7 +65,7 @@ class BoutiqueCommande
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value";
|
||||
$sql = "SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_zipcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_zipcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value";
|
||||
$sql.= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders";
|
||||
$sql.= " WHERE orders_id = ".$id;
|
||||
|
||||
@ -84,13 +84,13 @@ class BoutiqueCommande
|
||||
|
||||
$this->delivery_adr->name = stripslashes($array["delivery_name"]);
|
||||
$this->delivery_adr->street = stripslashes($array["delivery_street_address"]);
|
||||
$this->delivery_adr->cp = stripslashes($array["delivery_postcode"]);
|
||||
$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->billing_adr->name = stripslashes($array["billing_name"]);
|
||||
$this->billing_adr->street = stripslashes($array["billing_street_address"]);
|
||||
$this->billing_adr->cp = stripslashes($array["billing_postcode"]);
|
||||
$this->billing_adr->zip = stripslashes($array["billing_zipcode"]);
|
||||
$this->billing_adr->city = stripslashes($array["billing_city"]);
|
||||
$this->billing_adr->country = stripslashes($array["billing_country"]);
|
||||
|
||||
|
||||
@ -55,8 +55,8 @@ if ($id > 0)
|
||||
|
||||
print "<tr><td>".$langs->trans("Address")."</td><td>".$langs->trans("Delivery")."</td><td>".$langs->trans("Invoice")."</td></tr>";
|
||||
|
||||
print "<td> </td><td>".$commande->delivery_adr->name."<br>".$commande->delivery_adr->street."<br>".$commande->delivery_adr->cp."<br>".$commande->delivery_adr->city."<br>".$commande->delivery_adr->country."</td>";
|
||||
print "<td>".$commande->billing_adr->name."<br>".$commande->billing_adr->street."<br>".$commande->billing_adr->cp."<br>".$commande->billing_adr->city."<br>".$commande->billing_adr->country."</td>";
|
||||
print "<td> </td><td>".$commande->delivery_adr->name."<br>".$commande->delivery_adr->street."<br>".$commande->delivery_adr->zip."<br>".$commande->delivery_adr->city."<br>".$commande->delivery_adr->country."</td>";
|
||||
print "<td>".$commande->billing_adr->name."<br>".$commande->billing_adr->street."<br>".$commande->billing_adr->zip."<br>".$commande->billing_adr->city."<br>".$commande->billing_adr->country."</td>";
|
||||
print "</tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -94,8 +94,8 @@ if ( $retour >= 0 )
|
||||
|
||||
$_SESSION['uid'] = $tab['rowid'];
|
||||
$_SESSION['uname'] = $username;
|
||||
$_SESSION['nom'] = $tab['name'];
|
||||
$_SESSION['prenom'] = $tab['firstname'];
|
||||
$_SESSION['lastname'] = $tab['lastname'];
|
||||
$_SESSION['firstname'] = $tab['firstname'];
|
||||
$_SESSION['CASHDESK_ID_THIRDPARTY'] = $thirdpartyid;
|
||||
$_SESSION['CASHDESK_ID_WAREHOUSE'] = $warehouseid;
|
||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : '');
|
||||
|
||||
@ -66,7 +66,7 @@ print '<li class="menu_choix1"><a href="affIndex.php?menu=facturation&id=NOUV"><
|
||||
// Open new tab on backoffice (this is not a disconnect from POS)
|
||||
print '<li class="menu_choix2"><a href=".." target="backoffice"><span>'.$langs->trans("BackOffice").'</span></a></li>';
|
||||
// Disconnect
|
||||
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['prenom'].' '.$_SESSION['nom'];
|
||||
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname'].' '.$_SESSION['lastname'];
|
||||
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
||||
print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
|
||||
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
||||
|
||||
@ -243,8 +243,8 @@ if ($socid)
|
||||
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">'.nl2br($soc->address).'</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->cp."</td>";
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$soc->ville."</td></tr>";
|
||||
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->zip."</td>";
|
||||
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$soc->town."</td></tr>";
|
||||
|
||||
// Country
|
||||
if ($soc->pays)
|
||||
@ -407,12 +407,12 @@ else if ($id || $ref)
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->nom.' </td>';
|
||||
// Lastname
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->lastname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prenom
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->prenom.' </td>';
|
||||
// Firstname
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->firstname.' </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Status
|
||||
|
||||
@ -338,8 +338,8 @@ if ($object->type == 3)
|
||||
print '<td nowrap="nowrap" valign="top">';
|
||||
print $member->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$member->nom."</td>\n";
|
||||
print '<td valign="top">'.$member->prenom."</td>\n";
|
||||
print '<td valign="top">'.$member->lastname."</td>\n";
|
||||
print '<td valign="top">'.$member->firstname."</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= " a.priority, a.fulldayevent, a.location,";
|
||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
|
||||
$sql.= " s.nom as socname,";
|
||||
$sql.= " u.firstname, u.name as lastname";
|
||||
$sql.= " u.firstname, u.lastname as lastname";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
|
||||
@ -874,7 +874,7 @@ class ActionComm extends CommonObject
|
||||
$sql.= " a.fk_contact, a.percent as percentage,";
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
$sql.= " a.priority, a.fulldayevent, a.location,";
|
||||
$sql.= " u.firstname, u.name,";
|
||||
$sql.= " u.firstname, u.lastname,";
|
||||
$sql.= " s.nom as socname,";
|
||||
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||
|
||||
@ -454,7 +454,7 @@ else
|
||||
if ($showbirthday)
|
||||
{
|
||||
// Add events in array
|
||||
$sql = 'SELECT sp.rowid, sp.name, sp.firstname, sp.birthday';
|
||||
$sql = 'SELECT sp.rowid, sp.lastname, sp.firstname, sp.birthday';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'socpeople as sp';
|
||||
$sql.= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.$user->id.'))';
|
||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||
|
||||
@ -152,7 +152,7 @@ $sql.= " c.code as acode, c.libelle,";
|
||||
$sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
|
||||
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
|
||||
$sql.= " ud.login as logindone, ud.rowid as useriddone,";
|
||||
$sql.= " sp.name, sp.firstname";
|
||||
$sql.= " sp.lastname, sp.firstname";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX.'user as u,';
|
||||
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||
|
||||
@ -205,7 +205,7 @@ if ($action == 'create')
|
||||
$object->note = $_POST["note"];
|
||||
}
|
||||
|
||||
// On positionne pays_id, pays_code et libelle du pays choisi
|
||||
// On positionne country_id, country_code et libelle du pays choisi
|
||||
$object->country_id = (GETPOST('country_id','int') ? GETPOST('country_id','int') : $mysoc->country_id);
|
||||
if ($object->country_id)
|
||||
{
|
||||
@ -333,7 +333,7 @@ elseif ($action == 'edit')
|
||||
$object->fax = $_POST["fax"];
|
||||
$object->note = $_POST["note"];
|
||||
|
||||
// On positionne country_id, pays_code et libelle du pays choisi
|
||||
// On positionne country_id, country_code et libelle du pays choisi
|
||||
if ($object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
|
||||
@ -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.name, u.firstname";
|
||||
$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.= " 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;
|
||||
@ -108,7 +108,7 @@ if ($resql)
|
||||
print "<tr class=\"liste_titre\">";
|
||||
//print "<td> </td>";
|
||||
print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"],"bid","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.name","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.lastname","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Url"),$_SERVER["PHP_SELF"],"b.url","","",'',$sortfield,$sortorder);
|
||||
|
||||
@ -39,7 +39,7 @@ $offset = $limit * $page ;
|
||||
|
||||
$type=GETPOST('type', 'alpha');
|
||||
$search_lastname=GETPOST('search_nom')?GETPOST('search_nom'):GETPOST('search_lastname'); // For backward compatibility
|
||||
$search_firstname=GETPOST('search_prenom')?GETPOST('search_prenom'):GETPOST('search_firstname'); // For backward compatibility
|
||||
$search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility
|
||||
$search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility
|
||||
$contactname=GETPOST('contactname');
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ if (! $sortfield) $sortfield="s.nom";
|
||||
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_zipcode=GETPOST("search_zipcode");
|
||||
$search_ville=GETPOST("search_ville");
|
||||
$search_town=GETPOST("search_town");
|
||||
$search_code=GETPOST("search_code");
|
||||
$search_compta=GETPOST("search_compta");
|
||||
|
||||
@ -77,7 +77,7 @@ if (GETPOST("button_removefilter_x"))
|
||||
$socname="";
|
||||
$search_nom="";
|
||||
$search_zipcode="";
|
||||
$search_ville="";
|
||||
$search_town="";
|
||||
$search_idprof1='';
|
||||
$search_idprof2='';
|
||||
$search_idprof3='';
|
||||
@ -96,7 +96,7 @@ $thirdpartystatic=new Societe($db);
|
||||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.cp as zip, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
|
||||
$sql.= " s.datec, s.datea, s.canvas";
|
||||
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
@ -116,8 +116,8 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
|
||||
if ($search_zipcode) $sql.= " AND s.cp LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape($search_ville)."%'";
|
||||
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_town) $sql.= " AND s.town LIKE '%".$db->escape($search_town)."%'";
|
||||
if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
|
||||
if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
|
||||
// Insert sale filter
|
||||
@ -142,7 +142,7 @@ if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_ville=".$search_ville;
|
||||
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||
if ($search_sale != '') $param.='&search_sale='.$search_sale;
|
||||
|
||||
@ -177,8 +177,8 @@ if ($result)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.cp","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
|
||||
@ -200,7 +200,7 @@ if ($result)
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_ville" value="'.$search_ville.'" size="10">';
|
||||
print '<input type="text" class="flat" name="search_town" value="'.$search_town.'" size="10">';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
@ -241,7 +241,7 @@ if ($result)
|
||||
print $thirdpartystatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td>'.$obj->zip.'</td>';
|
||||
print '<td>'.$obj->ville.'</td>';
|
||||
print '<td>'.$obj->town.'</td>';
|
||||
print '<td>'.$obj->code_client.'</td>';
|
||||
print '<td>'.$obj->code_compta.'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
||||
|
||||
@ -51,8 +51,8 @@ if (! $sortfield) $sortfield="email";
|
||||
$id=GETPOST('id','int');
|
||||
$rowid=GETPOST('rowid','int');
|
||||
$action=GETPOST("action");
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_prenom=GETPOST("search_prenom");
|
||||
$search_lastname=GETPOST("search_lastname");
|
||||
$search_firstname=GETPOST("search_firstname");
|
||||
$search_email=GETPOST("search_email");
|
||||
|
||||
// Search modules dirs
|
||||
@ -154,8 +154,8 @@ if ($action == 'delete')
|
||||
|
||||
if ($_POST["button_removefilter"])
|
||||
{
|
||||
$search_nom='';
|
||||
$search_prenom='';
|
||||
$search_lastname='';
|
||||
$search_firstname='';
|
||||
$search_email='';
|
||||
}
|
||||
|
||||
@ -369,11 +369,11 @@ if ($object->fetch($id) >= 0)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type";
|
||||
$sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.fk_mailing=".$object->id;
|
||||
if ($search_nom) $sql.= " AND mc.nom LIKE '%".$db->escape($search_nom)."%'";
|
||||
if ($search_prenom) $sql.= " AND mc.prenom LIKE '%".$db->escape($search_prenom)."%'";
|
||||
if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'";
|
||||
if ($search_firstname) $sql.= " AND mc.firstname LIKE '%".$db->escape($search_firstname)."%'";
|
||||
if ($search_email) $sql.= " AND mc.email LIKE '%".$db->escape($search_email)."%'";
|
||||
$sql .= $db->order($sortfield,$sortorder);
|
||||
$sql .= $db->plimit($conf->liste_limit+1, $offset);
|
||||
@ -384,8 +384,8 @@ if ($object->fetch($id) >= 0)
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$parm = "&id=".$object->id;
|
||||
if ($search_nom) $parm.= "&search_nom=".urlencode($search_nom);
|
||||
if ($search_prenom) $parm.= "&search_prenom=".urlencode($search_prenom);
|
||||
if ($search_lastname) $parm.= "&search_lastname=".urlencode($search_lastname);
|
||||
if ($search_firstname) $parm.= "&search_firstname=".urlencode($search_firstname);
|
||||
if ($search_email) $parm.= "&search_email=".urlencode($search_email);
|
||||
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$parm,$sortfield,$sortorder,"",$num,$object->nbemail,'');
|
||||
@ -394,8 +394,8 @@ if ($object->fetch($id) >= 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$parm,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.nom",$parm,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.prenom",$parm,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.lastname",$parm,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$parm,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$parm,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$parm,"",'align="center"',$sortfield,$sortorder);
|
||||
|
||||
@ -422,11 +422,11 @@ if ($object->fetch($id) >= 0)
|
||||
print '</td>';
|
||||
// Name
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_nom" size="12" value="'.$search_nom.'">';
|
||||
print '<input class="flat" type="text" name="search_lastname" size="12" value="'.$search_lastname.'">';
|
||||
print '</td>';
|
||||
// Firstname
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_prenom" size="10" value="'.$search_prenom.'">';
|
||||
print '<input class="flat" type="text" name="search_firstname" size="10" value="'.$search_firstname.'">';
|
||||
print '</td>';
|
||||
// Other
|
||||
print '<td class="liste_titre">';
|
||||
@ -452,8 +452,8 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->nom.'</td>';
|
||||
print '<td>'.$obj->prenom.'</td>';
|
||||
print '<td>'.$obj->lastname.'</td>';
|
||||
print '<td>'.$obj->firstname.'</td>';
|
||||
print '<td>'.$obj->other.'</td>';
|
||||
print '<td align="center">';
|
||||
if (empty($obj->source_id) || empty($obj->source_type))
|
||||
|
||||
@ -174,7 +174,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
|
||||
|
||||
// On choisit les mails non deja envoyes pour ce mailing (statut=0)
|
||||
// ou envoyes en erreur (statut=-1)
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
|
||||
$sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
|
||||
|
||||
@ -209,7 +209,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
// sendto en RFC2822
|
||||
$sendto = str_replace(',',' ',$obj->prenom." ".$obj->nom)." <".$obj->email.">";
|
||||
$sendto = str_replace(',',' ',$obj->firstname." ".$obj->lastname)." <".$obj->email.">";
|
||||
|
||||
// Make substitutions on topic and body. From (AA=YY;BB=CC;...) we keep YY, CC, ...
|
||||
$other=explode(';',$obj->other);
|
||||
@ -224,8 +224,8 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
|
||||
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
|
||||
'__LASTNAME__' => $obj->nom,
|
||||
'__FIRSTNAME__' => $obj->prenom,
|
||||
'__LASTNAME__' => $obj->lastname,
|
||||
'__FIRSTNAME__' => $obj->firstname,
|
||||
'__OTHER1__' => $other1,
|
||||
'__OTHER2__' => $other2,
|
||||
'__OTHER3__' => $other3,
|
||||
|
||||
@ -1049,7 +1049,6 @@ class Propal extends CommonObject
|
||||
$this->demand_reason_id = $obj->fk_input_reason;
|
||||
$this->demand_reason_code = $obj->demand_reason_code;
|
||||
$this->demand_reason = $obj->demand_reason;
|
||||
//$this->fk_delivery_address = $obj->fk_adresse_livraison; // TODO obsolete
|
||||
$this->fk_address = $obj->fk_delivery_address;
|
||||
|
||||
$this->mode_reglement_id = $obj->fk_mode_reglement;
|
||||
|
||||
@ -41,7 +41,7 @@ $socname = GETPOST("socname",'alpha');
|
||||
$stcomm = GETPOST("stcomm",'int');
|
||||
$search_nom = GETPOST("search_nom");
|
||||
$search_zipcode = GETPOST("search_zipcode");
|
||||
$search_ville = GETPOST("search_ville");
|
||||
$search_town = GETPOST("search_town");
|
||||
$search_departement = GETPOST("search_departement");
|
||||
$search_datec = GETPOST("search_datec");
|
||||
$search_categ = GETPOST("search_categ",'int');
|
||||
@ -172,7 +172,7 @@ if ($action == 'cstc')
|
||||
|
||||
$formother=new FormOther($db);
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom, s.cp as zip, s.ville, s.datec, s.datea, s.status as status,";
|
||||
$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status,";
|
||||
$sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
|
||||
$sql.= " d.nom as departement";
|
||||
// Updated by Matelli
|
||||
@ -193,8 +193,8 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'";
|
||||
if ($search_zipcode) $sql .= " AND s.cp LIKE '".$db->escape(strtolower($search_zipcode))."%'";
|
||||
if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'";
|
||||
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'";
|
||||
if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape(strtolower($search_town))."%'";
|
||||
if ($search_departement) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_departement))."%'";
|
||||
if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'";
|
||||
// Insert levels filters
|
||||
@ -242,7 +242,7 @@ if ($resql)
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
}
|
||||
|
||||
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_code).'&search_ville='.urlencode($search_ville);
|
||||
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_code).'&search_town='.urlencode($search_town);
|
||||
// Added by Matelli
|
||||
// Store the status filter in the URL
|
||||
if (isSet($search_cstc))
|
||||
@ -293,8 +293,8 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.cp","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.zip","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("State"),$_SERVER["PHP_SELF"],"s.fk_departement","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ProspectLevelShort"),$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder);
|
||||
@ -315,7 +315,7 @@ if ($resql)
|
||||
print '<input type="text" class="flat" name="search_zipcode" size="10" value="'.$search_zipcode.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_ville" size="10" value="'.$search_ville.'">';
|
||||
print '<input type="text" class="flat" name="search_town" size="10" value="'.$search_town.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<input type="text" class="flat" name="search_departement" size="10" value="'.$search_departement.'">';
|
||||
@ -393,7 +393,7 @@ if ($resql)
|
||||
print $prospectstatic->getNomUrl(1,'prospect');
|
||||
print '</td>';
|
||||
print "<td>".$obj->zip." </td>";
|
||||
print "<td>".$obj->ville." </td>";
|
||||
print "<td>".$obj->town." </td>";
|
||||
print '<td align="center">'.$obj->departement.'</td>';
|
||||
// Creation date
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datec)).'</td>';
|
||||
|
||||
@ -67,7 +67,7 @@ $thirdpartystatic=new Societe($db);
|
||||
* Mode List
|
||||
*/
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom, s.client, s.ville, s.datec, s.datea";
|
||||
$sql = "SELECT s.rowid, s.nom, s.client, s.town, s.datec, s.datea";
|
||||
$sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
|
||||
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."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c";
|
||||
@ -119,7 +119,7 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder);
|
||||
@ -167,7 +167,7 @@ if ($resql)
|
||||
|
||||
print $result;
|
||||
print '</td>';
|
||||
print '<td>'.$obj->ville.' </td>';
|
||||
print '<td>'.$obj->town.' </td>';
|
||||
print '<td align="left">'.$obj->code_client.' </td>';
|
||||
print '<td align="left">'.$obj->code_compta.' </td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec)).'</td>';
|
||||
|
||||
@ -64,7 +64,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$account->iban_prefix = trim($_POST["iban_prefix"]); // deprecated
|
||||
$account->domiciliation = trim($_POST["domiciliation"]);
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
$account->adresse_proprio = trim($_POST["adresse_proprio"]);
|
||||
$account->owner_address = trim($_POST["owner_address"]);
|
||||
$account->fk_departement = trim($_POST["fk_departement"]);
|
||||
//$account->fk_pays = trim($_POST["fk_pays"]); // We do not change this.
|
||||
|
||||
@ -223,7 +223,7 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||
print nl2br($account->adresse_proprio);
|
||||
print nl2br($account->owner_address);
|
||||
print "</td></tr>\n";
|
||||
|
||||
}
|
||||
@ -368,8 +368,8 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||
print "<textarea class=\"flat\" name=\"adresse_proprio\" rows=\"2\" cols=\"40\">";
|
||||
print $account->adresse_proprio;
|
||||
print "<textarea class=\"flat\" name=\"owner_address\" rows=\"2\" cols=\"40\">";
|
||||
print $account->owner_address;
|
||||
print "</textarea></td></tr>";
|
||||
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ class Account extends CommonObject
|
||||
//! IBAN number (International Bank Account Number)
|
||||
var $iban_prefix;
|
||||
var $proprio;
|
||||
var $adresse_proprio;
|
||||
var $owner_address;
|
||||
|
||||
|
||||
var $fk_departement; // deprecated
|
||||
@ -71,7 +71,6 @@ class Account extends CommonObject
|
||||
var $state;
|
||||
|
||||
var $fk_pays; // deprecated
|
||||
var $pays_code; // deprecated
|
||||
var $pays; // deprecated
|
||||
var $country_id;
|
||||
var $country_code;
|
||||
@ -570,7 +569,7 @@ class Account extends CommonObject
|
||||
$sql.= ",iban_prefix = '".$this->iban."'";
|
||||
$sql.= ",domiciliation='".$this->db->escape($this->domiciliation)."'";
|
||||
$sql.= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql.= ",adresse_proprio = '".$this->db->escape($this->adresse_proprio)."'";
|
||||
$sql.= ",owner_address = '".$this->db->escape($this->owner_address)."'";
|
||||
$sql.= ",fk_departement = ".($this->state_id>0?"'".$this->state_id."'":"null");
|
||||
$sql.= ",fk_pays = ".$this->country_id;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
@ -611,7 +610,7 @@ class Account extends CommonObject
|
||||
|
||||
$sql = "SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url,";
|
||||
$sql.= " ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban,";
|
||||
$sql.= " ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays as country_id,";
|
||||
$sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.fk_departement, ba.fk_pays as country_id,";
|
||||
$sql.= " ba.account_number, ba.currency_code,";
|
||||
$sql.= " ba.min_allowed, ba.min_desired, ba.comment,";
|
||||
$sql.= ' p.code as country_code, p.libelle as country,';
|
||||
@ -651,7 +650,7 @@ class Account extends CommonObject
|
||||
$this->iban_prefix = $obj->iban; // deprecated
|
||||
$this->domiciliation = $obj->domiciliation;
|
||||
$this->proprio = $obj->proprio;
|
||||
$this->adresse_proprio = $obj->adresse_proprio;
|
||||
$this->owner_address = $obj->owner_address;
|
||||
|
||||
$this->fk_departement = $obj->fk_departement; // deprecated
|
||||
$this->departement_code= $obj->state_code; // deprecated
|
||||
@ -661,7 +660,6 @@ class Account extends CommonObject
|
||||
$this->state = $obj->state;
|
||||
|
||||
$this->fk_pays = $obj->country_id; // deprecated
|
||||
$this->pays_code = $obj->country_code; // deprecated
|
||||
$this->pays = $obj->country; // deprecated
|
||||
$this->country_id = $obj->country_id;
|
||||
$this->country_code = $obj->country_code;
|
||||
@ -1026,7 +1024,7 @@ class Account extends CommonObject
|
||||
$this->iban_prefix = 'FR'; // deprecated
|
||||
$this->domiciliation = 'The bank addresse';
|
||||
$this->proprio = 'Owner';
|
||||
$this->adresse_proprio = 'Owner address';
|
||||
$this->owner_address = 'Owner address';
|
||||
$this->country_id = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
$account->domiciliation = trim($_POST["domiciliation"]);
|
||||
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
$account->adresse_proprio = trim($_POST["adresse_proprio"]);
|
||||
$account->owner_address = trim($_POST["owner_address"]);
|
||||
|
||||
$account->account_number = trim($_POST["account_number"]);
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ if ($mode == 'search') {
|
||||
* Mode List
|
||||
*/
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom, s.client, s.ville, s.datec, s.datea";
|
||||
$sql = "SELECT s.rowid, s.nom, s.client, s.town, s.datec, s.datea";
|
||||
$sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
|
||||
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."c_stcomm as st";
|
||||
@ -148,7 +148,7 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder);
|
||||
@ -190,7 +190,7 @@ if ($resql)
|
||||
$thirdpartystatic->client=$obj->client;
|
||||
print $thirdpartystatic->getNomUrl(1,'compta');
|
||||
print '</td>';
|
||||
print '<td>'.$obj->ville.' </td>';
|
||||
print '<td>'.$obj->town.' </td>';
|
||||
print '<td align="left">'.$obj->code_client.' </td>';
|
||||
print '<td align="left">'.$obj->code_compta.' </td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec)).'</td>';
|
||||
|
||||
@ -131,7 +131,7 @@ $max=10;
|
||||
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT u.rowid as uid, u.name, u.firstname, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut";
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE u.rowid = d.fk_user";
|
||||
|
||||
@ -62,7 +62,7 @@ llxHeader();
|
||||
$sql = "SELECT s.nom, s.rowid as socid,"; // Ou
|
||||
$sql.= " d.rowid, d.type, d.dated as dd, d.km,"; // Comment
|
||||
$sql.= " d.fk_statut,";
|
||||
$sql.= " u.name, u.firstname"; // Qui
|
||||
$sql.= " u.lastname, u.firstname"; // Qui
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."deplacement as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON d.fk_soc = s.rowid";
|
||||
@ -93,7 +93,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"d.type","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.name","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"], '');
|
||||
|
||||
@ -39,12 +39,12 @@ class Don extends CommonObject
|
||||
var $ref;
|
||||
var $date;
|
||||
var $amount;
|
||||
var $prenom;
|
||||
var $nom;
|
||||
var $firstname;
|
||||
var $lastname;
|
||||
var $societe;
|
||||
var $address;
|
||||
var $cp;
|
||||
var $ville;
|
||||
var $zip;
|
||||
var $town;
|
||||
var $pays;
|
||||
var $email;
|
||||
var $public;
|
||||
@ -181,16 +181,16 @@ class Don extends CommonObject
|
||||
$this->id=0;
|
||||
$this->ref = 'SPECIMEN';
|
||||
$this->specimen=1;
|
||||
$this->nom = 'Doe';
|
||||
$this->prenom = 'John';
|
||||
$this->lastname = 'Doe';
|
||||
$this->firstname = 'John';
|
||||
$this->socid = 1;
|
||||
$this->date = dol_now();
|
||||
$this->amount = 100;
|
||||
$this->public = 1;
|
||||
$this->societe = 'The Company';
|
||||
$this->address = 'Twist road';
|
||||
$this->cp = '99999';
|
||||
$this->ville = 'Town';
|
||||
$this->zip = '99999';
|
||||
$this->town = 'Town';
|
||||
$this->note_public='SPECIMEN';
|
||||
$this->email='email@email.com';
|
||||
$this->note='';
|
||||
@ -210,7 +210,7 @@ class Don extends CommonObject
|
||||
|
||||
if (dol_strlen(trim($this->societe)) == 0)
|
||||
{
|
||||
if ((dol_strlen(trim($this->nom)) + dol_strlen(trim($this->prenom))) == 0)
|
||||
if ((dol_strlen(trim($this->lastname)) + dol_strlen(trim($this->firstname))) == 0)
|
||||
{
|
||||
$error_string[$err] = "Vous devez saisir vos nom et prenom ou le nom de votre societe.";
|
||||
$err++;
|
||||
@ -223,13 +223,13 @@ class Don extends CommonObject
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (dol_strlen(trim($this->cp)) == 0)
|
||||
if (dol_strlen(trim($this->zip)) == 0)
|
||||
{
|
||||
$error_string[$err] = "Le code postal saisi est invalide";
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (dol_strlen(trim($this->ville)) == 0)
|
||||
if (dol_strlen(trim($this->town)) == 0)
|
||||
{
|
||||
$error_string[$err] = "La ville saisie est invalide";
|
||||
$err++;
|
||||
@ -298,8 +298,8 @@ class Don extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
$this->address=($this->address>0?$this->address:$this->address);
|
||||
$this->zip=($this->zip>0?$this->zip:$this->cp);
|
||||
$this->town=($this->town>0?$this->town:$this->ville);
|
||||
$this->zip=($this->zip>0?$this->zip:$this->zip);
|
||||
$this->town=($this->town>0?$this->town:$this->town);
|
||||
$this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays);
|
||||
$this->country=($this->country?$this->country:$this->pays);
|
||||
|
||||
@ -310,12 +310,12 @@ class Don extends CommonObject
|
||||
$sql.= ", entity";
|
||||
$sql.= ", amount";
|
||||
$sql.= ", fk_paiement";
|
||||
$sql.= ", prenom";
|
||||
$sql.= ", nom";
|
||||
$sql.= ", firstname";
|
||||
$sql.= ", lastname";
|
||||
$sql.= ", societe";
|
||||
$sql.= ", address";
|
||||
$sql.= ", cp";
|
||||
$sql.= ", ville";
|
||||
$sql.= ", zip";
|
||||
$sql.= ", town";
|
||||
$sql.= ", pays";
|
||||
$sql.= ", public";
|
||||
$sql.= ", fk_don_projet";
|
||||
@ -331,8 +331,8 @@ class Don extends CommonObject
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".price2num($this->amount);
|
||||
$sql.= ", ".($this->modepaiementid?$this->modepaiementid:"null");
|
||||
$sql.= ", '".$this->db->escape($this->prenom)."'";
|
||||
$sql.= ", '".$this->db->escape($this->nom)."'";
|
||||
$sql.= ", '".$this->db->escape($this->firstname)."'";
|
||||
$sql.= ", '".$this->db->escape($this->lastname)."'";
|
||||
$sql.= ", '".$this->db->escape($this->societe)."'";
|
||||
$sql.= ", '".$this->db->escape($this->address)."'";
|
||||
$sql.= ", '".$this->db->escape($this->zip)."'";
|
||||
@ -383,20 +383,20 @@ class Don extends CommonObject
|
||||
{
|
||||
// Clean parameters
|
||||
$this->address=($this->address>0?$this->address:$this->address);
|
||||
$this->zip=($this->zip>0?$this->zip:$this->cp);
|
||||
$this->town=($this->town>0?$this->town:$this->ville);
|
||||
$this->zip=($this->zip>0?$this->zip:$this->zip);
|
||||
$this->town=($this->town>0?$this->town:$this->town);
|
||||
$this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays);
|
||||
$this->country=($this->country?$this->country:$this->pays);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET ";
|
||||
$sql .= "amount = " . price2num($this->amount);
|
||||
$sql .= ",fk_paiement = ".($this->modepaiementid?$this->modepaiementid:"null");
|
||||
$sql .= ",prenom = '".$this->db->escape($this->prenom)."'";
|
||||
$sql .= ",nom='".$this->db->escape($this->nom)."'";
|
||||
$sql .= ",firstname = '".$this->db->escape($this->firstname)."'";
|
||||
$sql .= ",lastname='".$this->db->escape($this->lastname)."'";
|
||||
$sql .= ",societe='".$this->db->escape($this->societe)."'";
|
||||
$sql .= ",address='".$this->db->escape($this->address)."'";
|
||||
$sql .= ",cp='".$this->db->escape($this->zip)."'";
|
||||
$sql .= ",ville='".$this->db->escape($this->town)."'";
|
||||
$sql .= ",zip='".$this->db->escape($this->zip)."'";
|
||||
$sql .= ",town='".$this->db->escape($this->town)."'";
|
||||
$sql .= ",pays='".$this->db->escape($this->country)."'"; // TODO use country_id
|
||||
$sql .= ",public=".$this->public;
|
||||
$sql .= ",fk_don_projet=".($this->fk_project>0?$this->fk_project:'null');
|
||||
@ -463,7 +463,7 @@ class Don extends CommonObject
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT d.rowid, d.datec, d.tms as datem, d.datedon,";
|
||||
$sql.= " d.prenom, d.nom, d.societe, d.amount, d.fk_statut, d.address, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.phone, d.phone_mobile, d.fk_don_projet,";
|
||||
$sql.= " d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.phone, d.phone_mobile, d.fk_don_projet,";
|
||||
$sql.= " p.title as project_label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_don_projet";
|
||||
@ -483,15 +483,14 @@ class Don extends CommonObject
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
$this->date = $this->db->jdate($obj->datedon);
|
||||
$this->prenom = $obj->prenom;
|
||||
$this->nom = $obj->nom;
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->lastname = $obj->lastname;
|
||||
$this->societe = $obj->societe;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->address = $obj->address;
|
||||
$this->cp = $obj->cp;
|
||||
$this->ville = $obj->ville;
|
||||
$this->zip = $obj->cp;
|
||||
$this->town = $obj->ville;
|
||||
$this->town = $obj->town;
|
||||
$this->zip = $obj->zip;
|
||||
$this->town = $obj->town;
|
||||
$this->email = $obj->email;
|
||||
$this->phone = $obj->phone;
|
||||
$this->phone_mobile = $obj->phone_mobile;
|
||||
|
||||
@ -85,13 +85,12 @@ if ($action == 'update')
|
||||
{
|
||||
$don->fetch($id);
|
||||
|
||||
$don->prenom = $_POST["prenom"];
|
||||
$don->nom = $_POST["nom"];
|
||||
$don->firstname = $_POST["firstname"];
|
||||
$don->lastname = $_POST["lastname"];
|
||||
$don->societe = $_POST["societe"];
|
||||
$don->address = $_POST["address"];
|
||||
$don->amount = price2num($_POST["amount"]);
|
||||
$don->cp = $_POST["zipcode"];
|
||||
$don->ville = $_POST["town"];
|
||||
$don->town = $_POST["town"];
|
||||
$don->zip = $_POST["zipcode"];
|
||||
$don->town = $_POST["town"];
|
||||
$don->email = $_POST["email"];
|
||||
@ -137,13 +136,12 @@ if ($action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$don->prenom = $_POST["prenom"];
|
||||
$don->nom = $_POST["nom"];
|
||||
$don->firstname = $_POST["firstname"];
|
||||
$don->lastname = $_POST["lastname"];
|
||||
$don->societe = $_POST["societe"];
|
||||
$don->address = $_POST["address"];
|
||||
$don->amount = price2num($_POST["amount"]);
|
||||
$don->cp = $_POST["zipcode"];
|
||||
$don->ville = $_POST["town"];
|
||||
$don->town = $_POST["town"];
|
||||
$don->zip = $_POST["zipcode"];
|
||||
$don->town = $_POST["town"];
|
||||
$don->email = $_POST["email"];
|
||||
@ -297,8 +295,8 @@ if ($action == 'create')
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.$_POST["societe"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" value="'.$_POST["prenom"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" value="'.$_POST["nom"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.$_POST["firstname"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.$_POST["lastname"].'" size="40"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" cols="40" rows="3">'.$_POST["address"].'</textarea></td></tr>';
|
||||
|
||||
@ -387,8 +385,8 @@ if (! empty($id) && $action == 'edit')
|
||||
|
||||
$langs->load("companies");
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$don->societe.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.$don->prenom.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$don->nom.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.$don->firstname.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.$don->lastname.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->address.'</textarea></td></tr>';
|
||||
|
||||
@ -483,12 +481,12 @@ if (! empty($id) && $action != 'edit')
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->prenom.'</td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->nom.'</td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->firstname.'</td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->lastname.'</td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->address).'</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->cp.($don->cp && $don->ville?' / ':'').$don->ville.'</td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->zip.($don->zip && $don->town?' / ':'').$don->town.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print "<tr>".'<td>'.$langs->trans("Country").'</td><td>'.$don->pays.'</td></tr>';
|
||||
|
||||
@ -60,7 +60,7 @@ llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M
|
||||
$donationstatic=new Don($db);
|
||||
|
||||
// Genere requete de liste des dons
|
||||
$sql = "SELECT d.rowid, d.datedon, d.prenom, d.nom, d.societe,";
|
||||
$sql = "SELECT d.rowid, d.datedon, d.firstname, d.lastname, d.societe,";
|
||||
$sql.= " d.amount, d.fk_statut as statut, ";
|
||||
$sql.= " p.rowid as pid, p.ref, p.title, p.public";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
|
||||
@ -79,7 +79,7 @@ if (trim($search_company) != '')
|
||||
}
|
||||
if (trim($search_name) != '')
|
||||
{
|
||||
$sql.= ' AND d.nom LIKE \'%'.$db->escape(trim($search_name)) . '%\' OR d.prenom LIKE \'%'.$db->escape(trim($search_name)) . '%\'';
|
||||
$sql.= ' AND d.lastname LIKE \'%'.$db->escape(trim($search_name)) . '%\' OR d.firstname LIKE \'%'.$db->escape(trim($search_name)) . '%\'';
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
@ -109,7 +109,7 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"d.societe","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.nom","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname","&page=$page&statut=$statut","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.datedon","&page=$page&statut=$statut","",'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
@ -154,8 +154,8 @@ if ($resql)
|
||||
print "<tr ".$bc[$var].">";
|
||||
$donationstatic->id=$objp->rowid;
|
||||
$donationstatic->ref=$objp->rowid;
|
||||
$donationstatic->nom=$objp->nom;
|
||||
$donationstatic->prenom=$objp->prenom;
|
||||
$donationstatic->lastname=$objp->lastname;
|
||||
$donationstatic->firstname=$objp->firstname;
|
||||
print "<td>".$donationstatic->getNomUrl(1)."</td>\n";
|
||||
print "<td>".$objp->societe."</td>\n";
|
||||
print "<td>".$donationstatic->getFullName($langs)."</td>\n";
|
||||
|
||||
@ -2124,12 +2124,12 @@ if ($action == 'create')
|
||||
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
|
||||
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
|
||||
}
|
||||
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
|
||||
}
|
||||
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
|
||||
}
|
||||
@ -2980,13 +2980,13 @@ else if ($id > 0 || ! empty($ref))
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ if ($object->id > 0)
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
|
||||
$sql .= " , pfd.date_traite as date_traite";
|
||||
$sql .= " , pfd.amount";
|
||||
$sql .= " , u.rowid as user_id, u.name, u.firstname, u.login";
|
||||
$sql .= " , u.rowid as user_id, u.lastname, u.firstname, u.login";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE fk_facture = ".$object->id;
|
||||
@ -516,7 +516,7 @@ if ($object->id > 0)
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande,";
|
||||
$sql.= " pfd.date_traite, pfd.fk_prelevement_bons, pfd.amount,";
|
||||
$sql.= " pb.ref,";
|
||||
$sql.= " u.rowid as user_id, u.name, u.firstname, u.login";
|
||||
$sql.= " u.rowid as user_id, u.lastname, u.firstname, u.login";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_bons as pb,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
@ -512,7 +512,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
|
||||
$langs->load("boxes");
|
||||
$donationstatic=new Don($db);
|
||||
|
||||
$sql = "SELECT d.rowid, d.nom, d.prenom, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
|
||||
$sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql.= " WHERE d.entity = ".$conf->entity;
|
||||
$sql.= $db->order("d.tms","DESC");
|
||||
@ -544,8 +544,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
$donationstatic->id=$objp->rowid;
|
||||
$donationstatic->nom=$objp->nom;
|
||||
$donationstatic->prenom=$objp->prenom;
|
||||
$donationstatic->lastname=$objp->lastname;
|
||||
$donationstatic->firstname=$objp->firstname;
|
||||
$label=$donationstatic->getFullName($langs);
|
||||
if ($objp->societe) $label.=($label?' - ':'').$objp->societe;
|
||||
$donationstatic->ref=$label;
|
||||
@ -576,7 +576,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
||||
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT u.rowid as uid, u.name, u.firstname, d.fk_statut, d.rowid, d.dated as date, d.tms as dm, d.km";
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.fk_statut, d.rowid, d.dated as date, d.tms as dm, d.km";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE u.rowid = d.fk_user";
|
||||
|
||||
@ -100,7 +100,7 @@ $tva = new Tva($db);
|
||||
$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous()."</a>";
|
||||
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next()."</a>";
|
||||
|
||||
print_fiche_titre($langs->transcountry("LT2",$mysoc->pays_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear");
|
||||
print_fiche_titre($langs->transcountry("LT2",$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear");
|
||||
|
||||
print $langs->trans("VATReportBuildWithOptionDefinedInModule").'<br>';
|
||||
print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')<br>';
|
||||
@ -108,10 +108,10 @@ print '<br>';
|
||||
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr><td>';
|
||||
print_titre($langs->transcountry("LT2Summary",$mysoc->pays_code));
|
||||
print_titre($langs->transcountry("LT2Summary",$mysoc->country_code));
|
||||
|
||||
print '</td><td width="5"> </td><td>';
|
||||
print_titre($langs->transcountry("LT2Paid",$mysoc->pays_code));
|
||||
print_titre($langs->transcountry("LT2Paid",$mysoc->country_code));
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="50%" valign="top">';
|
||||
|
||||
@ -540,7 +540,7 @@ class BonPrelevement extends CommonObject
|
||||
$this->method_trans = $method;
|
||||
$langs->load('withdrawals');
|
||||
$subject = $langs->trans("InfoTransSubject", $this->ref);
|
||||
$message = $langs->trans("InfoTransMessage", $this->ref, $user->prenom, $user->nom);
|
||||
$message = $langs->trans("InfoTransMessage", $this->ref, $user->firstname, $user->lastname);
|
||||
$message .=$langs->trans("InfoTransData", price($this->amount), $this->methodes_trans[$this->method_trans], dol_print_date($date,'day'));
|
||||
|
||||
// TODO Call trigger to create a notification using notification module
|
||||
|
||||
@ -135,7 +135,7 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
|
||||
$catotal=0;
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT u.rowid as rowid, u.name as name, u.firstname as firstname, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc";
|
||||
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid";
|
||||
$sql.= " WHERE f.fk_statut in (1,2)";
|
||||
@ -149,7 +149,7 @@ else
|
||||
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
|
||||
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
|
||||
*/
|
||||
$sql = "SELECT u.rowid as rowid, u.name as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
|
||||
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u" ;
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid ";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid";
|
||||
@ -159,7 +159,7 @@ else
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql .= " GROUP BY u.rowid, u.name, u.firstname";
|
||||
$sql .= " GROUP BY u.rowid, u.lastname, u.firstname";
|
||||
$sql .= " ORDER BY u.rowid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -395,10 +395,10 @@ abstract class ActionsContactCardCommon
|
||||
|
||||
if ($action == 'create_user')
|
||||
{
|
||||
// Full firstname and name separated with a dot : firstname.name
|
||||
// Full firstname and lastname separated with a dot : firstname.lastname
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$login=dol_buildlogin($this->object->nom, $this->object->prenom);
|
||||
$login=dol_buildlogin($this->object->lastname, $this->object->firstname);
|
||||
|
||||
$generated_password=getRandomPassword('');
|
||||
$password=$generated_password;
|
||||
@ -459,7 +459,6 @@ abstract class ActionsContactCardCommon
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
$this->object->pays_code = $obj->code;
|
||||
$this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
$this->object->country_code = $obj->code;
|
||||
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
|
||||
@ -65,7 +65,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['ville']; ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['town']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -42,11 +42,8 @@ class Contact extends CommonObject
|
||||
var $name; // TODO deprecated
|
||||
var $nom; // TODO deprecated
|
||||
var $firstname;
|
||||
var $prenom; // TODO deprecated
|
||||
var $address;
|
||||
var $cp; // TODO deprecated
|
||||
var $zip;
|
||||
var $ville; // TODO deprecated
|
||||
var $town;
|
||||
|
||||
var $fk_departement; // deprecated
|
||||
@ -57,7 +54,6 @@ class Contact extends CommonObject
|
||||
var $state; // Label of department
|
||||
|
||||
var $fk_pays; // deprecated
|
||||
var $pays_code; // deprecated
|
||||
var $pays; // deprecated
|
||||
var $country_id; // Id of country
|
||||
var $country_code; // Code of country
|
||||
@ -111,7 +107,7 @@ class Contact extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
// Clean parameters
|
||||
$this->lastname=$this->lastname?trim($this->lastname):$this->name;
|
||||
$this->lastname=$this->lastname?trim($this->lastname):$this->lastname;
|
||||
$this->firstname=trim($this->firstname);
|
||||
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname);
|
||||
if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname);
|
||||
@ -121,7 +117,7 @@ class Contact extends CommonObject
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
|
||||
$sql.= " datec";
|
||||
$sql.= ", fk_soc";
|
||||
$sql.= ", name";
|
||||
$sql.= ", lastname";
|
||||
$sql.= ", firstname";
|
||||
$sql.= ", fk_user_creat";
|
||||
$sql.= ", priv";
|
||||
@ -217,15 +213,15 @@ class Contact extends CommonObject
|
||||
$this->id = $id;
|
||||
|
||||
// Clean parameters
|
||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->name);
|
||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname);
|
||||
$this->firstname=trim($this->firstname);
|
||||
$this->email=trim($this->email);
|
||||
$this->phone_pro=trim($this->phone_pro);
|
||||
$this->phone_perso=trim($this->phone_perso);
|
||||
$this->phone_mobile=trim($this->phone_mobile);
|
||||
$this->fax=trim($this->fax);
|
||||
$this->zip=($this->zip?$this->zip:$this->cp);
|
||||
$this->town=($this->town?$this->town:$this->ville);
|
||||
$this->zip=($this->zip?$this->zip:$this->zip);
|
||||
$this->town=($this->town?$this->town:$this->town);
|
||||
$this->country_id=($this->country_id > 0?$this->country_id:$this->fk_pays);
|
||||
$this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement);
|
||||
|
||||
@ -235,11 +231,11 @@ class Contact extends CommonObject
|
||||
if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',";
|
||||
else if ($this->socid == -1) $sql .= " fk_soc=null,";
|
||||
$sql .= " civilite='".$this->db->escape($this->civilite_id)."'";
|
||||
$sql .= ", name='".$this->db->escape($this->lastname)."'";
|
||||
$sql .= ", lastname='".$this->db->escape($this->lastname)."'";
|
||||
$sql .= ", firstname='".$this->db->escape($this->firstname)."'";
|
||||
$sql .= ", address='".$this->db->escape($this->address)."'";
|
||||
$sql .= ", cp='".$this->db->escape($this->zip)."'";
|
||||
$sql .= ", ville='".$this->db->escape($this->town)."'";
|
||||
$sql .= ", zip='".$this->db->escape($this->zip)."'";
|
||||
$sql .= ", town='".$this->db->escape($this->town)."'";
|
||||
$sql .= ", fk_pays=".($this->country_id>0?$this->country_id:'NULL');
|
||||
$sql .= ", fk_departement=".($this->state_id>0?$this->state_id:'NULL');
|
||||
$sql .= ", poste='".$this->db->escape($this->poste)."'";
|
||||
@ -366,8 +362,8 @@ class Contact extends CommonObject
|
||||
if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers";
|
||||
}
|
||||
if ($this->address && ! empty($conf->global->LDAP_CONTACT_FIELD_ADDRESS)) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address;
|
||||
if ($this->cp && ! empty($conf->global->LDAP_CONTACT_FIELD_ZIP)) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp;
|
||||
if ($this->ville && ! empty($conf->global->LDAP_CONTACT_FIELD_TOWN)) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville;
|
||||
if ($this->zip && ! empty($conf->global->LDAP_CONTACT_FIELD_ZIP)) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->zip;
|
||||
if ($this->town && ! empty($conf->global->LDAP_CONTACT_FIELD_TOWN)) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->town;
|
||||
if ($this->country_code && ! empty($conf->global->LDAP_CONTACT_FIELD_COUNTRY)) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code;
|
||||
if ($this->phone_pro && ! empty($conf->global->LDAP_CONTACT_FIELD_PHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro;
|
||||
if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso;
|
||||
@ -483,8 +479,8 @@ class Contact extends CommonObject
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$sql = "SELECT c.rowid, c.fk_soc, c.civilite as civilite_id, c.name as lastname, c.firstname,";
|
||||
$sql.= " c.address, c.cp as zip, c.ville as town,";
|
||||
$sql = "SELECT c.rowid, c.fk_soc, c.civilite as civilite_id, c.lastname, c.firstname,";
|
||||
$sql.= " c.address, c.zip, c.town,";
|
||||
$sql.= " c.fk_pays as country_id,";
|
||||
$sql.= " c.fk_departement,";
|
||||
$sql.= " c.birthday,";
|
||||
@ -494,7 +490,7 @@ class Contact extends CommonObject
|
||||
$sql.= " p.libelle as country, p.code as country_code,";
|
||||
$sql.= " d.nom as state, d.code_departement as state_code,";
|
||||
$sql.= " u.rowid as user_id, u.login as user_login,";
|
||||
$sql.= " s.nom as socname, s.address as socaddress, s.cp as soccp, s.ville as soccity, s.default_lang as socdefault_lang";
|
||||
$sql.= " s.nom as socname, s.address as socaddress, s.cp as soccp, s.town as soccity, s.default_lang as socdefault_lang";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
|
||||
@ -514,16 +510,9 @@ class Contact extends CommonObject
|
||||
$this->ref = $obj->rowid;
|
||||
$this->civilite_id = $obj->civilite_id;
|
||||
$this->lastname = $obj->lastname;
|
||||
$this->name = $obj->lastname; // TODO deprecated
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->nom = $obj->lastname; // TODO deprecated
|
||||
$this->prenom = $obj->firstname; // TODO deprecated
|
||||
|
||||
$this->address = $obj->address;
|
||||
//$this->adresse = $obj->address; // TODO deprecated
|
||||
$this->cp = $obj->zip; // TODO deprecated
|
||||
$this->zip = $obj->zip;
|
||||
$this->ville = $obj->town; // TODO deprecated
|
||||
$this->town = $obj->town;
|
||||
|
||||
$this->fk_departement = $obj->fk_departement; // deprecated
|
||||
@ -535,7 +524,6 @@ class Contact extends CommonObject
|
||||
|
||||
$this->fk_pays = $obj->country_id;
|
||||
$this->country_id = $obj->country_id;
|
||||
$this->pays_code = $obj->country_id?$obj->country_code:'';
|
||||
$this->country_code = $obj->country_id?$obj->country_code:'';
|
||||
$this->pays = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):'';
|
||||
$this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):'';
|
||||
@ -686,7 +674,7 @@ class Contact extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->old_name = $obj->name;
|
||||
$this->old_lastname = $obj->lastname;
|
||||
$this->old_firstname = $obj->firstname;
|
||||
|
||||
$this->db->begin();
|
||||
@ -856,7 +844,7 @@ class Contact extends CommonObject
|
||||
|
||||
/**
|
||||
* Return name of contact with link (and eventually picto)
|
||||
* Use $this->id, $this->name, $this->firstname, this->civilite_id
|
||||
* Use $this->id, $this->lastname, $this->firstname, this->civilite_id
|
||||
*
|
||||
* @param int $withpicto Include picto with link
|
||||
* @param string $option Where the link point to
|
||||
|
||||
@ -585,7 +585,6 @@ else
|
||||
if (isset($_POST["country_id"]) || $object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
$object->pays_code = $tmparray['code'];
|
||||
$object->pays = $tmparray['label'];
|
||||
$object->country_code = $tmparray['code'];
|
||||
$object->country = $tmparray['label'];
|
||||
@ -633,7 +632,7 @@ else
|
||||
print $object->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Name
|
||||
// Lastname
|
||||
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%"><input name="lastname" type="text" size="20" maxlength="80" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'"></td>';
|
||||
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%"><input name="firstname" type="text" size="20" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
||||
|
||||
@ -811,9 +810,9 @@ else
|
||||
|
||||
if ($action == 'create_user')
|
||||
{
|
||||
// Full firstname and name separated with a dot : firstname.name
|
||||
// Full firstname and lastname separated with a dot : firstname.lastname
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$login=dol_buildlogin($object->nom,$object->prenom);
|
||||
$login=dol_buildlogin($object->lastname,$object->firstname);
|
||||
|
||||
$generated_password='';
|
||||
if (! $ldap_sid) // TODO ldap_sid ?
|
||||
@ -881,11 +880,11 @@ else
|
||||
dol_print_address($object->address,'gmap','contact',$object->id);
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip Town
|
||||
// Zip/Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
|
||||
print $object->cp;
|
||||
if ($object->cp) print ' ';
|
||||
print $object->ville.'</td></tr>';
|
||||
print $object->zip;
|
||||
if ($object->zip) print ' ';
|
||||
print $object->town.'</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||
|
||||
@ -35,8 +35,8 @@ $contactid = GETPOST('id','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contact', $contactid,'');
|
||||
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_prenom=GETPOST("search_prenom");
|
||||
$search_lastname=GETPOST("search_lastname");
|
||||
$search_firstname=GETPOST("search_firstname");
|
||||
$search_societe=GETPOST("search_societe");
|
||||
$search_poste=GETPOST("search_poste");
|
||||
$search_phone=GETPOST("search_phone");
|
||||
@ -87,8 +87,8 @@ if (! empty($text)) $titre.= " $text";
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
{
|
||||
$search_nom="";
|
||||
$search_prenom="";
|
||||
$search_lastname="";
|
||||
$search_firstname="";
|
||||
$search_societe="";
|
||||
$search_poste="";
|
||||
$search_phone="";
|
||||
@ -116,7 +116,7 @@ $form=new Form($db);
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
||||
$sql.= " p.rowid as cidp, p.name as lastname, p.firstname, p.poste, p.email,";
|
||||
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,";
|
||||
$sql.= " cp.code as pays_code";
|
||||
$sql.= " cp.code as country_code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
|
||||
@ -142,13 +142,13 @@ else
|
||||
if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")";
|
||||
}
|
||||
|
||||
if ($search_nom) // filtre sur le nom
|
||||
if ($search_lastname) // filtre sur le nom
|
||||
{
|
||||
$sql .= " AND p.name LIKE '%".$db->escape($search_nom)."%'";
|
||||
$sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'";
|
||||
}
|
||||
if ($search_prenom) // filtre sur le prenom
|
||||
if ($search_firstname) // filtre sur le prenom
|
||||
{
|
||||
$sql .= " AND p.firstname LIKE '%".$db->escape($search_prenom)."%'";
|
||||
$sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
|
||||
}
|
||||
if ($search_societe) // filtre sur la societe
|
||||
{
|
||||
@ -233,7 +233,7 @@ if ($result)
|
||||
$contactstatic=new Contact($db);
|
||||
|
||||
$param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
|
||||
$param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_nom='.urlencode($search_nom).'&search_prenom='.urlencode($search_prenom).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email);
|
||||
$param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email);
|
||||
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
@ -279,10 +279,10 @@ if ($result)
|
||||
// Ligne des champs de filtres
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_nom" size="9" value="'.$search_nom.'">';
|
||||
print '<input class="flat" type="text" name="search_lastname" size="9" value="'.$search_lastname.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_prenom" size="9" value="'.$search_prenom.'">';
|
||||
print '<input class="flat" type="text" name="search_firstname" size="9" value="'.$search_firstname.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_poste" size="9" value="'.$search_poste.'">';
|
||||
@ -368,16 +368,16 @@ if ($result)
|
||||
if ($view == 'phone')
|
||||
{
|
||||
// Phone
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
// Phone mobile
|
||||
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
// Fax
|
||||
print '<td>'.dol_print_phone($obj->fax,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Phone
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>';
|
||||
// EMail
|
||||
print '<td>'.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).'</td>';
|
||||
}
|
||||
|
||||
@ -54,8 +54,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
|
||||
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
|
||||
$v->setPhoneNumber($contact->fax, "WORK;FAX");
|
||||
|
||||
$v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, ($contact->pays_code?$contact->pays:''), "WORK;POSTAL");
|
||||
$v->setLabel("", "", $contact->address, $contact->ville, "", $contact->cp, ($contact->pays_code?$contact->pays:''), "WORK");
|
||||
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK;POSTAL");
|
||||
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK");
|
||||
$v->setEmail($contact->email,'internet,pref');
|
||||
$v->setNote($contact->note);
|
||||
|
||||
@ -67,7 +67,7 @@ if ($company->id)
|
||||
$v->setURL($company->url, "WORK");
|
||||
if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE");
|
||||
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
|
||||
if (! $contact->cp) $v->setAddress("", "", $company->address, $company->ville, "", $company->cp, $company->pays_code, "WORK;POSTAL");
|
||||
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
|
||||
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
|
||||
// Si contact lie a un tiers non de type "particulier"
|
||||
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom);
|
||||
|
||||
@ -77,16 +77,16 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
|
||||
}
|
||||
else // Use table of third parties
|
||||
{
|
||||
$sql = "SELECT DISTINCT s.cp as zip, s.ville as town, s.fk_departement as fk_county, s.fk_pays as fk_country";
|
||||
$sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
|
||||
$sql.= ", p.code as country_code, p.libelle as country";
|
||||
$sql.= ", d.code_departement as county_code , d.nom as county";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_pays as p ON fk_pays = p.rowid';
|
||||
$sql.= " WHERE";
|
||||
if ($zipcode) $sql.= " s.cp LIKE '".$db->escape($zipcode)."%'";
|
||||
if ($town) $sql.= " s.ville LIKE '%" . $db->escape($town) . "%'";
|
||||
$sql.= " ORDER BY s.fk_pays, s.cp, s.ville";
|
||||
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
|
||||
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
|
||||
$sql.= " ORDER BY s.fk_pays, s.zip, s.town";
|
||||
$sql.= $db->plimit(50); // Avoid pb with bad criteria
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ define('NOLOGIN',1);
|
||||
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER',1);
|
||||
if (! defined('NOREQUIREDB')) define('NOREQUIREDB',1);
|
||||
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN',1);
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC',1);
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ class box_comptes extends ModeleBoxes
|
||||
{
|
||||
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
|
||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix,";
|
||||
$sql.= " domiciliation, proprio, adresse_proprio,";
|
||||
$sql.= " domiciliation, proprio, owner_address,";
|
||||
$sql.= " account_number, currency_code,";
|
||||
$sql.= " min_allowed, min_desired, comment";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
|
||||
@ -61,7 +61,7 @@ class box_contacts extends ModeleBoxes
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT sp.rowid, sp.name, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,";
|
||||
$sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,";
|
||||
$sql.= " s.nom as socname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
|
||||
|
||||
@ -78,7 +78,7 @@ class box_members extends ModeleBoxes
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
|
||||
$sql = "SELECT a.rowid, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
|
||||
$sql.= " t.cotisation";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
|
||||
@ -85,8 +85,8 @@ class CMailFile
|
||||
* CMailFile
|
||||
*
|
||||
* @param string $subject Topic/Subject of mail
|
||||
* @param string $to Recipients emails (RFC 2822: "Nom prenom <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param string $from Sender email (RFC 2822: "Nom prenom <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param string $to Recipients emails (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param string $from Sender email (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param string $msg Message
|
||||
* @param array $filename_list List of files to attach (full path of filename on file system)
|
||||
* @param array $mimetype_list List of MIME type of attached files
|
||||
|
||||
@ -64,7 +64,7 @@ abstract class CommonObject
|
||||
$lastname=$this->lastname;
|
||||
$firstname=$this->firstname;
|
||||
if (empty($lastname)) $lastname=($this->name?$this->name:$this->nom);
|
||||
if (empty($firstname)) $firstname=$this->prenom;
|
||||
if (empty($firstname)) $firstname=$this->firstname;
|
||||
|
||||
$ret='';
|
||||
if ($option && $this->civilite_id)
|
||||
|
||||
@ -218,10 +218,10 @@ class Conf
|
||||
$this->bank->cheque = new stdClass();
|
||||
|
||||
// Clean some variables
|
||||
if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_backoffice.php";
|
||||
if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD="eldy_frontoffice.php";
|
||||
if (empty($this->global->MAIN_MENU_SMARTPHONE)) $this->global->MAIN_MENU_SMARTPHONE="eldy_backoffice.php"; // Use eldy by default because smartphone does not work on all phones
|
||||
if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE="eldy_frontoffice.php"; // Ue eldy by default because smartphone does not work on all phones
|
||||
if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_menu.php";
|
||||
if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD="eldy_menu.php";
|
||||
if (empty($this->global->MAIN_MENU_SMARTPHONE)) $this->global->MAIN_MENU_SMARTPHONE="eldy_menu.php"; // Use eldy by default because smartphone does not work on all phones
|
||||
if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE="eldy_menu.php"; // Use eldy by default because smartphone does not work on all phones
|
||||
|
||||
// Variable globales LDAP
|
||||
if (empty($this->global->LDAP_FIELD_FULLNAME)) $this->global->LDAP_FIELD_FULLNAME='';
|
||||
|
||||
@ -444,7 +444,7 @@ class Form
|
||||
* @param string $htmloption Options html on select object
|
||||
* @return void
|
||||
*/
|
||||
function select_pays($selected='',$htmlname='pays_id',$htmloption='')
|
||||
function select_pays($selected='',$htmlname='country_id',$htmloption='')
|
||||
{
|
||||
print $this->select_country($selected,$htmlname,$htmloption);
|
||||
}
|
||||
@ -458,7 +458,7 @@ class Form
|
||||
* @param string $maxlength Max length for labels (0=no limit)
|
||||
* @return string HTML string with select
|
||||
*/
|
||||
function select_country($selected='',$htmlname='pays_id',$htmloption='',$maxlength=0)
|
||||
function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -825,11 +825,12 @@ class Form
|
||||
* @param string $showsoc Add company into label
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param bool $options_only Return options only (for ajax treatment)
|
||||
* @return int <0 if KO, Nb of contact in list if OK
|
||||
*/
|
||||
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $event=array())
|
||||
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $event=array(), $options_only=false)
|
||||
{
|
||||
print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $showsoc, $forcecombo, $event);
|
||||
print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $event);
|
||||
return $this->num;
|
||||
}
|
||||
|
||||
@ -859,7 +860,7 @@ class Form
|
||||
$out='';
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT sp.rowid, sp.name as name, sp.firstname, sp.poste";
|
||||
$sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.poste";
|
||||
if ($showsoc > 0) {
|
||||
$sql.= " , s.nom as company";
|
||||
}
|
||||
@ -869,7 +870,7 @@ class Form
|
||||
}
|
||||
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
|
||||
if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid;
|
||||
$sql.= " ORDER BY sp.name ASC";
|
||||
$sql.= " ORDER BY sp.lastname ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::select_contacts sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -877,7 +878,7 @@ class Form
|
||||
{
|
||||
$num=$this->db->num_rows($resql);
|
||||
|
||||
if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo)
|
||||
if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo && ! $options_only)
|
||||
{
|
||||
$out.= ajax_combobox($htmlname, $event);
|
||||
}
|
||||
@ -1004,7 +1005,7 @@ class Form
|
||||
$out='';
|
||||
|
||||
// On recherche les utilisateurs
|
||||
$sql = "SELECT DISTINCT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
|
||||
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.login, u.admin, u.entity";
|
||||
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$sql.= ", e.label";
|
||||
@ -1032,7 +1033,7 @@ class Form
|
||||
if (! empty($user->societe_id)) $sql.= " AND u.fk_societe = ".$user->societe_id;
|
||||
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
|
||||
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
|
||||
$sql.= " ORDER BY u.name ASC";
|
||||
$sql.= " ORDER BY u.lastname ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::select_dolusers sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -299,7 +299,7 @@ class FormOther
|
||||
$moreforfilter.='<option value=""> </option>';
|
||||
|
||||
// Get list of users allowed to be viewed
|
||||
$sql_usr = "SELECT u.rowid, u.name as name, u.firstname, u.login";
|
||||
$sql_usr = "SELECT u.rowid, u.lastname as name, u.firstname, u.login";
|
||||
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.fk_societe = ".($user->societe_id?$user->societe_id:0);
|
||||
|
||||
@ -874,9 +874,10 @@ class Ldap
|
||||
* @param string $useridentifier Name of key field (Ex: uid)
|
||||
* @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword)
|
||||
* @param int $activefilter 1=use field this->filter as filter instead of parameter $search
|
||||
* @param array $attributeAsArray Array of fields wanted as an array not a string
|
||||
* @return array Array of [id_record][ldap_field]=value
|
||||
*/
|
||||
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0)
|
||||
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0, $attributeAsArray=array())
|
||||
{
|
||||
$fulllist=array();
|
||||
|
||||
@ -955,7 +956,15 @@ class Ldap
|
||||
}
|
||||
else
|
||||
{
|
||||
$fulllist[$recordid][$attributeArray[$j]] = $this->convToOutputCharset($info[$i][$keyattributelower][0],$this->ldapcharset);
|
||||
if(in_array($attributeArray[$j], $attributeAsArray) && is_array($info[$i][$keyattributelower])) {
|
||||
$valueTab = array();
|
||||
foreach($info[$i][$keyattributelower] as $key => $value) {
|
||||
$valueTab[$key] = $this->convToOutputCharset($value,$this->ldapcharset);
|
||||
}
|
||||
$fulllist[$recordid][$attributeArray[$j]] = $valueTab;
|
||||
} else {
|
||||
$fulllist[$recordid][$attributeArray[$j]] = $this->convToOutputCharset($info[$i][$keyattributelower][0],$this->ldapcharset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -385,19 +385,16 @@ class Menubase
|
||||
*/
|
||||
function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
|
||||
{
|
||||
global $langs, $user, $conf;
|
||||
global $mainmenu,$leftmenu; // To export to dol_eval function
|
||||
global $langs, $user, $conf; // To export to dol_eval function
|
||||
global $mainmenu,$leftmenu; // To export to dol_eval function
|
||||
|
||||
$mainmenu=$mymainmenu; // To export to dol_eval function
|
||||
$leftmenu=$myleftmenu; // To export to dol_eval function
|
||||
|
||||
$newTabMenu=array();
|
||||
if (is_array($tabMenu))
|
||||
foreach($tabMenu as $val)
|
||||
{
|
||||
foreach($tabMenu as $val)
|
||||
{
|
||||
if ($val['type']=='top') $newTabMenu[]=$val;
|
||||
}
|
||||
if ($val['type']=='top') $newTabMenu[]=$val;
|
||||
}
|
||||
|
||||
return $newTabMenu;
|
||||
@ -411,80 +408,78 @@ class Menubase
|
||||
* @param string $myleftmenu Value for leftmenu to filter menu to load (always '')
|
||||
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office
|
||||
* @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...)
|
||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||
* @param array &$tabMenu Array with menu entries already loaded
|
||||
* @return array Menu array for particular mainmenu value or full tabArray
|
||||
*/
|
||||
function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
|
||||
{
|
||||
global $langs, $user, $conf; // To export to dol_eval function
|
||||
global $mainmenu,$leftmenu; // To export to dol_eval function
|
||||
|
||||
// We initialize newmenu with first already found menu entries
|
||||
$this->newmenu = $newmenu;
|
||||
global $langs, $user, $conf; // To export to dol_eval function
|
||||
global $mainmenu,$leftmenu; // To export to dol_eval function
|
||||
|
||||
$mainmenu=$mymainmenu; // To export to dol_eval function
|
||||
$leftmenu=$myleftmenu; // To export to dol_eval function
|
||||
|
||||
if (is_array($tabMenu))
|
||||
// Detect what is top mainmenu id
|
||||
$menutopid='';
|
||||
foreach($tabMenu as $key => $val)
|
||||
{
|
||||
$menutopid='';
|
||||
foreach($tabMenu as $key => $val)
|
||||
{
|
||||
// Define menutopid of mainmenu
|
||||
if (empty($menutopid) && $val['type'] == 'top' && $val['mainmenu'] == $mainmenu)
|
||||
{
|
||||
$menutopid=$val['rowid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Define menutopid of mainmenu
|
||||
if (empty($menutopid) && $val['type'] == 'top' && $val['mainmenu'] == $mainmenu)
|
||||
{
|
||||
$menutopid=$val['rowid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Now edit this->newmenu->list to add entries found into tabMenu that are childs of mainmenu claimed, using the fk_menu link (old method)
|
||||
$this->recur($tabMenu, $menutopid, 1);
|
||||
// We initialize newmenu with first already found menu entries
|
||||
$this->newmenu = $newmenu;
|
||||
|
||||
// Now update this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu)
|
||||
foreach($tabMenu as $key => $val)
|
||||
{
|
||||
//var_dump($tabMenu);
|
||||
if ($val['fk_menu'] == -1 && $val['fk_mainmenu'] == $mainmenu) // We found a menu entry not linked to parent with good mainmenu
|
||||
{
|
||||
//print 'Try to add menu (current is mainmenu='.$mainmenu.' leftmenu='.$leftmenu.') for '.join(',',$val).' fk_mainmenu='.$val['fk_mainmenu'].' fk_leftmenu='.$val['fk_leftmenu'].'<br>';
|
||||
//var_dump($this->newmenu->liste);exit;
|
||||
// Now edit this->newmenu->list to add entries found into tabMenu that are childs of mainmenu claimed, using the fk_menu link (old method)
|
||||
$this->recur($tabMenu, $menutopid, 1);
|
||||
|
||||
if (empty($val['fk_leftmenu']))
|
||||
{
|
||||
$this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']); // TODO Add position
|
||||
//var_dump($this->newmenu->liste);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Search first menu with this couple (mainmenu,leftmenu)=(fk_mainmenu,fk_leftmenu)
|
||||
$searchlastsub=0;$lastid=0;$nextid=0;$found=0;
|
||||
foreach($this->newmenu->liste as $keyparent => $valparent)
|
||||
{
|
||||
//var_dump($valparent);
|
||||
if ($searchlastsub) // If we started to search for last submenu
|
||||
{
|
||||
if ($valparent['level'] >= $searchlastsub) $lastid=$keyparent;
|
||||
if ($valparent['level'] < $searchlastsub)
|
||||
{
|
||||
$nextid=$keyparent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu'])
|
||||
{
|
||||
//print "We found parent: keyparent='.$keyparent.' - level=".$valparent['level'].' - '.join(',',$valparent).'<br>';
|
||||
// Now we look to find last subelement of this parent (we add at end)
|
||||
$searchlastsub=($valparent['level']+1);
|
||||
$lastid=$keyparent;
|
||||
$found=1;
|
||||
}
|
||||
}
|
||||
//print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.'<br>';
|
||||
if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Now update this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu)
|
||||
foreach($tabMenu as $key => $val)
|
||||
{
|
||||
//var_dump($tabMenu);
|
||||
if ($val['fk_menu'] == -1 && $val['fk_mainmenu'] == $mainmenu) // We found a menu entry not linked to parent with good mainmenu
|
||||
{
|
||||
//print 'Try to add menu (current is mainmenu='.$mainmenu.' leftmenu='.$leftmenu.') for '.join(',',$val).' fk_mainmenu='.$val['fk_mainmenu'].' fk_leftmenu='.$val['fk_leftmenu'].'<br>';
|
||||
//var_dump($this->newmenu->liste);exit;
|
||||
|
||||
if (empty($val['fk_leftmenu']))
|
||||
{
|
||||
$this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']); // TODO Add position
|
||||
//var_dump($this->newmenu->liste);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Search first menu with this couple (mainmenu,leftmenu)=(fk_mainmenu,fk_leftmenu)
|
||||
$searchlastsub=0;$lastid=0;$nextid=0;$found=0;
|
||||
foreach($this->newmenu->liste as $keyparent => $valparent)
|
||||
{
|
||||
//var_dump($valparent);
|
||||
if ($searchlastsub) // If we started to search for last submenu
|
||||
{
|
||||
if ($valparent['level'] >= $searchlastsub) $lastid=$keyparent;
|
||||
if ($valparent['level'] < $searchlastsub)
|
||||
{
|
||||
$nextid=$keyparent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu'])
|
||||
{
|
||||
//print "We found parent: keyparent='.$keyparent.' - level=".$valparent['level'].' - '.join(',',$valparent).'<br>';
|
||||
// Now we look to find last subelement of this parent (we add at end)
|
||||
$searchlastsub=($valparent['level']+1);
|
||||
$lastid=$keyparent;
|
||||
$found=1;
|
||||
}
|
||||
}
|
||||
//print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.'<br>';
|
||||
if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->newmenu;
|
||||
@ -494,7 +489,7 @@ class Menubase
|
||||
/**
|
||||
* Load entries found in database into variable $tabMenu. Note that only "database menu entries" are loaded here, hardcoded will not be present into output.
|
||||
*
|
||||
* @param string $mymainmenu Value for left that defined mainmenu
|
||||
* @param string $mymainmenu Value for mainmenu that defined mainmenu
|
||||
* @param string $myleftmenu Value for left that defined leftmenu
|
||||
* @param int $type_user Looks for menu entry for 0=Internal users, 1=External users
|
||||
* @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...)
|
||||
@ -584,7 +579,7 @@ class Menubase
|
||||
}
|
||||
//$tmp4=dol_microtime_float();
|
||||
//print '>>> 3 '.($tmp4 - $tmp3).'<br>';
|
||||
|
||||
|
||||
// We complete tabMenu
|
||||
$tabMenu[$b]['rowid'] = $menu['rowid'];
|
||||
$tabMenu[$b]['module'] = $menu['module'];
|
||||
@ -606,10 +601,10 @@ class Menubase
|
||||
$tabMenu[$b]['fk_mainmenu'] = $menu['fk_mainmenu'];
|
||||
$tabMenu[$b]['fk_leftmenu'] = $menu['fk_leftmenu'];
|
||||
$tabMenu[$b]['position'] = $menu['position'];
|
||||
|
||||
|
||||
$b++;
|
||||
}
|
||||
|
||||
|
||||
$a++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -61,7 +61,7 @@ class Translate
|
||||
/**
|
||||
* Set accessor for this->defaultlang
|
||||
*
|
||||
* @param string $srclang Language to use
|
||||
* @param string $srclang Language to use. If '' or 'auto', we use browser lang.
|
||||
* @return void
|
||||
*/
|
||||
function setDefaultLang($srclang='en_US')
|
||||
|
||||
97
htdocs/core/getmenu_jmobile.php
Normal file
97
htdocs/core/getmenu_jmobile.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This file is a modified version of datepicker.php from phpBSM to fix some
|
||||
* bugs, to add new features and to dramatically increase speed.
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/getmenu_jmobile.php
|
||||
* \brief File to return menu
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
|
||||
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
|
||||
//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
|
||||
require_once '../main.inc.php';
|
||||
|
||||
if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php
|
||||
$langs->load("main");
|
||||
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
|
||||
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
|
||||
|
||||
//var_dump($langs->defaultlang);
|
||||
//var_dump($conf->format_date_short_java);
|
||||
//var_dump($langs->trans("FormatDateShortJava"));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
|
||||
$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
|
||||
$arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css');
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
|
||||
print '<body>'."\n";
|
||||
|
||||
if (empty($user->societe_id)) // If internal user or not defined
|
||||
{
|
||||
$conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
|
||||
$conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
|
||||
}
|
||||
else // If external user
|
||||
{
|
||||
$conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
|
||||
$conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
|
||||
}
|
||||
|
||||
// Load the menu manager (only if not already done)
|
||||
$file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu;
|
||||
if (GETPOST('menu')) $file_menu=GETPOST('menu'); // example: menu=eldy_menu.php
|
||||
if (! class_exists('MenuManager'))
|
||||
{
|
||||
$menufound=0;
|
||||
$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
|
||||
foreach($dirmenus as $dirmenu)
|
||||
{
|
||||
$menufound=dol_include_once($dirmenu."standard/".$file_menu);
|
||||
if ($menufound) break;
|
||||
}
|
||||
if (! $menufound) // If failed to include, we try with standard
|
||||
{
|
||||
dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
|
||||
$file_menu='eldy_menu.php';
|
||||
include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
|
||||
}
|
||||
}
|
||||
$menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
|
||||
|
||||
$menumanager->showmenu('jmobile');
|
||||
|
||||
print '</body></html>'."\n";
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
@ -364,7 +364,8 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
|
||||
|
||||
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
|
||||
|
||||
$out= '<script type="text/javascript">
|
||||
$out= "\n<!-- Ajax code to switch constant ".$code." -->".'
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var input = '.json_encode($input).';
|
||||
var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\';
|
||||
@ -376,11 +377,8 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
|
||||
// Set constant
|
||||
$("#set_" + code).click(function() {
|
||||
if (input.alert && input.alert.set) {
|
||||
// Posibility to force label of buttons
|
||||
if (input.alert.set.yesButton)
|
||||
yesButton = input.alert.set.yesButton;
|
||||
if (input.alert.set.noButton)
|
||||
noButton = input.alert.set.noButton;
|
||||
if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton;
|
||||
if (input.alert.set.noButton) noButton = input.alert.set.noButton;
|
||||
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
|
||||
} else {
|
||||
setConstant(url, code, input, entity);
|
||||
@ -390,22 +388,20 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
|
||||
// Del constant
|
||||
$("#del_" + code).click(function() {
|
||||
if (input.alert && input.alert.del) {
|
||||
// Posibility to force label of buttons
|
||||
if (input.alert.del.yesButton)
|
||||
yesButton = input.alert.del.yesButton;
|
||||
if (input.alert.del.noButton)
|
||||
noButton = input.alert.del.noButton;
|
||||
if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton;
|
||||
if (input.alert.del.noButton) noButton = input.alert.del.noButton;
|
||||
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
|
||||
} else {
|
||||
delConstant(url, code, input, entity);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>'."\n";
|
||||
|
||||
$out.= '<div id="confirm_'.$code.'" title="" style="display: none;"></div>';
|
||||
$out.= '<span id="set_'.$code.'" class="linkobject '.(! empty($conf->global->$code)?'hideobject':'').'">'.img_picto($langs->trans("Disabled"),'switch_off').'</span>';
|
||||
$out.= '<span id="del_'.$code.'" class="linkobject '.(! empty($conf->global->$code)?'':'hideobject').'">'.img_picto($langs->trans("Enabled"),'switch_on').'</span>';
|
||||
$out.="\n";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -532,7 +532,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
$sql = "SELECT p.rowid, p.name, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.note ";
|
||||
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.note ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||
$sql .= " ORDER by p.datec";
|
||||
@ -554,7 +554,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
|
||||
print '<td>';
|
||||
$contactstatic->id = $obj->rowid;
|
||||
$contactstatic->name = $obj->name;
|
||||
$contactstatic->lastname = $obj->lastname;
|
||||
$contactstatic->firstname = $obj->firstname;
|
||||
print $contactstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
@ -769,8 +769,8 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
$sql.= " c.code as acode, c.libelle,";
|
||||
$sql.= " u.login, u.rowid";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", m.nom as name, m.prenom as firstname";
|
||||
if (get_class($object) == 'Societe') $sql.= ", sp.name, sp.firstname";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
||||
if (get_class($object) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
@ -830,7 +830,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
// Contact pour cette action
|
||||
if (empty($objcon->id) && $obj->fk_contact > 0)
|
||||
{
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->lastname=$obj->lastname;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
$out.='<td width="120">'.$contactstatic->getNomUrl(1,'',10).'</td>';
|
||||
@ -908,8 +908,8 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
$sql.= " a.fk_user_author, a.fk_contact,";
|
||||
$sql.= " c.code as acode, c.libelle,";
|
||||
$sql.= " u.login, u.rowid as user_id";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", m.nom as name, m.prenom as firstname";
|
||||
if (get_class($object) == 'Societe') $sql.= ", sp.name, sp.firstname";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
||||
if (get_class($object) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
@ -945,7 +945,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
'userid'=>$obj->user_id,
|
||||
'login'=>$obj->login,
|
||||
'contact_id'=>$obj->fk_contact,
|
||||
'name'=>$obj->name,
|
||||
'lastname'=>$obj->lastname,
|
||||
'firstname'=>$obj->firstname,
|
||||
'fk_element'=>$obj->fk_element,
|
||||
'elementtype'=>$obj->elementtype
|
||||
@ -1114,7 +1114,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
// Contact pour cette action
|
||||
if (! empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0)
|
||||
{
|
||||
$contactstatic->name=$histo[$key]['name'];
|
||||
$contactstatic->lastname=$histo[$key]['lastname'];
|
||||
$contactstatic->firstname=$histo[$key]['firstname'];
|
||||
$contactstatic->id=$histo[$key]['contact_id'];
|
||||
$out.='<td width="120">'.$contactstatic->getNomUrl(1,'',10).'</td>';
|
||||
@ -1161,7 +1161,7 @@ function show_subsidiaries($conf,$langs,$db,$object)
|
||||
|
||||
$i=-1;
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.address, s.cp as zip, s.ville as town, s.code_client, s.canvas";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.address, s.zip, s.town, s.code_client, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE s.parent = ".$object->id;
|
||||
$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
|
||||
|
||||
@ -909,7 +909,7 @@ function dol_meta_create($object)
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$nblignes = count($object->lines);
|
||||
$client = $object->client->nom . " " . $object->client->address . " " . $object->client->cp . " " . $object->client->ville;
|
||||
$client = $object->client->nom . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town;
|
||||
$meta = "REFERENCE=\"" . $object->ref . "\"
|
||||
DATE=\"" . dol_print_date($object->date,'') . "\"
|
||||
NB_ITEMS=\"" . $nblignes . "\"
|
||||
|
||||
@ -293,7 +293,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1));
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
|
||||
// Country
|
||||
if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->pays_code))."\n";
|
||||
if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->pays_code))."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
||||
{
|
||||
@ -311,7 +311,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n";
|
||||
// Country
|
||||
if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->pays_code))."\n";
|
||||
if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->pays_code))."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
||||
{
|
||||
|
||||
@ -133,9 +133,6 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
// Instantiate hooks of thirdparty module only if not already define
|
||||
$hookmanager->initHooks(array('mainloginpage'));
|
||||
|
||||
$langcode=(GETPOST('lang')?((is_object($langs)&&$langs->defaultlang)?$langs->defaultlang:'auto'):GETPOST('lang'));
|
||||
$langs->setDefaultLang($langcode);
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("other");
|
||||
$langs->load("help");
|
||||
@ -148,6 +145,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
|
||||
$php_self = $_SERVER['PHP_SELF'];
|
||||
$php_self.= $_SERVER["QUERY_STRING"]?'?'.$_SERVER["QUERY_STRING"]:'';
|
||||
if (! preg_match('/mainmenu=/',$php_self)) $php_self.=(preg_match('/\?/',$php_self)?'&':'?').'mainmenu=home';
|
||||
|
||||
// Title
|
||||
$title='Dolibarr '.DOL_VERSION;
|
||||
@ -190,7 +188,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
$template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set cookie for timeout management
|
||||
$prefix=dol_getprefix();
|
||||
$sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
|
||||
@ -291,13 +289,18 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
// Google AD
|
||||
$main_google_ad_client = ((! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))?1:0);
|
||||
|
||||
// Set jquery theme
|
||||
$dol_loginmesg = (! empty($_SESSION["dol_loginmesg"])?$_SESSION["dol_loginmesg"]:'');
|
||||
$favicon=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/favicon.ico';
|
||||
$jquerytheme = 'smoothness';
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
|
||||
|
||||
// Set dol_hide_topmenu and dol_hide_leftmenu
|
||||
$dol_hide_topmenu=GETPOST('dol_hide_topmenu');
|
||||
$dol_hide_leftmenu=GETPOST('dol_hide_leftmenu');
|
||||
|
||||
include $template_dir.'login.tpl.php'; // To use native PHP
|
||||
// Include login page template
|
||||
include $template_dir.'login.tpl.php';
|
||||
|
||||
|
||||
$_SESSION["dol_loginmesg"] = '';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2010-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -40,7 +40,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu)
|
||||
|
||||
$mainmenu=$_SESSION["mainmenu"];
|
||||
$leftmenu=$_SESSION["leftmenu"];
|
||||
|
||||
|
||||
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||
|
||||
//$tabMenu=array();
|
||||
@ -55,7 +55,6 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu)
|
||||
$idsel=(empty($newTabMenu[$i]['mainmenu'])?'none':$newTabMenu[$i]['mainmenu']);
|
||||
|
||||
$showmode=dol_auguria_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
|
||||
|
||||
if ($showmode == 1)
|
||||
{
|
||||
// Define url
|
||||
@ -163,7 +162,7 @@ function print_end_menu_entry_auguria()
|
||||
function print_end_menu_array_auguria()
|
||||
{
|
||||
print '</ul>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
@ -180,135 +179,133 @@ function print_end_menu_array_auguria()
|
||||
*/
|
||||
function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu)
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||
|
||||
$overwritemenufor = array();
|
||||
$newmenu = new Menu();
|
||||
$overwritemenufor = array();
|
||||
$newmenu = new Menu();
|
||||
|
||||
$mainmenu=$_SESSION["mainmenu"];
|
||||
$leftmenu=$_SESSION["leftmenu"];
|
||||
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<div class="menu_titre" id="menu_titre_logo"></div>';
|
||||
print '<div class="menu_top" id="menu_top_logo"></div>';
|
||||
print '<div class="menu_contenu" id="menu_contenu_logo">';
|
||||
print '<center><img title="" src="'.$urllogo.'"></center>'."\n";
|
||||
print '</div>';
|
||||
print '<div class="menu_end" id="menu_end_logo"></div>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
}
|
||||
$mainmenu=$_SESSION["mainmenu"];
|
||||
$leftmenu=$_SESSION["leftmenu"];
|
||||
|
||||
/**
|
||||
* We update newmenu with entries found into database
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
$menuArbo = new Menubase($db,'auguria');
|
||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<div class="menu_titre" id="menu_titre_logo"></div>';
|
||||
print '<div class="menu_top" id="menu_top_logo"></div>';
|
||||
print '<div class="menu_contenu" id="menu_contenu_logo">';
|
||||
print '<center><img title="" src="'.$urllogo.'"></center>'."\n";
|
||||
print '</div>';
|
||||
print '<div class="menu_end" id="menu_end_logo"></div>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($menu_array_before);exit;
|
||||
//var_dump($menu_array_after);exit;
|
||||
$menu_array=$newmenu->liste;
|
||||
if (is_array($menu_array_before)) $menu_array=array_merge($menu_array_before, $menu_array);
|
||||
if (is_array($menu_array_after)) $menu_array=array_merge($menu_array, $menu_array_after);
|
||||
//var_dump($menu_array);exit;
|
||||
/**
|
||||
* We update newmenu with entries found into database
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
$menuArbo = new Menubase($db,'auguria');
|
||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
||||
|
||||
// Show menu
|
||||
$alt=0;
|
||||
if (is_array($menu_array))
|
||||
{
|
||||
$num=count($menu_array);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$alt++;
|
||||
if (empty($menu_array[$i]['level']))
|
||||
{
|
||||
if (($alt%2==0))
|
||||
{
|
||||
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION))
|
||||
{
|
||||
print '<div class="blockvmenupair">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="blockvmenupair">'."\n";
|
||||
}
|
||||
}
|
||||
//var_dump($menu_array_before);exit;
|
||||
//var_dump($menu_array_after);exit;
|
||||
$menu_array=$newmenu->liste;
|
||||
if (is_array($menu_array_before)) $menu_array=array_merge($menu_array_before, $menu_array);
|
||||
if (is_array($menu_array_after)) $menu_array=array_merge($menu_array, $menu_array_after);
|
||||
//var_dump($menu_array);exit;
|
||||
if (! is_array($menu_array)) return 0;
|
||||
|
||||
// Place tabulation
|
||||
$tabstring='';
|
||||
$tabul=($menu_array[$i]['level'] - 1);
|
||||
if ($tabul > 0)
|
||||
{
|
||||
for ($j=0; $j < $tabul; $j++)
|
||||
{
|
||||
$tabstring.=' ';
|
||||
}
|
||||
}
|
||||
// Show menu
|
||||
$alt=0;
|
||||
$num=count($menu_array);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$alt++;
|
||||
if (empty($menu_array[$i]['level']))
|
||||
{
|
||||
if (($alt%2==0))
|
||||
{
|
||||
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_ACCORDION))
|
||||
{
|
||||
print '<div class="blockvmenupair">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="blockvmenupair">'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
|
||||
$url=dol_buildpath($menu_array[$i]['url'],1);
|
||||
// Place tabulation
|
||||
$tabstring='';
|
||||
$tabul=($menu_array[$i]['level'] - 1);
|
||||
if ($tabul > 0)
|
||||
{
|
||||
for ($j=0; $j < $tabul; $j++)
|
||||
{
|
||||
$tabstring.=' ';
|
||||
}
|
||||
}
|
||||
|
||||
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
|
||||
{
|
||||
if (! preg_match('/\?/',$url)) $url.='?';
|
||||
else $url.='&';
|
||||
$url.='mainmenu='.$mainmenu;
|
||||
}
|
||||
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
|
||||
$url=dol_buildpath($menu_array[$i]['url'],1);
|
||||
|
||||
print '<!-- Add menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['mainmenu'].' -->'."\n";
|
||||
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
|
||||
{
|
||||
if (! preg_match('/\?/',$url)) $url.='?';
|
||||
else $url.='&';
|
||||
$url.='mainmenu='.$mainmenu;
|
||||
}
|
||||
|
||||
// Menu niveau 0
|
||||
if ($menu_array[$i]['level'] == 0)
|
||||
{
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>';
|
||||
}
|
||||
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>';
|
||||
}
|
||||
print "\n".'<div id="section_content_'.$i.'">'."\n";
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
// Menu niveau > 0
|
||||
if ($menu_array[$i]['level'] > 0)
|
||||
{
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_contenu">'.$tabstring.'<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>';
|
||||
}
|
||||
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
{
|
||||
print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font></div>';
|
||||
}
|
||||
}
|
||||
print '<!-- Add menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['mainmenu'].' -->'."\n";
|
||||
|
||||
// If next is a new block or end
|
||||
if (empty($menu_array[$i+1]['level']))
|
||||
{
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
print "</div><!-- end section content -->\n";
|
||||
print "</div><!-- end blockvmenu pair/impair -->\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Menu niveau 0
|
||||
if ($menu_array[$i]['level'] == 0)
|
||||
{
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>';
|
||||
}
|
||||
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>';
|
||||
}
|
||||
print "\n".'<div id="section_content_'.$i.'">'."\n";
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
// Menu niveau > 0
|
||||
if ($menu_array[$i]['level'] > 0)
|
||||
{
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_contenu">'.$tabstring.'<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>';
|
||||
}
|
||||
else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
{
|
||||
print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font></div>';
|
||||
}
|
||||
}
|
||||
|
||||
return count($menu_array);
|
||||
// If next is a new block or end
|
||||
if (empty($menu_array[$i+1]['level']))
|
||||
{
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
print "</div><!-- end section content -->\n";
|
||||
print "</div><!-- end blockvmenu pair/impair -->\n";
|
||||
}
|
||||
}
|
||||
|
||||
return count($menu_array);
|
||||
}
|
||||
|
||||
|
||||
@ -332,7 +329,9 @@ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexterna
|
||||
$found=0;
|
||||
foreach($tmploops as $tmploop)
|
||||
{
|
||||
if (in_array($tmploop, $listofmodulesforexternal)) { $found++; break; }
|
||||
if (in_array($tmploop, $listofmodulesforexternal)) {
|
||||
$found++; break;
|
||||
}
|
||||
}
|
||||
if (! $found) return 0; // Entry is for menus all excluded to external users
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -31,12 +31,12 @@ class MenuManager
|
||||
var $type_user; // Put 0 for internal users, 1 for external users
|
||||
var $atarget=""; // Valeur du target a utiliser dans les liens
|
||||
var $name="eldy";
|
||||
|
||||
|
||||
var $menu_array;
|
||||
var $menu_array_after;
|
||||
|
||||
var $tabMenu;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -52,7 +52,7 @@ class MenuManager
|
||||
// On sauve en session le menu principal choisi
|
||||
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
|
||||
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
|
||||
|
||||
|
||||
// Read mainmenu and leftmenu that define which menu to show
|
||||
if (isset($_GET["mainmenu"]))
|
||||
{
|
||||
@ -62,11 +62,11 @@ class MenuManager
|
||||
$_SESSION["leftmenuopened"]="";
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// On va le chercher en session si non defini par le lien
|
||||
$mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
|
||||
}
|
||||
|
||||
|
||||
if (isset($_GET["leftmenu"]))
|
||||
{
|
||||
// On sauve en session le menu principal choisi
|
||||
@ -86,7 +86,7 @@ class MenuManager
|
||||
// On va le chercher en session si non defini par le lien
|
||||
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
|
||||
}
|
||||
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
$tabMenu=array();
|
||||
$menuArbo = new Menubase($db,'eldy');
|
||||
@ -98,7 +98,7 @@ class MenuManager
|
||||
/**
|
||||
* Show menu
|
||||
*
|
||||
* @param string $mode 'top' or 'left'
|
||||
* @param string $mode 'top', 'left', 'jmobile'
|
||||
* @return int Number of menu entries shown
|
||||
*/
|
||||
function showmenu($mode)
|
||||
@ -112,11 +112,12 @@ class MenuManager
|
||||
$conf->global->MAIN_SEARCHFORM_SOCIETE=0;
|
||||
$conf->global->MAIN_SEARCHFORM_CONTACT=0;
|
||||
}
|
||||
|
||||
|
||||
$res='ErrorBadParameterForMode';
|
||||
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu);
|
||||
if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu);
|
||||
|
||||
if ($mode == 'jmobile') $res=print_jmobile_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'<27>tait pas d<>fini
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->line_height = 5;
|
||||
|
||||
@ -82,7 +82,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
|
||||
// Recupere emetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -541,7 +541,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// If France, show VAT mention if not applicable
|
||||
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
|
||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
||||
{
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
@ -623,7 +623,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0);
|
||||
$posy=$pdf->GetY()+2;
|
||||
}
|
||||
}
|
||||
@ -740,7 +740,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
@ -774,7 +774,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
|
||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
@ -832,7 +832,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
|
||||
if ($localtax_type == '7') { // amount on order
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
@ -872,7 +872,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$tvakey=str_replace('*','',$tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
|
||||
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
|
||||
|
||||
if ($localtax_type == '7') { // amount on order
|
||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
@ -65,9 +65,9 @@
|
||||
<b>__Name__ :</b><br>
|
||||
__MAIN_INFO_SOCIETE_NOM__<br>
|
||||
<b>__Address__ :</b><br>
|
||||
__MAIN_INFO_SOCIETE_ADRESSE__<br>
|
||||
<b>__Zip__ :</b> __MAIN_INFO_SOCIETE_CP__<br>
|
||||
<b>__Town__ :</b> __MAIN_INFO_SOCIETE_VILLE__<br>
|
||||
__MAIN_INFO_SOCIETE_ADDRESS__<br>
|
||||
<b>__Zip__ :</b> __MAIN_INFO_SOCIETE_ZIP__<br>
|
||||
<b>__Town__ :</b> __MAIN_INFO_SOCIETE_TOWN__<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -140,13 +140,13 @@ class html_cerfafr extends ModeleDon
|
||||
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->currency),$form);
|
||||
$form = str_replace('__CURRENCYCODE__',$conf->currency,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_ADRESSE__',$mysoc->address,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->zip,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_VILLE__',$mysoc->town,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_ZIP__',$mysoc->zip,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_TOWN__',$mysoc->town,$form);
|
||||
$form = str_replace('__DONATOR_NAME__',$don->nom,$form);
|
||||
$form = str_replace('__DONATOR_ADDRESS__',$don->address,$form);
|
||||
$form = str_replace('__DONATOR_ZIP__',$don->cp,$form);
|
||||
$form = str_replace('__DONATOR_TOWN__',$don->ville,$form);
|
||||
$form = str_replace('__DONATOR_ZIP__',$don->zip,$form);
|
||||
$form = str_replace('__DONATOR_TOWN__',$don->town,$form);
|
||||
$form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form);
|
||||
$form = str_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$form);
|
||||
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
|
||||
|
||||
@ -65,7 +65,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
<?PHP
|
||||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/modules/expedition/methode_expedition_chrono.modules.php
|
||||
* \ingroup expedition
|
||||
*/
|
||||
|
||||
include_once "methode_expedition.modules.php";
|
||||
|
||||
/**
|
||||
* Class to manage shipment Chronopost
|
||||
*/
|
||||
class methode_expedition_chrono extends ModeleShippingMethod
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db=0)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->id = 8; // Do not change this value
|
||||
$this->code = "COLCHRONO"; // Do not change this value
|
||||
$this->name = "Chronopost";
|
||||
$this->description = "Chronopost";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return URL of provider
|
||||
*
|
||||
* @param string $tracking_number Tracking number
|
||||
* @return string URL for tracking
|
||||
*/
|
||||
function provider_url_status($tracking_number)
|
||||
{
|
||||
return sprintf("http://www.chronopost.fr/expedier/inputLTNumbersNoJahia.do?listeNumeros=%s",$tracking_number);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,55 +0,0 @@
|
||||
<?PHP
|
||||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* \file htdocs/core/modules/expedition/methode_expedition_gls.modules.php
|
||||
* \ingroup expedition
|
||||
*/
|
||||
|
||||
include_once "methode_expedition.modules.php";
|
||||
|
||||
/**
|
||||
* Class to manage shipment GLS
|
||||
*/
|
||||
class methode_expedition_gls extends ModeleShippingMethod
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db=0)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->id = 7; // Do not change this value
|
||||
$this->code = "COLGLS"; // Do not change this value
|
||||
$this->name = "GLS";
|
||||
$this->description = "General Logistics Systems";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return URL of provider
|
||||
*
|
||||
* @param string $tracking_number Tracking number
|
||||
* @return string URL for tracking
|
||||
*/
|
||||
function provider_url_status($tracking_number)
|
||||
{
|
||||
return sprintf("http://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/FR01/FR/5004.htm?txtAction=71000&txtRefNo=%s",$tracking_number);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,55 +0,0 @@
|
||||
<?PHP
|
||||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/*
|
||||
* \file htdocs/core/modules/expedition/methode_expedition_kiala.modules.php
|
||||
* \ingroup expedition
|
||||
*/
|
||||
|
||||
include_once "methode_expedition.modules.php";
|
||||
|
||||
|
||||
Class methode_expedition_kiala extends ModeleShippingMethod
|
||||
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function methode_expedition_kiala($db=0)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->id = 6; // Do not change this value
|
||||
$this->code = "COLKIALA"; // Do not change this value
|
||||
$this->name = "KIALA";
|
||||
$this->description = "KIALA";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return URL of provider
|
||||
*
|
||||
* @param string $tracking_number Tracking number
|
||||
* @return string URL for tracking
|
||||
*/
|
||||
function provider_url_status($tracking_number)
|
||||
{
|
||||
return sprintf("http://www.kiala.fr/tnt/delivery/%s",$tracking_number);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,54 +0,0 @@
|
||||
<?PHP
|
||||
/*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/*
|
||||
* \file htdocs/core/modules/expedition/methode_expedition_ups.modules.php
|
||||
* \ingroup expedition
|
||||
*/
|
||||
|
||||
include_once "methode_expedition.modules.php";
|
||||
|
||||
|
||||
class methode_expedition_ups extends ModeleShippingMethod
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function methode_expedition_ups($db=0)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->id = 5; // Do not change this value
|
||||
$this->code = "COLUPS"; // Do not change this value
|
||||
$this->name = "UPS";
|
||||
$this->description = "United Parcel Service";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return URL of provider
|
||||
*
|
||||
* @param string $tracking_number Tracking number
|
||||
* @return string URL for tracking
|
||||
*/
|
||||
function provider_url_status($tracking_number)
|
||||
{
|
||||
return sprintf("http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber2=&InquiryNumber3=&tracknums_displayed=3&loc=fr_FR&TypeOfInquiryNumber=T&HTMLVersion=4.0&InquiryNumber22=&InquiryNumber32=&track=Track&Suivi.x=64&Suivi.y=7&Suivi=Valider&InquiryNumber1=%s",$tracking_number);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -82,7 +82,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
|
||||
// Recupere emetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user