Merge branch 'develop' of git://github.com/Dolibarr/dolibarr.git into fgd

Conflicts:
	htdocs/comm/prospect/list.php
This commit is contained in:
jfefe 2013-02-17 21:15:49 +01:00
commit 8ca9d8e601
42 changed files with 266 additions and 176 deletions

View File

@ -8,6 +8,7 @@ For users:
- New: Can attach files onto trip and expenses modules. - New: Can attach files onto trip and expenses modules.
- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR - New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR
- New: Can define a hierarchical responsible on user - New: Can define a hierarchical responsible on user
- New: Merge tab customer and prospect
For developers: For developers:
- System of menu managers has been rewritten to reduce code to do same things. - System of menu managers has been rewritten to reduce code to do same things.

View File

@ -33,11 +33,11 @@ complete release of Dolibarr, step by step.
- Check all files are commited. - Check all files are commited.
- Update version/info in /ChangeLog and /filefunc.inc.php - Update version/info in /ChangeLog and /filefunc.inc.php
- Update version number with x.x.x-y in htdocs/filefunc.inc.php - Update version number with x.x.x in htdocs/filefunc.inc.php
- Update version number with x.x.x-y in build/makepack-dolibarr.pl - Update version number with x.x.x in build/makepack-dolibarr.pl
- Update version number with x.x.x-y in build/debian/changelog - Update version number with x.x.x in build/debian/changelog
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss - Update version number with x.x.x in build/exe/doliwamp/doliwamp.iss
- Update version number with x.x.x-y in build/rpm/*.spec - Update version number with x.x.x in build/rpm/*.spec
- Update PAD files. - Update PAD files.
- Commit all changes. - Commit all changes.
- Add a Tag (DOLIBARR_x_y) - Add a Tag (DOLIBARR_x_y)

View File

@ -35,9 +35,9 @@
<Program_Info> <Program_Info>
<Program_Name>Dolibarr</Program_Name> <Program_Name>Dolibarr</Program_Name>
<Program_Version>3.3.0</Program_Version> <Program_Version>3.3.0</Program_Version>
<Program_Release_Month>08</Program_Release_Month> <Program_Release_Month>02</Program_Release_Month>
<Program_Release_Day>10</Program_Release_Day> <Program_Release_Day>17</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year> <Program_Release_Year>2013</Program_Release_Year>
<Program_Cost_Dollars /> <Program_Cost_Dollars />
<Program_Cost_Other_Code /> <Program_Cost_Other_Code />
<Program_Cost_Other /> <Program_Cost_Other />

View File

@ -35,9 +35,9 @@
<Program_Info> <Program_Info>
<Program_Name>DoliWamp</Program_Name> <Program_Name>DoliWamp</Program_Name>
<Program_Version>3.3.0</Program_Version> <Program_Version>3.3.0</Program_Version>
<Program_Release_Month>08</Program_Release_Month> <Program_Release_Month>02</Program_Release_Month>
<Program_Release_Day>10</Program_Release_Day> <Program_Release_Day>17</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year> <Program_Release_Year>2013</Program_Release_Year>
<Program_Cost_Dollars /> <Program_Cost_Dollars />
<Program_Cost_Other_Code /> <Program_Cost_Other_Code />
<Program_Cost_Other /> <Program_Cost_Other />

View File

@ -333,5 +333,5 @@ fi
%changelog %changelog
* Mon Jan 14 2013 Laurent Destailleur 3.4.0-0.1.a * Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
- Initial version (#723326) - Initial version (#723326)

View File

@ -522,5 +522,5 @@ fi
%changelog %changelog
* Mon Jan 14 2013 Laurent Destailleur 3.4.0-0.1.a * Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
- Initial version (#723326) - Initial version (#723326)

View File

@ -322,5 +322,5 @@ fi
%changelog %changelog
* Mon Jan 14 2013 Laurent Destailleur 3.4.0-0.1.a * Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
- Initial version (#723326) - Initial version (#723326)

View File

@ -333,5 +333,5 @@ fi
%changelog %changelog
* Mon Jan 14 2013 Laurent Destailleur 3.4.0-0.1.a * Sun Feb 17 2013 Laurent Destailleur 3.4.0-0.1.a
- Initial version (#723326) - Initial version (#723326)

View File

@ -51,7 +51,7 @@ class Adherent extends CommonObject
var $login; var $login;
var $pass; var $pass;
var $societe; var $societe;
var $adresse; //var $adresse;
var $address; var $address;
var $cp; var $cp;
var $zip; var $zip;
@ -429,7 +429,7 @@ class Adherent extends CommonObject
$sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null"); $sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null");
$sql.= ", societe=" .($this->societe?"'".$this->db->escape($this->societe)."'":"null"); $sql.= ", societe=" .($this->societe?"'".$this->db->escape($this->societe)."'":"null");
$sql.= ", fk_soc=" .($this->fk_soc > 0?"'".$this->fk_soc."'":"null"); $sql.= ", fk_soc=" .($this->fk_soc > 0?"'".$this->fk_soc."'":"null");
$sql.= ", adresse=" .($this->address?"'".$this->db->escape($this->address)."'":"null"); $sql.= ", address=" .($this->address?"'".$this->db->escape($this->address)."'":"null");
$sql.= ", cp=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null"); $sql.= ", cp=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null");
$sql.= ", ville=" .($this->town?"'".$this->db->escape($this->town)."'":"null"); $sql.= ", ville=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
$sql.= ", pays=" .($this->country_id>0?"'".$this->country_id."'":"null"); $sql.= ", pays=" .($this->country_id>0?"'".$this->country_id."'":"null");
@ -1019,7 +1019,7 @@ class Adherent extends CommonObject
{ {
global $langs; 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.adresse as address, d.cp as zip, d.ville as town, d.note,"; $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.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $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.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,"; $sql.= " d.datec as datec,";
@ -1065,7 +1065,7 @@ class Adherent extends CommonObject
$this->pass = $obj->pass; $this->pass = $obj->pass;
$this->societe = $obj->societe; $this->societe = $obj->societe;
$this->fk_soc = $obj->fk_soc; $this->fk_soc = $obj->fk_soc;
$this->adresse = $obj->address; // deprecated //$this->adresse = $obj->address; // deprecated
$this->address = $obj->address; $this->address = $obj->address;
$this->cp = $obj->zip; // deprecated $this->cp = $obj->zip; // deprecated
$this->zip = $obj->zip; $this->zip = $obj->zip;
@ -1824,7 +1824,7 @@ class Adherent extends CommonObject
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; 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->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->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
if ($this->adresse && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse; 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->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->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;

View File

@ -259,7 +259,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
$object->pass = trim($_POST["pass"]); $object->pass = trim($_POST["pass"]);
$object->societe = trim($_POST["societe"]); $object->societe = trim($_POST["societe"]);
$object->adresse = trim($_POST["address"]); // deprecated //$object->adresse = trim($_POST["address"]); // deprecated
$object->address = trim($_POST["address"]); $object->address = trim($_POST["address"]);
$object->cp = trim($_POST["zipcode"]); // deprecated $object->cp = trim($_POST["zipcode"]); // deprecated
$object->zip = trim($_POST["zipcode"]); $object->zip = trim($_POST["zipcode"]);
@ -440,7 +440,7 @@ if ($action == 'add' && $user->rights->adherent->creer)
$object->firstname = $prenom; $object->firstname = $prenom;
$object->lastname = $nom; $object->lastname = $nom;
$object->societe = $societe; $object->societe = $societe;
$object->adresse = $address; // deprecated //$object->adresse = $address; // deprecated
$object->address = $address; $object->address = $address;
$object->cp = $zip; // deprecated $object->cp = $zip; // deprecated
$object->zip = $zip; $object->zip = $zip;

View File

@ -104,7 +104,7 @@ if ($sall)
$sql.=" AND ("; $sql.=" AND (";
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR "; 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.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
$sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.adresse 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.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
} }
if ($type > 0) if ($type > 0)

View File

@ -416,7 +416,7 @@ if ($rowid > 0)
if ($sall) if ($sall)
{ {
$sql.= " AND (d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'"; $sql.= " AND (d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.adresse 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.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
} }
if ($status != '') if ($status != '')

View File

@ -105,6 +105,24 @@ print_fiche_titre($langs->trans("MailingSetup"),$linkback,'setup');
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#MAILING_EMAIL_UNSUBSCRIBE_KEY").val(token);
});
});
});';
print '</script>';
}
print '<br>'; print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -155,7 +173,9 @@ print '</td></tr>';
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
print $langs->trans("ActivateCheckReadKey").'</td><td>'; print $langs->trans("ActivateCheckReadKey").'</td><td>';
print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" '.$readonly.' value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">'; print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" '.$readonly.' value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -143,6 +143,7 @@ if ($socid) $param.="&socid=".$socid;
if ($showbirthday) $param.="&showbirthday=1"; if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid; if ($pid) $param.="&projectid=".$pid;
if ($type) $param.="&type=".$type; if ($type) $param.="&type=".$type;
if ($actioncode) $param.="&actioncode=".$actioncode;
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,";

View File

@ -79,12 +79,12 @@ $result = restrictedArea($user, 'propal', $id);
$object = new Propal($db); $object = new Propal($db);
// Load object
// Load object // Load object
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$ret=$object->fetch($id, $ref); $ret=$object->fetch($id, $ref);
$ret=$object->fetch_thirdparty(); if ($ret > 0) $ret=$object->fetch_thirdparty();
if ($ret < 0) dol_print_error('',$object->error);
} }
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array

View File

@ -90,7 +90,7 @@ class Propal extends CommonObject
var $fk_delivery_address; // deprecated (for compatibility) var $fk_delivery_address; // deprecated (for compatibility)
var $fk_address; var $fk_address;
var $address_type; var $address_type;
var $adresse; var $address;
var $availability_id; var $availability_id;
var $availability_code; var $availability_code;
var $demand_reason_id; var $demand_reason_id;
@ -789,7 +789,7 @@ class Propal extends CommonObject
if (! $error && $this->fk_delivery_address) if (! $error && $this->fk_delivery_address)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."propal"; $sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql.= " SET fk_adresse_livraison = ".$this->fk_delivery_address; $sql.= " SET fk_delivery_address = ".$this->fk_delivery_address;
$sql.= " WHERE ref = '".$this->ref."'"; $sql.= " WHERE ref = '".$this->ref."'";
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity = ".$conf->entity;
@ -985,7 +985,7 @@ class Propal extends CommonObject
$sql.= ", p.note as note_private, p.note_public"; $sql.= ", p.note as note_private, p.note_public";
$sql.= ", p.fk_projet, p.fk_statut"; $sql.= ", p.fk_projet, p.fk_statut";
$sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture"; $sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture";
$sql.= ", p.fk_adresse_livraison"; $sql.= ", p.fk_delivery_address";
$sql.= ", p.fk_availability"; $sql.= ", p.fk_availability";
$sql.= ", p.fk_input_reason"; $sql.= ", p.fk_input_reason";
$sql.= ", p.fk_cond_reglement"; $sql.= ", p.fk_cond_reglement";
@ -1049,8 +1049,8 @@ class Propal extends CommonObject
$this->demand_reason_id = $obj->fk_input_reason; $this->demand_reason_id = $obj->fk_input_reason;
$this->demand_reason_code = $obj->demand_reason_code; $this->demand_reason_code = $obj->demand_reason_code;
$this->demand_reason = $obj->demand_reason; $this->demand_reason = $obj->demand_reason;
$this->fk_delivery_address = $obj->fk_adresse_livraison; // TODO obsolete //$this->fk_delivery_address = $obj->fk_adresse_livraison; // TODO obsolete
$this->fk_address = $obj->fk_adresse_livraison; $this->fk_address = $obj->fk_delivery_address;
$this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_id = $obj->fk_mode_reglement;
$this->mode_reglement_code = $obj->mode_reglement_code; $this->mode_reglement_code = $obj->mode_reglement_code;

View File

@ -389,6 +389,7 @@ if ($resql)
$prospectstatic->id=$obj->rowid; $prospectstatic->id=$obj->rowid;
$prospectstatic->nom=$obj->nom; $prospectstatic->nom=$obj->nom;
$prospectstatic->status=$obj->status; $prospectstatic->status=$obj->status;
$prospectstatic->fk_prospectlevel=$obj->fk_prospectlevel;
print $prospectstatic->getNomUrl(1,'prospect'); print $prospectstatic->getNomUrl(1,'prospect');
print '</td>'; print '</td>';
print "<td>".$obj->zip."&nbsp;</td>"; print "<td>".$obj->zip."&nbsp;</td>";
@ -398,7 +399,7 @@ if ($resql)
print '<td align="center">'.dol_print_date($db->jdate($obj->datec)).'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->datec)).'</td>';
// Level // Level
print '<td align="center">'; print '<td align="center">';
print $prospectstatic->getLibProspLevel($obj->fk_prospectlevel); print $prospectstatic->getLibProspLevel();
print "</td>"; print "</td>";
// Statut // Statut
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
@ -419,7 +420,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
print $prospectstatic->getLibStatut(3); print $prospectstatic->LibStatut($prospectstatic->status,3);
print '</td>'; print '</td>';
$parameters=array('obj' => $obj); $parameters=array('obj' => $obj);

View File

@ -66,7 +66,7 @@ class Commande extends CommonOrder
var $demand_reason_id; var $demand_reason_id;
var $demand_reason_code; var $demand_reason_code;
var $fk_delivery_address; var $fk_delivery_address;
var $adresse; var $address;
var $date; // Date commande var $date; // Date commande
var $date_commande; // Date commande (deprecated) var $date_commande; // Date commande (deprecated)
var $date_livraison; // Date livraison souhaitee var $date_livraison; // Date livraison souhaitee
@ -631,7 +631,7 @@ class Commande extends CommonOrder
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande (";
$sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note, note_public, ref_client, ref_int"; $sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note, note_public, ref_client, ref_int";
$sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_availability, fk_input_reason, date_livraison, fk_adresse_livraison"; $sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
$sql.= ", remise_absolue, remise_percent"; $sql.= ", remise_absolue, remise_percent";
$sql.= ", entity"; $sql.= ", entity";
$sql.= ")"; $sql.= ")";
@ -1240,7 +1240,7 @@ class Commande extends CommonOrder
$sql.= ', c.date_commande'; $sql.= ', c.date_commande';
$sql.= ', c.date_livraison'; $sql.= ', c.date_livraison';
$sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; $sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed';
$sql.= ', c.note as note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.fk_adresse_livraison, c.extraparams'; $sql.= ', c.note as note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.fk_delivery_address, c.extraparams';
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', ca.code as availability_code'; $sql.= ', ca.code as availability_code';
@ -1301,7 +1301,7 @@ class Commande extends CommonOrder
$this->demand_reason_id = $obj->fk_input_reason; $this->demand_reason_id = $obj->fk_input_reason;
$this->demand_reason_code = $obj->demand_reason_code; $this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->date_livraison); $this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison; $this->fk_delivery_address = $obj->fk_delivery_address;
$this->extraparams = (array) json_decode($obj->extraparams, true); $this->extraparams = (array) json_decode($obj->extraparams, true);

View File

@ -42,7 +42,7 @@ class Don extends CommonObject
var $prenom; var $prenom;
var $nom; var $nom;
var $societe; var $societe;
var $adresse; var $address;
var $cp; var $cp;
var $ville; var $ville;
var $pays; var $pays;
@ -188,7 +188,7 @@ class Don extends CommonObject
$this->amount = 100; $this->amount = 100;
$this->public = 1; $this->public = 1;
$this->societe = 'The Company'; $this->societe = 'The Company';
$this->adresse = 'Twist road'; $this->address = 'Twist road';
$this->cp = '99999'; $this->cp = '99999';
$this->ville = 'Town'; $this->ville = 'Town';
$this->note_public='SPECIMEN'; $this->note_public='SPECIMEN';
@ -217,7 +217,7 @@ class Don extends CommonObject
} }
} }
if (dol_strlen(trim($this->adresse)) == 0) if (dol_strlen(trim($this->address)) == 0)
{ {
$error_string[$err] = "L'adresse saisie est invalide"; $error_string[$err] = "L'adresse saisie est invalide";
$err++; $err++;
@ -297,7 +297,7 @@ class Don extends CommonObject
global $conf; global $conf;
// Clean parameters // Clean parameters
$this->address=($this->address>0?$this->address:$this->adresse); $this->address=($this->address>0?$this->address:$this->address);
$this->zip=($this->zip>0?$this->zip:$this->cp); $this->zip=($this->zip>0?$this->zip:$this->cp);
$this->town=($this->town>0?$this->town:$this->ville); $this->town=($this->town>0?$this->town:$this->ville);
$this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays); $this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays);
@ -313,7 +313,7 @@ class Don extends CommonObject
$sql.= ", prenom"; $sql.= ", prenom";
$sql.= ", nom"; $sql.= ", nom";
$sql.= ", societe"; $sql.= ", societe";
$sql.= ", adresse"; $sql.= ", address";
$sql.= ", cp"; $sql.= ", cp";
$sql.= ", ville"; $sql.= ", ville";
$sql.= ", pays"; $sql.= ", pays";
@ -334,7 +334,7 @@ class Don extends CommonObject
$sql.= ", '".$this->db->escape($this->prenom)."'"; $sql.= ", '".$this->db->escape($this->prenom)."'";
$sql.= ", '".$this->db->escape($this->nom)."'"; $sql.= ", '".$this->db->escape($this->nom)."'";
$sql.= ", '".$this->db->escape($this->societe)."'"; $sql.= ", '".$this->db->escape($this->societe)."'";
$sql.= ", '".$this->db->escape($this->adresse)."'"; $sql.= ", '".$this->db->escape($this->address)."'";
$sql.= ", '".$this->db->escape($this->zip)."'"; $sql.= ", '".$this->db->escape($this->zip)."'";
$sql.= ", '".$this->db->escape($this->town)."'"; $sql.= ", '".$this->db->escape($this->town)."'";
$sql.= ", '".$this->db->escape($this->country)."'"; // TODO use country_id $sql.= ", '".$this->db->escape($this->country)."'"; // TODO use country_id
@ -382,7 +382,7 @@ class Don extends CommonObject
function update($user) function update($user)
{ {
// Clean parameters // Clean parameters
$this->address=($this->address>0?$this->address:$this->adresse); $this->address=($this->address>0?$this->address:$this->address);
$this->zip=($this->zip>0?$this->zip:$this->cp); $this->zip=($this->zip>0?$this->zip:$this->cp);
$this->town=($this->town>0?$this->town:$this->ville); $this->town=($this->town>0?$this->town:$this->ville);
$this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays); $this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays);
@ -394,7 +394,7 @@ class Don extends CommonObject
$sql .= ",prenom = '".$this->db->escape($this->prenom)."'"; $sql .= ",prenom = '".$this->db->escape($this->prenom)."'";
$sql .= ",nom='".$this->db->escape($this->nom)."'"; $sql .= ",nom='".$this->db->escape($this->nom)."'";
$sql .= ",societe='".$this->db->escape($this->societe)."'"; $sql .= ",societe='".$this->db->escape($this->societe)."'";
$sql .= ",adresse='".$this->db->escape($this->address)."'"; $sql .= ",address='".$this->db->escape($this->address)."'";
$sql .= ",cp='".$this->db->escape($this->zip)."'"; $sql .= ",cp='".$this->db->escape($this->zip)."'";
$sql .= ",ville='".$this->db->escape($this->town)."'"; $sql .= ",ville='".$this->db->escape($this->town)."'";
$sql .= ",pays='".$this->db->escape($this->country)."'"; // TODO use country_id $sql .= ",pays='".$this->db->escape($this->country)."'"; // TODO use country_id
@ -463,7 +463,7 @@ class Don extends CommonObject
global $conf; global $conf;
$sql = "SELECT d.rowid, d.datec, d.tms as datem, d.datedon,"; $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.adresse, 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.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.= " p.title as project_label"; $sql.= " p.title as project_label";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_don_projet"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_don_projet";
@ -487,7 +487,7 @@ class Don extends CommonObject
$this->nom = $obj->nom; $this->nom = $obj->nom;
$this->societe = $obj->societe; $this->societe = $obj->societe;
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->adresse = $obj->adresse; $this->address = $obj->address;
$this->cp = $obj->cp; $this->cp = $obj->cp;
$this->ville = $obj->ville; $this->ville = $obj->ville;
$this->zip = $obj->cp; $this->zip = $obj->cp;

View File

@ -88,7 +88,7 @@ if ($action == 'update')
$don->prenom = $_POST["prenom"]; $don->prenom = $_POST["prenom"];
$don->nom = $_POST["nom"]; $don->nom = $_POST["nom"];
$don->societe = $_POST["societe"]; $don->societe = $_POST["societe"];
$don->adresse = $_POST["adresse"]; $don->address = $_POST["address"];
$don->amount = price2num($_POST["amount"]); $don->amount = price2num($_POST["amount"]);
$don->cp = $_POST["zipcode"]; $don->cp = $_POST["zipcode"];
$don->ville = $_POST["town"]; $don->ville = $_POST["town"];
@ -140,7 +140,7 @@ if ($action == 'add')
$don->prenom = $_POST["prenom"]; $don->prenom = $_POST["prenom"];
$don->nom = $_POST["nom"]; $don->nom = $_POST["nom"];
$don->societe = $_POST["societe"]; $don->societe = $_POST["societe"];
$don->adresse = $_POST["adresse"]; $don->address = $_POST["address"];
$don->amount = price2num($_POST["amount"]); $don->amount = price2num($_POST["amount"]);
$don->cp = $_POST["zipcode"]; $don->cp = $_POST["zipcode"];
$don->ville = $_POST["town"]; $don->ville = $_POST["town"];
@ -300,7 +300,7 @@ if ($action == 'create')
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("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("Lastname").'</td><td><input type="text" name="nom" value="'.$_POST["nom"].'" size="40"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'; print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="adresse" wrap="soft" cols="40" rows="3">'.$_POST["adresse"].'</textarea></td></tr>'; print '<textarea name="address" wrap="soft" cols="40" rows="3">'.$_POST["address"].'</textarea></td></tr>';
// Zip / Town // Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
@ -390,7 +390,7 @@ if (! empty($id) && $action == 'edit')
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("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("Lastname").'</td><td><input type="text" name="nom" size="40" value="'.$don->nom.'"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'; print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="adresse" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->adresse.'</textarea></td></tr>'; print '<textarea name="address" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->address.'</textarea></td></tr>';
// Zip / Town // Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
@ -485,7 +485,7 @@ if (! empty($id) && $action != 'edit')
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>'; 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("Firstname").'</td><td>'.$don->prenom.'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->nom.'</td></tr>'; print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->nom.'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->adresse).'</td></tr>'; print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->address).'</td></tr>';
// Zip / Town // 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->cp.($don->cp && $don->ville?' / ':'').$don->ville.'</td></tr>';

View File

@ -1915,14 +1915,6 @@ if ($action == 'create')
print $desc; print $desc;
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Deposit
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="3"'.(GETPOST('type')==3?' checked="checked"':'').'>';
print '</td><td valign="middle">';
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
print $desc;
print '</td></tr>'."\n";
// Proforma // Proforma
if (! empty($conf->global->FACTURE_USE_PROFORMAT)) if (! empty($conf->global->FACTURE_USE_PROFORMAT))
{ {
@ -1934,6 +1926,17 @@ if ($action == 'create')
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
if (empty($origin))
{
// Deposit
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="3"'.(GETPOST('type')==3?' checked="checked"':'').'>';
print '</td><td valign="middle">';
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
print $desc;
print '</td></tr>'."\n";
}
if ($socid > 0) if ($socid > 0)
{ {
// Replacement // Replacement
@ -1959,7 +1962,10 @@ if ($action == 'create')
$desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
print $desc; print $desc;
print '</td></tr>'."\n"; print '</td></tr>'."\n";
}
if (empty($origin) && $socid > 0)
{
// Credit note // Credit note
print '<tr height="18"><td valign="middle">'; print '<tr height="18"><td valign="middle">';
print '<input type="radio" name="type" value="2"'.(GETPOST('type')==2?' checked=true':''); print '<input type="radio" name="type" value="2"'.(GETPOST('type')==2?' checked=true':'');
@ -1985,6 +1991,7 @@ if ($action == 'create')
print $desc; print $desc;
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
print '</table>'; print '</table>';
print '</td></tr>'; print '</td></tr>';

View File

@ -520,7 +520,7 @@ class Contact extends CommonObject
$this->prenom = $obj->firstname; // TODO deprecated $this->prenom = $obj->firstname; // TODO deprecated
$this->address = $obj->address; $this->address = $obj->address;
$this->adresse = $obj->address; // TODO deprecated //$this->adresse = $obj->address; // TODO deprecated
$this->cp = $obj->zip; // TODO deprecated $this->cp = $obj->zip; // TODO deprecated
$this->zip = $obj->zip; $this->zip = $obj->zip;
$this->ville = $obj->town; // TODO deprecated $this->ville = $obj->town; // TODO deprecated

View File

@ -383,7 +383,7 @@ else
}); });
$("#copyaddressfromsoc").click(function() { $("#copyaddressfromsoc").click(function() {
$(\'textarea[name="address"]\').text("'.dol_escape_js($objsoc->address).'"); $(\'textarea[name="address"]\').val("'.dol_escape_js($objsoc->address).'");
$(\'input[name="zipcode"]\').val("'.dol_escape_js($objsoc->zip).'"); $(\'input[name="zipcode"]\').val("'.dol_escape_js($objsoc->zip).'");
$(\'input[name="town"]\').val("'.dol_escape_js($objsoc->town).'"); $(\'input[name="town"]\').val("'.dol_escape_js($objsoc->town).'");
$(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'"); $(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'");

View File

@ -1020,7 +1020,7 @@ class CMailFile
/** /**
* Return an address for SMTP protocol * Return an address for SMTP protocol
* *
* @param string $adresses Example: 'John Doe <john@doe.com>' or 'john@doe.com' * @param string $address Example: 'John Doe <john@doe.com>' or 'john@doe.com'
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between " * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between "
* @param int $encode 1=Encode name to RFC2822 * @param int $encode 1=Encode name to RFC2822
* @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>' * @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>'
@ -1028,13 +1028,13 @@ class CMailFile
* If format 2: 'john@doe.com' * If format 2: 'john@doe.com'
* If format 3: '<john@doe.com>' or '"John Doe" <john@doe.com>' or '"=?UTF-8?B?Sm9obiBEb2U=?=" <john@doe.com>' * If format 3: '<john@doe.com>' or '"John Doe" <john@doe.com>' or '"=?UTF-8?B?Sm9obiBEb2U=?=" <john@doe.com>'
*/ */
function getValidAddress($adresses,$format,$encode='') function getValidAddress($address,$format,$encode='')
{ {
global $conf; global $conf;
$ret=''; $ret='';
$arrayaddress=explode(',',$adresses); $arrayaddress=explode(',',$address);
// Boucle sur chaque composant de l'adresse // Boucle sur chaque composant de l'adresse
foreach($arrayaddress as $val) foreach($arrayaddress as $val)

View File

@ -964,7 +964,7 @@ abstract class CommonObject
*/ */
function setDeliveryAddress($id) function setDeliveryAddress($id)
{ {
$fieldname = 'fk_adresse_livraison'; $fieldname = 'fk_delivery_address';
if ($this->element == 'delivery' || $this->element == 'shipping') $fieldname = 'fk_address'; if ($this->element == 'delivery' || $this->element == 'shipping') $fieldname = 'fk_address';
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ".$fieldname." = ".$id; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ".$fieldname." = ".$id;
@ -1023,7 +1023,7 @@ abstract class CommonObject
/** /**
* Save a new position (field rang) for details lines. * Save a new position (field rang) for details lines.
* You can choose to ser position for lines with already a position or lines wihtout any position defined. * You can choose to set position for lines with already a position or lines without any position defined.
* Call this function only for table that contains a field fk_parent_line. * Call this function only for table that contains a field fk_parent_line.
* *
* @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines. * @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines.
@ -1064,7 +1064,7 @@ abstract class CommonObject
// counter that parents. // counter that parents.
$rows=array(); $rows=array();
// We frist search all lines that are parent lines (for multilevel details lines) // We first search all lines that are parent lines (for multilevel details lines)
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id; $sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
$sql.= ' AND fk_parent_line IS NULL'; $sql.= ' AND fk_parent_line IS NULL';
@ -1080,10 +1080,10 @@ abstract class CommonObject
{ {
$row = $this->db->fetch_row($resql); $row = $this->db->fetch_row($resql);
$rows[] = $row[0]; // Add parent line into array rows $rows[] = $row[0]; // Add parent line into array rows
$childrens = $this->getChildrensOfLine($row[0]); $childrens = $this->getChildrenOfLine($row[0]);
if (! empty($childrens)) if (! empty($children))
{ {
foreach($childrens as $child) foreach($children as $child)
{ {
array_push($rows, $child); array_push($rows, $child);
} }
@ -1108,12 +1108,12 @@ abstract class CommonObject
} }
/** /**
* Get childrens of line * Get children of line
* *
* @param int $id Id of parent line * @param int $id Id of parent line
* @return array Array with list of child lines id * @return array Array with list of children lines id
*/ */
function getChildrensOfLine($id) function getChildrenOfLine($id)
{ {
$rows=array(); $rows=array();
@ -1122,7 +1122,7 @@ abstract class CommonObject
$sql.= ' AND fk_parent_line = '.$id; $sql.= ' AND fk_parent_line = '.$id;
$sql.= ' ORDER BY rang ASC'; $sql.= ' ORDER BY rang ASC';
dol_syslog(get_class($this)."::getChildrenOfLines search children lines for line ".$id." sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id." sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -968,10 +968,10 @@ class Form
* @param int $disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param array $include Array list of users id to include * @param array $include Array list of users id to include
* @param int $enableonly Array list of users id to be enabled. All other must be disabled * @param int $enableonly Array list of users id to be enabled. All other must be disabled
* @param int $force_entity Possibility to force entity * @param int $force_entity 0 or Id of environment to force
* @return void * @return void
*/ */
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=false) function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
{ {
print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity); print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity);
} }
@ -986,10 +986,10 @@ class Form
* @param int $disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param array $include Array list of users id to include * @param array $include Array list of users id to include
* @param int $enableonly Array list of users id to be enabled. All other must be disabled * @param int $enableonly Array list of users id to be enabled. All other must be disabled
* @param int $force_entity Possibility to force entity * @param int $force_entity 0 or Id of environment to force
* @return string HTML select string * @return string HTML select string
*/ */
function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=false) function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -3953,10 +3953,10 @@ class Form
* @param int $disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param string $include Array list of groups id to include * @param string $include Array list of groups id to include
* @param int $enableonly Array list of groups id to be enabled. All other must be disabled * @param int $enableonly Array list of groups id to be enabled. All other must be disabled
* @param int $force_entity Possibility to force entity * @param int $force_entity 0 or Id of environment to force
* @return void * @return void
*/ */
function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='') function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;

View File

@ -144,7 +144,7 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->zip,$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_VILLE__',$mysoc->town,$form);
$form = str_replace('__DONATOR_NAME__',$don->nom,$form); $form = str_replace('__DONATOR_NAME__',$don->nom,$form);
$form = str_replace('__DONATOR_ADDRESS__',$don->adresse,$form); $form = str_replace('__DONATOR_ADDRESS__',$don->address,$form);
$form = str_replace('__DONATOR_ZIP__',$don->cp,$form); $form = str_replace('__DONATOR_ZIP__',$don->cp,$form);
$form = str_replace('__DONATOR_TOWN__',$don->ville,$form); $form = str_replace('__DONATOR_TOWN__',$don->ville,$form);
$form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form); $form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form);

View File

@ -172,9 +172,9 @@ class modAdherent extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='MembersAndSubscriptions'; $this->export_label[$r]='MembersAndSubscriptions';
$this->export_permission[$r]=array(array("adherent","export")); $this->export_permission[$r]=array(array("adherent","export"));
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount'); $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
$this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.nom'=>"Text",'a.prenom'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.adresse'=>"Text",'a.cp'=>"Text",'a.ville'=>"Text",'a.pays'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.naiss'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number'); $this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.nom'=>"Text",'a.prenom'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.cp'=>"Text",'a.ville'=>"Text",'a.pays'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.naiss'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
// Add extra fields // Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'"; $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -207,7 +207,7 @@ class modAdherent extends DolibarrModules
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('a'=>MAIN_DB_PREFIX.'adherent','extra'=>MAIN_DB_PREFIX.'adherent_extrafields'); $this->import_tables_array[$r]=array('a'=>MAIN_DB_PREFIX.'adherent','extra'=>MAIN_DB_PREFIX.'adherent_extrafields');
$this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id $this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id
$this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.nom'=>"Lastname*",'a.prenom'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription'); $this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.nom'=>"Lastname*",'a.prenom'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
// Add extra fields // Add extra fields
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'"; $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -223,7 +223,7 @@ class modAdherent extends DolibarrModules
// End add extra fields // End add extra fields
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r]=array('a.civilite'=>'code@'.MAIN_DB_PREFIX.'c_civilite','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('a.civilite'=>'code@'.MAIN_DB_PREFIX.'c_civilite','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('a.civilite'=>"MR",'a.nom'=>'Smith','a.prenom'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.adresse'=>'21 jump street','a.cp'=>'55000','a.ville'=>'New York','a.pays'=>'1','a.email'=>'jsmith@example.com','a.naiss'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d')); $this->import_examplevalues_array[$r]=array('a.civilite'=>"MR",'a.nom'=>'Smith','a.prenom'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.cp'=>'55000','a.ville'=>'New York','a.pays'=>'1','a.email'=>'jsmith@example.com','a.naiss'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
} }

View File

@ -675,7 +675,7 @@ class Expedition extends CommonObject
if (isset($this->socid)) $this->socid=trim($this->socid); if (isset($this->socid)) $this->socid=trim($this->socid);
if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author); if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author);
if (isset($this->fk_user_valid)) $this->fk_user_valid=trim($this->fk_user_valid); if (isset($this->fk_user_valid)) $this->fk_user_valid=trim($this->fk_user_valid);
if (isset($this->fk_adresse_livraison)) $this->fk_adresse_livraison=trim($this->fk_adresse_livraison); if (isset($this->fk_delivery_address)) $this->fk_delivery_address=trim($this->fk_delivery_address);
if (isset($this->expedition_method_id)) $this->expedition_method_id=trim($this->expedition_method_id); if (isset($this->expedition_method_id)) $this->expedition_method_id=trim($this->expedition_method_id);
if (isset($this->tracking_number)) $this->tracking_number=trim($this->tracking_number); if (isset($this->tracking_number)) $this->tracking_number=trim($this->tracking_number);
if (isset($this->statut)) $this->statut=trim($this->statut); if (isset($this->statut)) $this->statut=trim($this->statut);
@ -706,7 +706,7 @@ class Expedition extends CommonObject
$sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").","; $sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").",";
$sql.= " date_expedition=".(dol_strlen($this->date_expedition)!=0 ? "'".$this->db->idate($this->date_expedition)."'" : 'null').","; $sql.= " date_expedition=".(dol_strlen($this->date_expedition)!=0 ? "'".$this->db->idate($this->date_expedition)."'" : 'null').",";
$sql.= " date_delivery=".(dol_strlen($this->date_delivery)!=0 ? "'".$this->db->idate($this->date_delivery)."'" : 'null').","; $sql.= " date_delivery=".(dol_strlen($this->date_delivery)!=0 ? "'".$this->db->idate($this->date_delivery)."'" : 'null').",";
$sql.= " fk_address=".(isset($this->fk_adresse_livraison)?$this->fk_adresse_livraison:"null").","; $sql.= " fk_address=".(isset($this->fk_delivery_address)?$this->fk_delivery_address:"null").",";
$sql.= " fk_expedition_methode=".((isset($this->expedition_method_id) && $this->expedition_method_id > 0)?$this->expedition_method_id:"null").","; $sql.= " fk_expedition_methode=".((isset($this->expedition_method_id) && $this->expedition_method_id > 0)?$this->expedition_method_id:"null").",";
$sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").","; $sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").",";
$sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").",";
@ -909,8 +909,8 @@ class Expedition extends CommonObject
$line->volume = $obj->volume; $line->volume = $obj->volume;
$line->volume_units = $obj->volume_units; $line->volume_units = $obj->volume_units;
//Invoicing // For invoicing
$line->desc = $obj->product_label; $line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements)
$line->qty = $obj->qty_shipped; $line->qty = $obj->qty_shipped;
$line->total_ht = $obj->total_ht; $line->total_ht = $obj->total_ht;
$line->total_localtax1 = $obj->total_localtax1; $line->total_localtax1 = $obj->total_localtax1;

View File

@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
$langs->load('users');
$langs->load('holidays');
// Protection if external user // Protection if external user
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
@ -46,6 +51,8 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$id = GETPOST('id');
$search_ref = GETPOST('search_ref'); $search_ref = GETPOST('search_ref');
$month_create = GETPOST('month_create'); $month_create = GETPOST('month_create');
$year_create = GETPOST('year_create'); $year_create = GETPOST('year_create');
@ -72,6 +79,7 @@ $search_statut = GETPOST('select_statut');
$holiday = new Holiday($db); $holiday = new Holiday($db);
$holidaystatic=new Holiday($db); $holidaystatic=new Holiday($db);
$fuser = new User($db);
// Update sold // Update sold
$holiday->updateSold(); $holiday->updateSold();
@ -151,8 +159,15 @@ if(!empty($search_statut) && $search_statut != -1) {
// Récupération de l'ID de l'utilisateur // Récupération de l'ID de l'utilisateur
$user_id = $user->id; $user_id = $user->id;
if ($id > 0)
{
// Charge utilisateur edite
$fuser->fetch($id);
$fuser->getrights();
$user_id = $fuser->id;
}
// Récupération des congés payés de l'utilisateur ou de tous les users // Récupération des congés payés de l'utilisateur ou de tous les users
if (!$user->rights->holiday->lire_tous) if (!$user->rights->holiday->lire_tous || $id > 0)
{ {
$holiday_payes = $holiday->fetchByUser($user_id,$order,$filter); $holiday_payes = $holiday->fetchByUser($user_id,$order,$filter);
} }
@ -160,19 +175,6 @@ else
{ {
$holiday_payes = $holiday->fetchAll($order,$filter); $holiday_payes = $holiday->fetchAll($order,$filter);
} }
// Si pas de congés payés
if ($holiday_payes == 0)
{
print_fiche_titre($langs->trans('CPTitreMenu'));
print '<div class="tabBar">';
print '<span>'.$langs->trans('NoCPforUser').'<br /><br />';
print '<a href="./fiche.php?mainmenu=agenda&action=request" class="butAction">'.$langs->trans('AddCP').'</a></span>';
print '</div>';
exit();
}
// Si erreur SQL // Si erreur SQL
if ($holiday_payes == '-1') if ($holiday_payes == '-1')
{ {
@ -190,13 +192,47 @@ if ($holiday_payes == '-1')
*************************************/ *************************************/
$var=true; $num = count($holiday->holiday); $var=true; $num = count($holiday->holiday);
$html = new Form($db); $form = new Form($db);
$htmlother = new FormOther($db); $formother = new FormOther($db);
if ($id > 0)
{
$head = user_prepare_head($fuser);
$title = $langs->trans("User");
dol_fiche_head($head, 'paidholidays', $title, 0, 'user');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
print '<td colspan="2">';
print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
print '</td>';
print '</tr>';
// Nom
print '<tr><td width="25%" valign="top">'.$langs->trans("LastName").'</td>';
print '<td colspan="2">'.$fuser->lastname.'</td>';
print "</tr>\n";
// Prenom
print '<tr><td width="25%" valign="top">'.$langs->trans("FirstName").'</td>';
print '<td colspan="2">'.$fuser->firstname.'</td>';
print "</tr>\n";
print '</table><br>';
}
else
{
print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num);
print '<div class="tabBar">'; print '<div class="tabBar">';
}
$nbaquis=$holiday->getCPforUser($user->id);
$nbaquis=$holiday->getCPforUser($user_id);
$nbdeduced=$holiday->getConfCP('nbHolidayDeducted'); $nbdeduced=$holiday->getConfCP('nbHolidayDeducted');
$nb_holiday = $nbaquis / $nbdeduced; $nb_holiday = $nbaquis / $nbdeduced;
print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : ''); print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : '');
@ -223,13 +259,13 @@ print '<input class="flat" size="4" type="text" name="search_ref" value="'.$sear
// DATE CREATE // DATE CREATE
print '<td class="liste_titre" colspan="1" align="center">'; print '<td class="liste_titre" colspan="1" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_create" value="'.$month_create.'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_create" value="'.$month_create.'">';
$htmlother->select_year($year_create,'year_create',1, $min_year, $max_year); $formother->select_year($year_create,'year_create',1, $min_year, $max_year);
print '</td>'; print '</td>';
// UTILISATEUR // UTILISATEUR
if($user->rights->holiday->lire_tous) { if($user->rights->holiday->lire_tous) {
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
$html->select_users($search_employe,"search_employe",1,"",0,''); $form->select_users($search_employe,"search_employe",1,"",0,'');
print '</td>'; print '</td>';
} else { } else {
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
@ -246,7 +282,7 @@ if($user->rights->holiday->lire_tous){
$validator = new UserGroup($db,$idGroupValid); $validator = new UserGroup($db,$idGroupValid);
$valideur = $validator->listUsersForGroup(); $valideur = $validator->listUsersForGroup();
$html->select_users($search_valideur,"search_valideur",1,"",0,$valideur,''); $form->select_users($search_valideur,"search_valideur",1,"",0,$valideur,'');
print '</td>'; print '</td>';
} else { } else {
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
@ -255,13 +291,13 @@ if($user->rights->holiday->lire_tous){
// DATE DEBUT // DATE DEBUT
print '<td class="liste_titre" colspan="1" align="center">'; print '<td class="liste_titre" colspan="1" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.$month_start.'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.$month_start.'">';
$htmlother->select_year($year_start,'year_start',1, $min_year, $max_year); $formother->select_year($year_start,'year_start',1, $min_year, $max_year);
print '</td>'; print '</td>';
// DATE FIN // DATE FIN
print '<td class="liste_titre" colspan="1" align="center">'; print '<td class="liste_titre" colspan="1" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
$htmlother->select_year($year_end,'year_end',1, $min_year, $max_year); $formother->select_year($year_end,'year_end',1, $min_year, $max_year);
print '</td>'; print '</td>';
// DUREE // DUREE
@ -327,10 +363,13 @@ if($holiday_payes == '2')
print '</table>'; print '</table>';
print '</form>'; print '</form>';
if ($user_id == $user->id)
{
print '<br>'; print '<br>';
print '<div style="float: right; margin-top: 8px;">'; print '<div style="float: right; margin-top: 8px;">';
print '<a href="./fiche.php?action=request" class="butAction">'.$langs->trans('AddCP').'</a>'; print '<a href="./fiche.php?action=request" class="butAction">'.$langs->trans('AddCP').'</a>';
print '</div>'; print '</div>';
}
llxFooter(); llxFooter();

View File

@ -67,6 +67,10 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 2
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '7','0','VAT standard rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '7','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '0','0','VAT Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '0','0','VAT Rate 0',1);
-- CAMEROUN (id country=24)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '19.25','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '0','0','VAT Rate 0',1);
-- CHILE (id country=67) -- CHILE (id country=67)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '19','0','VAT standard rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '19','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '0','0','VAT Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '0','0','VAT Rate 0',1);
@ -151,6 +155,10 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (17
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT standard rate', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT standard rate', 1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1663, 166, '0','0','VAT Rate 0', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1663, 166, '0','0','VAT Rate 0', 1);
-- NIGERIA (id country=169)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT standard rate', 1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1693, 169, '0','0','VAT Rate 0', 1);
-- NORWAY (id country=173) -- NORWAY (id country=173)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '25','0','VAT standard rate', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '25','0','VAT standard rate', 1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT reduced rate', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT reduced rate', 1);

View File

@ -38,4 +38,10 @@ alter table llx_contratdet add column fk_product_fournisseur_price integer after
alter table llx_contratdet add column buy_price_ht double(24,8) DEFAULT 0 after fk_product_fournisseur_price; alter table llx_contratdet add column buy_price_ht double(24,8) DEFAULT 0 after fk_product_fournisseur_price;
-- serialised array, to store value of select list choices for example -- serialised array, to store value of select list choices for example
alter table llx_extrafields add column param text DEFAULT '' after pos; alter table llx_extrafields add column param text after pos;
alter table llx_propal CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer;
alter table llx_commande CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer;
alter table llx_don CHANGE COLUMN adresse address text;

View File

@ -39,7 +39,7 @@ create table llx_adherent
morphy varchar(3) NOT NULL, -- personne morale / personne physique morphy varchar(3) NOT NULL, -- personne morale / personne physique
societe varchar(50), societe varchar(50),
fk_soc integer NULL, -- Link to third party linked to member fk_soc integer NULL, -- Link to third party linked to member
adresse text, address text,
cp varchar(30), cp varchar(30),
ville varchar(50), ville varchar(50),
fk_departement integer, fk_departement integer,

View File

@ -63,7 +63,7 @@ create table llx_commande
date_livraison date default NULL, date_livraison date default NULL,
fk_availability integer NULL, fk_availability integer NULL,
fk_input_reason integer, fk_input_reason integer,
fk_adresse_livraison integer, -- delivery address (deprecated) fk_delivery_address integer, -- delivery address (deprecated)
import_key varchar(14), import_key varchar(14),
extraparams varchar(255) -- for stock other parameters with json format extraparams varchar(255) -- for stock other parameters with json format

View File

@ -33,7 +33,7 @@ create table llx_don
prenom varchar(50), prenom varchar(50),
nom varchar(50), nom varchar(50),
societe varchar(50), societe varchar(50),
adresse text, address text,
cp varchar(30), cp varchar(30),
ville varchar(50), ville varchar(50),
pays varchar(50), pays varchar(50),

View File

@ -65,6 +65,6 @@ create table llx_propal
fk_input_reason integer, fk_input_reason integer,
import_key varchar(14), import_key varchar(14),
extraparams varchar(255), -- for stock other parameters with json format extraparams varchar(255), -- for stock other parameters with json format
fk_adresse_livraison integer -- delivery address (deprecated) fk_delivery_address integer -- delivery address (deprecated)
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -26,7 +26,7 @@ SendRequestCP=Creating demand for holidays
DelayToRequestCP=Applications for holidays must be made at least <b>%s day(s)</b> before them. DelayToRequestCP=Applications for holidays must be made at least <b>%s day(s)</b> before them.
MenuConfCP=Edit balance of holidays MenuConfCP=Edit balance of holidays
UpdateAllCP=Update the holidays UpdateAllCP=Update the holidays
SoldeCPUser=Your balance of holidays is <b>%s</b> days. SoldeCPUser=Holidays balance is <b>%s</b> days.
ErrorEndDateCP=You must select an end date greater than the start date. ErrorEndDateCP=You must select an end date greater than the start date.
ErrorSQLCreateCP=An SQL error occurred during the creation: ErrorSQLCreateCP=An SQL error occurred during the creation:
ErrorIDFicheCP=An error has occurred, the request for holidays does not exist. ErrorIDFicheCP=An error has occurred, the request for holidays does not exist.

View File

@ -283,7 +283,7 @@ GenericMaskCodes3= Tout autre caractère dans le masque sera laissé inchangé.<
GenericMaskCodes4a= <u>Exemple sur la 99eme %s du tiers LaCompanie faite le 31/03/2007:</u><br> GenericMaskCodes4a= <u>Exemple sur la 99eme %s du tiers LaCompanie faite le 31/03/2007:</u><br>
GenericMaskCodes4b= <u>Exemple sur un tiers créé le 31/03/2007:</u><br> GenericMaskCodes4b= <u>Exemple sur un tiers créé le 31/03/2007:</u><br>
GenericMaskCodes4c= <u>Exemple sur un produit/service créé le 31/03/2007:</u><br> GenericMaskCodes4c= <u>Exemple sur un produit/service créé le 31/03/2007:</u><br>
GenericMaskCodes5= <b>ABC{yy}{mm}-{000000}</b> donnera <b>ABC0703-000099</b><br><b>{0000+100}-XXX/{dd}/YYY</b> donnera <b>0199-XXX/31/YYY</b> GenericMaskCodes5= <b>ABC{yy}{mm}-{000000}</b> donnera <b>ABC0703-000099</b><br><b>{0000+100}-XXX-{dd}-YYY</b> donnera <b>0199-XXX-31-YYY</b>
GenericNumRefModelDesc= Renvoie un numéro personnalisable selon un masque à définir. GenericNumRefModelDesc= Renvoie un numéro personnalisable selon un masque à définir.
ServerAvailableOnIPOrPort= Serveur disponible à l'adresse <b>%s</b> sur le port <b>%s</b> ServerAvailableOnIPOrPort= Serveur disponible à l'adresse <b>%s</b> sur le port <b>%s</b>
ServerNotAvailableOnIPOrPort= Serveur non disponible à l'adresse <b>%s</b> sur le port <b>%s</b> ServerNotAvailableOnIPOrPort= Serveur non disponible à l'adresse <b>%s</b> sur le port <b>%s</b>

View File

@ -26,7 +26,7 @@ SendRequestCP=Envoyer la demande de congés
DelayToRequestCP=Les demandes de congés doivent être faites au moins <b>%s jours</b> avant la date</b> de ceux-ci. DelayToRequestCP=Les demandes de congés doivent être faites au moins <b>%s jours</b> avant la date</b> de ceux-ci.
MenuConfCP=Mettre à jour solde MenuConfCP=Mettre à jour solde
UpdateAllCP=Mettre à jour les congés UpdateAllCP=Mettre à jour les congés
SoldeCPUser=Votre solde de congés est de <b>%s jours</b>. SoldeCPUser=Solde de congés: <b>%s jours</b>.
ErrorEndDateCP=Vous devez choisir une date de fin supérieur à la date de début. ErrorEndDateCP=Vous devez choisir une date de fin supérieur à la date de début.
ErrorSQLCreateCP=Une erreur SQL est survenue durant la création : ErrorSQLCreateCP=Une erreur SQL est survenue durant la création :
ErrorIDFicheCP=Une erreur est survenue, cette demande de congés n'existe pas. ErrorIDFicheCP=Une erreur est survenue, cette demande de congés n'existe pas.

View File

@ -2185,10 +2185,10 @@ class Product extends CommonObject
$this->res[]= array($compl_path.$nom_pere,$desc_pere); $this->res[]= array($compl_path.$nom_pere,$desc_pere);
} }
// Recursive call // Recursive call if child is an array
if (is_array($desc_pere)>2) if (is_array($desc_pere[0]))
{ {
$this ->fetch_prod_arbo($desc_pere, $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1); $this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1);
} }
} }
} }

View File

@ -154,13 +154,13 @@ class User extends CommonObject
$sql.= " u.ref_int, u.ref_ext"; $sql.= " u.ref_int, u.ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) if ((empty($conf->multicompany->enabled) || empty($conf->multicompany->transverse_mode)) && (! empty($user->entity)))
{ {
$sql.= " WHERE u.entity IS NOT NULL"; $sql.= " WHERE u.entity IN (0,".$conf->entity.")";
} }
else else
{ {
$sql.= " WHERE u.entity IN (0,".$conf->entity.")"; $sql.= " WHERE u.entity IS NOT NULL";
} }
if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba

View File

@ -819,21 +819,6 @@ if (($action == 'create') || ($action == 'adduserldap'))
print "</td></tr>\n"; print "</td></tr>\n";
} }
//Multicompany
if (! empty($conf->multicompany->enabled))
{
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
print "<tr>".'<td valign="top">'.$langs->trans("Entity").'</td>';
print "<td>".$mc->select_entities($conf->entity);
print "</td></tr>\n";
}
else
{
print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
}
}
// Type // Type
print '<tr><td valign="top">'.$langs->trans("Type").'</td>'; print '<tr><td valign="top">'.$langs->trans("Type").'</td>';
print '<td>'; print '<td>';
@ -902,6 +887,28 @@ if (($action == 'create') || ($action == 'adduserldap'))
print '<textarea rows="'.ROWS_5.'" cols="90" name="signature">'.GETPOST('signature').'</textarea>'; print '<textarea rows="'.ROWS_5.'" cols="90" name="signature">'.GETPOST('signature').'</textarea>';
print '</td></tr>'; print '</td></tr>';
// Multicompany
if (! empty($conf->multicompany->enabled))
{
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
print "<tr>".'<td valign="top">'.$langs->trans("Entity").'</td>';
print "<td>".$mc->select_entities($conf->entity);
print "</td></tr>\n";
}
else
{
print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
}
}
// Hierarchy
print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>';
print '<td>';
print $form->select_dolusers($object->fk_user,'fk_user',1,array($object->id),0,'',0,$conf->entity);
print '</td>';
print "</tr>\n";
// Note // Note
print '<tr><td valign="top">'; print '<tr><td valign="top">';
print $langs->trans("Note"); print $langs->trans("Note");
@ -941,7 +948,7 @@ else
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
if ($id) if ($id > 0)
{ {
$object->fetch($id); $object->fetch($id);
if ($res < 0) { dol_print_error($db,$object->error); exit; } if ($res < 0) { dol_print_error($db,$object->error); exit; }
@ -1201,7 +1208,7 @@ else
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Statut // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>'; print '<td>';
print $object->getLibStatut(4); print $object->getLibStatut(4);
@ -1315,7 +1322,7 @@ else
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($caneditfield && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
{ {
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
{ {
@ -1327,7 +1334,7 @@ else
} }
} }
elseif ($caneditpassword && ! $object->ldap_sid && elseif ($caneditpassword && ! $object->ldap_sid &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("EditPassword").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("EditPassword").'</a>';
} }
@ -1808,11 +1815,11 @@ else
// Hierarchy // Hierarchy
print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>'; print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>';
print '<td>'; print '<td>';
print $form->select_dolusers($object->fk_user,'fk_user',1,array($object->id)); print $form->select_dolusers($object->fk_user,'fk_user',1,array($object->id),0,'',0,$object->entity);
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Statut // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>'; print '<td>';
print $object->getLibStatut(4); print $object->getLibStatut(4);