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

This commit is contained in:
Laurent Destailleur 2018-09-18 15:18:16 +02:00
commit b67392b016
34 changed files with 432 additions and 477 deletions

View File

@ -1166,58 +1166,58 @@ class ActionComm extends CommonObject
if ($mode == 0)
{
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable');
else if ($percent==0) return $langs->trans('StatusActionToDo').' (0%)';
else if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%)';
else if ($percent >= 100) return $langs->trans('StatusActionDone').' (100%)';
elseif ($percent==0) return $langs->trans('StatusActionToDo').' (0%)';
elseif ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%)';
elseif ($percent >= 100) return $langs->trans('StatusActionDone').' (100%)';
}
else if ($mode == 1)
elseif ($mode == 1)
{
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable');
else if ($percent==0) return $langs->trans('StatusActionToDo');
else if ($percent > 0 && $percent < 100) return $percent.'%';
else if ($percent >= 100) return $langs->trans('StatusActionDone');
elseif ($percent==0) return $langs->trans('StatusActionToDo');
elseif ($percent > 0 && $percent < 100) return $percent.'%';
elseif ($percent >= 100) return $langs->trans('StatusActionDone');
}
else if ($mode == 2)
elseif ($mode == 2)
{
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable');
else if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo');
else if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '. $percent.'%';
else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone');
elseif ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo');
elseif ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '. $percent.'%';
elseif ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone');
}
else if ($mode == 3)
elseif ($mode == 3)
{
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans("Status").': '.$langs->trans('StatusNotApplicable'),'statut9');
else if ($percent==0) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionToDo').' (0%)','statut1');
else if ($percent > 0 && $percent < 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)','statut3');
else if ($percent >= 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionDone').' (100%)','statut6');
elseif ($percent==0) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionToDo').' (0%)','statut1');
elseif ($percent > 0 && $percent < 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)','statut3');
elseif ($percent >= 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionDone').' (100%)','statut6');
}
else if ($mode == 4)
elseif ($mode == 4)
{
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable');
else if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo').' (0%)';
else if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)';
else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone').' (100%)';
elseif ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo').' (0%)';
elseif ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)';
elseif ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone').' (100%)';
}
else if ($mode == 5)
elseif ($mode == 5)
{
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9');
else if ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
else if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
else if ($percent >= 100) return $langs->trans('StatusActionDone').' '.img_picto($langs->trans('StatusActionDone'),'statut6');
elseif ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
elseif ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
elseif ($percent >= 100) return $langs->trans('StatusActionDone').' '.img_picto($langs->trans('StatusActionDone'),'statut6');
}
else if ($mode == 6)
elseif ($mode == 6)
{
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable').' '.img_picto($langs->trans('StatusNotApplicable'),'statut9');
else if ($percent==0) return $langs->trans('StatusActionToDo').' (0%) '.img_picto($langs->trans('StatusActionToDo'),'statut1');
else if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%) '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
else if ($percent >= 100) return $langs->trans('StatusActionDone').' (100%) '.img_picto($langs->trans('StatusActionDone'),'statut6');
elseif ($percent==0) return $langs->trans('StatusActionToDo').' (0%) '.img_picto($langs->trans('StatusActionToDo'),'statut1');
elseif ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%) '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
elseif ($percent >= 100) return $langs->trans('StatusActionDone').' (100%) '.img_picto($langs->trans('StatusActionDone'),'statut6');
}
else if ($mode == 7)
elseif ($mode == 7)
{
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9');
else if ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
else if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6');
elseif ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
elseif ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
elseif ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6');
}
return '';
@ -1564,8 +1564,8 @@ class ActionComm extends CommonObject
// Write file
if ($format == 'vcal') $result=build_calfile($format,$title,$desc,$eventarray,$outputfiletmp);
if ($format == 'ical') $result=build_calfile($format,$title,$desc,$eventarray,$outputfiletmp);
if ($format == 'rss') $result=build_rssfile($format,$title,$desc,$eventarray,$outputfiletmp);
elseif ($format == 'ical') $result=build_calfile($format,$title,$desc,$eventarray,$outputfiletmp);
elseif ($format == 'rss') $result=build_rssfile($format,$title,$desc,$eventarray,$outputfiletmp);
if ($result >= 0)
{

View File

@ -189,32 +189,32 @@ class ActionCommReminder extends CommonObject
if ($mode == 0 || $mode == 1)
{
if ($status == 1) return $langs->trans('Done');
if ($status == 0) return $langs->trans('ToDo');
elseif ($status == 0) return $langs->trans('ToDo');
}
elseif ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Done'),'statut4').' '.$langs->trans('Done');
if ($status == 0) return img_picto($langs->trans('ToDo'),'statut5').' '.$langs->trans('ToDo');
elseif ($status == 0) return img_picto($langs->trans('ToDo'),'statut5').' '.$langs->trans('ToDo');
}
elseif ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Done'),'statut4');
if ($status == 0) return img_picto($langs->trans('ToDo'),'statut5');
elseif ($status == 0) return img_picto($langs->trans('ToDo'),'statut5');
}
elseif ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Done'),'statut4').' '.$langs->trans('Done');
if ($status == 0) return img_picto($langs->trans('ToDo'),'statut5').' '.$langs->trans('ToDo');
elseif ($status == 0) return img_picto($langs->trans('ToDo'),'statut5').' '.$langs->trans('ToDo');
}
elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Done').' '.img_picto($langs->trans('Done'),'statut4');
if ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'),'statut5');
elseif ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'),'statut5');
}
elseif ($mode == 6)
{
if ($status == 1) return $langs->trans('Done').' '.img_picto($langs->trans('Done'),'statut4');
if ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'),'statut5');
elseif ($status == 0) return $langs->trans('ToDo').' '.img_picto($langs->trans('ToDo'),'statut5');
}
}

View File

@ -135,18 +135,17 @@ class PaymentTerm // extends CommonObject
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_payment_term");
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger) {
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback
@ -311,21 +310,16 @@ class PaymentTerm // extends CommonObject
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $error && ! $notrigger) {
// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
// End call triggers
}
}
//}
// Commit or rollback
if ($error)
@ -367,21 +361,16 @@ class PaymentTerm // extends CommonObject
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $error && ! $notrigger) {
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
}
//}
// Commit or rollback
if ($error)
@ -439,12 +428,9 @@ class PaymentTerm // extends CommonObject
$error++;
}
if (! $error)
{
}
//if (! $error)
//{
//}
unset($this->context['createfromclone']);

View File

@ -77,31 +77,18 @@ class Cchargesociales
$error = 0;
// Clean parameters
if (isset($this->libelle)) {
$this->libelle = trim($this->libelle);
}
if (isset($this->deductible)) {
$this->deductible = trim($this->deductible);
}
if (isset($this->active)) {
$this->active = trim($this->active);
}
if (isset($this->code)) {
$this->code = trim($this->code);
}
if (isset($this->fk_pays)) {
$this->fk_pays = trim($this->fk_pays);
}
if (isset($this->module)) {
$this->module = trim($this->module);
}
if (isset($this->accountancy_code)) {
$this->accountancy_code = trim($this->accountancy_code);
}
// Clean parameters
$this->trimParameters(
array(
'libelle',
'deductible',
'active',
'code',
'fk_pays',
'module',
'accountancy_code',
)
);
// Check parameters
// Put here code to add control on parameters values
@ -143,7 +130,7 @@ class Cchargesociales
if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
if (!$notrigger) {
//if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
@ -151,7 +138,7 @@ class Cchargesociales
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) $error++;
//// End call triggers
}
//}
}
// Commit or rollback
@ -243,28 +230,17 @@ class Cchargesociales
// Clean parameters
if (isset($this->libelle)) {
$this->libelle = trim($this->libelle);
}
if (isset($this->deductible)) {
$this->deductible = trim($this->deductible);
}
if (isset($this->active)) {
$this->active = trim($this->active);
}
if (isset($this->code)) {
$this->code = trim($this->code);
}
if (isset($this->fk_pays)) {
$this->fk_pays = trim($this->fk_pays);
}
if (isset($this->module)) {
$this->module = trim($this->module);
}
if (isset($this->accountancy_code)) {
$this->accountancy_code = trim($this->accountancy_code);
}
$this->trimParameters(
array(
'libelle',
'deductible',
'active',
'code',
'fk_pays',
'module',
'accountancy_code',
)
);
// Check parameters
@ -290,7 +266,7 @@ class Cchargesociales
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (!$error && !$notrigger) {
//if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -298,7 +274,7 @@ class Cchargesociales
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
//}
// Commit or rollback
if ($error) {
@ -328,8 +304,8 @@ class Cchargesociales
$this->db->begin();
if (!$error) {
if (!$notrigger) {
//if (!$error) {
//if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -337,8 +313,8 @@ class Cchargesociales
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
//}
//}
if (!$error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
@ -476,34 +452,33 @@ class Cchargesociales
if ($mode == 0)
{
$prefix='';
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
elseif ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
elseif ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
}
}

View File

@ -430,8 +430,9 @@ class ChargeSociales extends CommonObject
{
// phpcs:enable
global $langs;
$langs->load('customers');
$langs->load('bills');
// Load translation files required by the page
$langs->loadLangs(array("customers","bills"));
if ($mode == 0 || $mode == 1)
{

View File

@ -100,7 +100,7 @@ class Contact extends CommonObject
public $state_code; // Code of department
public $state; // Label of department
public $poste; // Position
public $poste; // Position
public $socid; // fk_soc
public $statut; // 0=inactif, 1=actif
@ -493,8 +493,8 @@ class Contact extends CommonObject
global $conf;
$dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN;
if ($mode==1) $dn=$conf->global->LDAP_CONTACT_DN;
if ($mode==2) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS];
elseif ($mode==1) $dn=$conf->global->LDAP_CONTACT_DN;
elseif ($mode==2) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS];
return $dn;
}
@ -508,12 +508,12 @@ class Contact extends CommonObject
function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
global $conf, $langs;
$info = array();
// Object classes
$info["objectclass"]=explode(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS);
$info["objectclass"]=explode(',', $conf->global->LDAP_CONTACT_OBJECT_CLASS);
$this->fullname=$this->getFullName($langs);
@ -887,9 +887,9 @@ class Contact extends CommonObject
if ($obj->nb)
{
if ($obj->element=='facture') $this->ref_facturation = $obj->nb;
if ($obj->element=='contrat') $this->ref_contrat = $obj->nb;
if ($obj->element=='commande') $this->ref_commande = $obj->nb;
if ($obj->element=='propal') $this->ref_propal = $obj->nb;
elseif ($obj->element=='contrat') $this->ref_contrat = $obj->nb;
elseif ($obj->element=='commande') $this->ref_commande = $obj->nb;
elseif ($obj->element=='propal') $this->ref_propal = $obj->nb;
}
}
$this->db->free($resql);
@ -914,8 +914,8 @@ class Contact extends CommonObject
$error=0;
$this->old_lastname = $obj->lastname;
$this->old_firstname = $obj->firstname;
$this->old_lastname = $obj->lastname;
$this->old_firstname = $obj->firstname;
$this->db->begin();
@ -1035,7 +1035,7 @@ class Contact extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->id = $obj->rowid;
if ($obj->fk_user_creat) {
$cuser = new User($this->db);

View File

@ -1845,28 +1845,28 @@ class Contrat extends CommonObject
if ($mode == 0)
{
if ($statut == 0) { return $langs->trans("ContractStatusDraft"); }
if ($statut == 1) { return $langs->trans("ContractStatusValidated"); }
if ($statut == 2) { return $langs->trans("ContractStatusClosed"); }
elseif ($statut == 1) { return $langs->trans("ContractStatusValidated"); }
elseif ($statut == 2) { return $langs->trans("ContractStatusClosed"); }
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == 0) { return $langs->trans("ContractStatusDraft"); }
if ($statut == 1) { return $langs->trans("ContractStatusValidated"); }
if ($statut == 2) { return $langs->trans("ContractStatusClosed"); }
elseif ($statut == 1) { return $langs->trans("ContractStatusValidated"); }
elseif ($statut == 2) { return $langs->trans("ContractStatusClosed"); }
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == 0) { return img_picto($langs->trans('ContractStatusDraft'),'statut0').' '.$langs->trans("ContractStatusDraft"); }
if ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4').' '.$langs->trans("ContractStatusValidated"); }
if ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6').' '.$langs->trans("ContractStatusClosed"); }
elseif ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4').' '.$langs->trans("ContractStatusValidated"); }
elseif ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6').' '.$langs->trans("ContractStatusClosed"); }
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == 0) { return img_picto($langs->trans('ContractStatusDraft'),'statut0'); }
if ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4'); }
if ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6'); }
elseif ($statut == 1) { return img_picto($langs->trans('ContractStatusValidated'),'statut4'); }
elseif ($statut == 2) { return img_picto($langs->trans('ContractStatusClosed'),'statut6'); }
}
if ($mode == 4 || $mode == 6 || $mode == 7)
elseif ($mode == 4 || $mode == 6 || $mode == 7)
{
$text='';
if ($mode == 4)
@ -1888,11 +1888,11 @@ class Contrat extends CommonObject
$text.=($mode == 7?'</div>':'');
return $text;
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == 0) { return $langs->trans("ContractStatusDraft").' '.img_picto($langs->trans('ContractStatusDraft'),'statut0'); }
if ($statut == 1) { return $langs->trans("ContractStatusValidated").' '.img_picto($langs->trans('ContractStatusValidated'),'statut4'); }
if ($statut == 2) { return $langs->trans("ContractStatusClosed").' '.img_picto($langs->trans('ContractStatusClosed'),'statut6'); }
elseif ($statut == 1) { return $langs->trans("ContractStatusValidated").' '.img_picto($langs->trans('ContractStatusValidated'),'statut4'); }
elseif ($statut == 2) { return $langs->trans("ContractStatusClosed").' '.img_picto($langs->trans('ContractStatusClosed'),'statut6'); }
}
}
@ -2116,7 +2116,7 @@ class Contrat extends CommonObject
$sql.= " AND c.rowid = cd.fk_contrat";
$sql.= " AND cd.statut = 0";
}
if ($mode == 'expired')
elseif ($mode == 'expired')
{
$sql = "SELECT cd.rowid, cd.date_fin_validite as datefin";
$sql.= $this->from;
@ -2637,50 +2637,50 @@ class ContratLigne extends CommonObjectLine
if ($mode == 0)
{
if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial"); }
if ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
if ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLate"); }
if ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLate"); }
if ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); }
elseif ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
elseif ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLate"); }
elseif ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLate"); }
elseif ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); }
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial"); }
if ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
if ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort"); }
if ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort"); }
if ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); }
elseif ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
elseif ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort"); }
elseif ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort"); }
elseif ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed"); }
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
if ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
if ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); }
if ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); }
if ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
elseif ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
elseif ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); }
elseif ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); }
elseif ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0',$moreatt); }
if ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4',$moreatt); }
if ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4',$moreatt); }
if ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3',$moreatt); }
if ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6',$moreatt); }
elseif ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4',$moreatt); }
elseif ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4',$moreatt); }
elseif ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3',$moreatt); }
elseif ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6',$moreatt); }
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == self::STATUS_INITIAL) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
if ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
if ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLate"); }
if ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); }
if ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
elseif ($statut == self::STATUS_OPEN && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
elseif ($statut == self::STATUS_OPEN && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLate"); }
elseif ($statut == self::STATUS_OPEN && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); }
elseif ($statut == self::STATUS_CLOSED) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == self::STATUS_INITIAL) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
if ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
if ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'),'statut4'); }
if ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
if ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
elseif ($statut == self::STATUS_OPEN && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
elseif ($statut == self::STATUS_OPEN && $expired == 0) { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'),'statut4'); }
elseif ($statut == self::STATUS_OPEN && $expired == 1) { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
elseif ($statut == self::STATUS_CLOSED) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
}
}
@ -3020,15 +3020,14 @@ class ContratLigne extends CommonObjectLine
}
}
if (! $error)
{
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('LINECONTRACT_UPDATE', $user);
if ($result < 0) { $error++; $this->db->rollback(); }
// End call triggers
}
if (! $error && ! $notrigger) {
// Call trigger
$result=$this->call_trigger('LINECONTRACT_UPDATE', $user);
if ($result < 0) {
$error++;
$this->db->rollback();
}
// End call triggers
}
if (! $error)

View File

@ -431,11 +431,11 @@ abstract class CommonInvoice extends CommonObject
{
global $langs;
if ($this->type == CommonInvoice::TYPE_STANDARD) return $langs->trans("InvoiceStandard");
if ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement");
if ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir");
if ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit");
if ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); // Not used.
if ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation");
elseif ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement");
elseif ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir");
elseif ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit");
elseif ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); // Not used.
elseif ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation");
return $langs->trans("Unknown");
}
@ -475,10 +475,10 @@ abstract class CommonInvoice extends CommonObject
if (! $paye)
{
if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusClosedUnpaid');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
if ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid');
return $langs->trans('Bill'.$prefix.'StatusStarted');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusClosedUnpaid');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
elseif ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid');
else return $langs->trans('Bill'.$prefix.'StatusStarted');
}
else
{
@ -493,10 +493,10 @@ abstract class CommonInvoice extends CommonObject
if (! $paye)
{
if ($status == 0) return $langs->trans('Bill'.$prefix.'StatusDraft');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
if ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid');
return $langs->trans('Bill'.$prefix.'StatusStarted');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusCanceled');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
elseif ($alreadypaid <= 0) return $langs->trans('Bill'.$prefix.'StatusNotPaid');
else return $langs->trans('Bill'.$prefix.'StatusStarted');
}
else
{
@ -511,10 +511,10 @@ abstract class CommonInvoice extends CommonObject
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('Bill'.$prefix.'StatusDraft');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('StatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
if ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1').' '.$langs->trans('Bill'.$prefix.'StatusNotPaid');
return img_picto($langs->trans('BillStatusStarted'),'statut3').' '.$langs->trans('Bill'.$prefix.'StatusStarted');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('StatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
elseif ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1').' '.$langs->trans('Bill'.$prefix.'StatusNotPaid');
else return img_picto($langs->trans('BillStatusStarted'),'statut3').' '.$langs->trans('Bill'.$prefix.'StatusStarted');
}
else
{
@ -529,10 +529,10 @@ abstract class CommonInvoice extends CommonObject
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9');
if ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1');
return img_picto($langs->trans('BillStatusStarted'),'statut3');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9');
elseif ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1');
else return img_picto($langs->trans('BillStatusStarted'),'statut3');
}
else
{
@ -547,10 +547,10 @@ abstract class CommonInvoice extends CommonObject
if (! $paye)
{
if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('BillStatusDraft');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
if ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1').' '.$langs->trans('BillStatusNotPaid');
return img_picto($langs->trans('BillStatusStarted'),'statut3').' '.$langs->trans('BillStatusStarted');
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return img_picto($langs->trans('BillStatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9').' '.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
elseif ($alreadypaid <= 0) return img_picto($langs->trans('BillStatusNotPaid'),'statut1').' '.$langs->trans('BillStatusNotPaid');
else return img_picto($langs->trans('BillStatusStarted'),'statut3').' '.$langs->trans('BillStatusStarted');
}
else
{
@ -566,14 +566,14 @@ abstract class CommonInvoice extends CommonObject
if (! $paye)
{
if ($status == 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'),'statut0');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9');
if ($alreadypaid <= 0)
elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
elseif (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut9');
elseif ($alreadypaid <= 0)
{
if ($type == self::TYPE_CREDIT_NOTE) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotRefunded').' </span>'.img_picto($langs->trans('StatusNotRefunded'),'statut1');
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
}
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
else return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
}
else
{
@ -598,7 +598,9 @@ abstract class CommonInvoice extends CommonObject
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code;
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id;
$cdr_nbjour=0; $cdr_type=0; $cdr_decalage=0;
$cdr_nbjour=0;
$cdr_type=0;
$cdr_decalage=0;
$sqltemp = 'SELECT c.type_cdr,c.nbjour,c.decalage';
$sqltemp.= ' FROM '.MAIN_DB_PREFIX.'c_payment_term as c';

View File

@ -7324,7 +7324,7 @@ abstract class CommonObject
$comment = new Comment($this->db);
$result=$comment->fetchAllFor($this->element, $this->id);
if ($result<0) {
$this->errors=array_merge($this->errors,$comment->errors);
$this->errors=array_merge($this->errors, $comment->errors);
return -1;
} else {
$this->comments = $comment->comments;
@ -7341,4 +7341,20 @@ abstract class CommonObject
{
return count($this->comments);
}
/**
* Trim object parameters
* @param string[] $parameters array of parameters to trim
*
* @return void
*/
public function trimParameters($parameters)
{
if (!is_array($parameters)) return;
foreach ($parameters as $parameter) {
if (isset($this->$parameter)) {
$this->$parameter = trim($this->$parameter);
}
}
}
}

View File

@ -1149,8 +1149,8 @@ class FormOther
if ($nbboxactivated)
{
$langs->load("boxes");
$langs->load("projects");
// Load translation files required by the page
$langs->loadLangs(array("boxes","projects"));
$emptybox=new ModeleBoxes($db);

View File

@ -101,9 +101,8 @@ class FormSms
if (! is_object($form)) $form=new Form($this->db);
$langs->load("other");
$langs->load("mails");
$langs->load("sms");
// Load translation files required by the page
$langs->loadLangs(array('other', 'mails', 'sms'));
$soc=new Societe($this->db);
if (!empty($this->withtosocid) && $this->withtosocid > 0)

View File

@ -66,18 +66,19 @@ else
}
// Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
$tradTemp=array($langs->trans("January"),
$langs->trans("February"),
$langs->trans("March"),
$langs->trans("April"),
$langs->trans("May"),
$langs->trans("June"),
$langs->trans("July"),
$langs->trans("August"),
$langs->trans("September"),
$langs->trans("October"),
$langs->trans("November"),
$langs->trans("December")
$tradTemp=array(
$langs->trans("January"),
$langs->trans("February"),
$langs->trans("March"),
$langs->trans("April"),
$langs->trans("May"),
$langs->trans("June"),
$langs->trans("July"),
$langs->trans("August"),
$langs->trans("September"),
$langs->trans("October"),
$langs->trans("November"),
$langs->trans("December")
);
print '<script type="text/javascript">';
print 'var tradMonths = [';
@ -96,25 +97,22 @@ $qualified=true;
if (! isset($_GET["sd"])) $_GET["sd"]="00000000";
if (! isset($_GET["m"])) $qualified=false;
if (! isset($_GET["y"])) $qualified=false;
if (! isset($_GET["m"]) || ! isset($_GET["y"])) $qualified=false;
if (isset($_GET["m"]) && isset($_GET["y"]))
{
if ($_GET["m"] < 1) $qualified=false;
if ($_GET["m"] > 12) $qualified=false;
if ($_GET["y"] < 0) $qualified=false;
if ($_GET["y"] > 9999) $qualified=false;
if ($_GET["m"] < 1 || $_GET["m"] > 12) $qualified=false;
if ($_GET["y"] < 0 || $_GET["y"] > 9999) $qualified=false;
}
// If parameters provided, we show calendar
if ($qualified)
{
//print $_GET["cm"].",".$_GET["sd"].",".$_GET["m"].",".$_GET["y"];exit;
displayBox(GETPOST("sd",'alpha'),GETPOST("m",'int'),GETPOST("y",'int'));
displayBox(GETPOST("sd",'alpha'), GETPOST("m",'int'), GETPOST("y",'int'));
}
else
{
dol_print_error('','ErrorBadParameters');
dol_print_error('', 'ErrorBadParameters');
}
@ -195,9 +193,7 @@ function displayBox($selectedDate,$month,$year)
{
echo '<td width="', (int) (($i+1)*100/7) - (int) ($i*100/7), '%">', $langs->trans($day_names[($i + $startday) % 7]), '</td>', "\n";
}
?>
</tr>
<?php
print '</tr>';
//print "x ".$thedate." y"; // $thedate = first day of month
$firstdate=dol_getdate($thedate);
//var_dump($firstdateofweek);
@ -210,7 +206,7 @@ function displayBox($selectedDate,$month,$year)
//print_r($mydate);
if ($mydate < $firstdate) // At first run
{
echo "<TR class=\"dpWeek\">";
echo "<tr class=\"dpWeek\">";
//echo $conf->global->MAIN_START_WEEK.' '.$firstdate["wday"].' '.$startday;
$cols=0;
for ($i = 0; $i < 7; $i++)
@ -221,7 +217,7 @@ function displayBox($selectedDate,$month,$year)
$mydate = $firstdate;
break;
}
echo "<TD>&nbsp;</TD>";
echo "<td>&nbsp;</td>";
$cols++;
}
}
@ -229,7 +225,7 @@ function displayBox($selectedDate,$month,$year)
{
if ($mydate["wday"] == $startday)
{
echo "<TR class=\"dpWeek\">";
echo "<tr class=\"dpWeek\">";
$cols=0;
}
}
@ -245,17 +241,17 @@ function displayBox($selectedDate,$month,$year)
}
// Sur click dans calendrier, appelle fonction dpClickDay
echo "<TD class=\"".$dayclass."\"";
echo "<td class=\"".$dayclass."\"";
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",tradMonths)\"";
echo " onClick=\"dpClickDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",'".$langs->trans("FormatDateShortJavaInput")."')\"";
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
echo ">".sprintf("%02s",$mydate["mday"])."</td>";
$cols++;
if (($mydate["wday"] + 1) % 7 == $startday) echo "</TR>\n";
//$thedate=strtotime("tomorrow",$thedate);
$day++;
$thedate=dol_mktime(12,0,0,$month,$day,$year);
$thedate=dol_mktime(12, 0, 0, $month, $day, $year);
if ($thedate == '')
{
$stoploop=1;
@ -269,8 +265,8 @@ function displayBox($selectedDate,$month,$year)
if ($cols < 7)
{
for($i=6; $i>=$cols; $i--) echo "<TD>&nbsp;</TD>";
echo "</TR>\n";
for($i=6; $i>=$cols; $i--) echo "<td>&nbsp;</td>";
echo "</tr>\n";
}
?>
<tr>

View File

@ -7,7 +7,7 @@
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015-2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
@ -1244,12 +1244,12 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
print "</tr>\n";
}
}
else
{
//else
//{
//print '<tr class="oddeven">';
//print '<td>'.$langs->trans("NoAddressYetDefined").'</td>';
//print "</tr>\n";
}
//}
print "\n</table>\n";
print "<br>\n";
@ -1323,30 +1323,30 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
$sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if (is_object($filterobj) && get_class($filterobj) == 'Adherent')
elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent')
{
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
if (is_object($filterobj) && get_class($filterobj) == 'Product')
elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
@ -1362,7 +1362,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
else
{
if ($actioncode == 'AC_OTH') $sql.= " AND c.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql.= " AND c.type = 'systemauto'";
elseif ($actioncode == 'AC_OTH_AUTO') $sql.= " AND c.type = 'systemauto'";
}
}
else
@ -1373,7 +1373,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
}
}
if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']);
$sql.= $db->order($sortfield, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
@ -1388,7 +1388,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$obj = $db->fetch_object($resql);
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
//if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$tododone='';
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone='todo';

View File

@ -98,8 +98,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
global $conf,$langs;
$langs->load("companies");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('companies', 'errors'));
$form = new Form($this->db);

View File

@ -95,10 +95,10 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
*/
function info($langs)
{
global $conf,$langs;
global $conf, $langs;
$langs->load("companies");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('companies', 'errors'));
$form = new Form($this->db);

View File

@ -93,10 +93,10 @@ class doc_generic_user_odt extends ModelePDFUser
*/
function info($langs)
{
global $conf,$langs;
global $conf, $langs;
$langs->load("companies");
$langs->load("errors");
// Load translation files required by the page
$langs->loadLangs(array('companies', 'errors'));
$form = new Form($this->db);

View File

@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
*/
class doc_generic_usergroup_odt extends ModelePDFUserGroup
{
var $emetteur; // Objet societe qui emet
public $emetteur; // Objet societe qui emet
var $phpmin = array(5,2,0); // Minimum version of PHP required by module
var $version = 'dolibarr';
public $phpmin = array(5,4,0); // Minimum version of PHP required by module
public $version = 'dolibarr';
/**
@ -50,10 +50,10 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
*/
function __construct($db)
{
global $conf,$langs,$mysoc;
global $conf, $langs, $mysoc;
$langs->load("main");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array('companies', 'main'));
$this->db = $db;
$this->name = "ODT templates";

View File

@ -46,11 +46,8 @@ if (! empty($conf->contrat->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcontract.class.php';
}
$langs->load('bills');
$langs->load('compta');
$langs->load('admin');
$langs->load("interventions");
// Load translation files required by the page
$langs->loadLangs(array("interventions","admin","compta","bills"));
// Security check
$id=(GETPOST('fichinterid', 'int')?GETPOST('fichinterid', 'int'):GETPOST('id', 'int'));

View File

@ -49,10 +49,8 @@ $endyear=$year;
$object_status=GETPOST('object_status');
$langs->load('interventions');
$langs->load('companies');
$langs->load('other');
$langs->load('suppliers');
// Load translation files required by the page
$langs->loadLangs(array("interventions","suppliers","companies","other"));
/*

View File

@ -34,8 +34,8 @@ $idprod=GETPOST('idprod','int');
$prices = array();
$langs->load('stocks');
$langs->load('margins');
// Load translation files required by the page
$langs->loadLangs(array("stocks","margins"));
/*

View File

@ -33,10 +33,8 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("facture");
$langs->load("orders");
$langs->load("sendings");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array("facture","orders","sendings","companies"));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');

View File

@ -5,9 +5,9 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -40,13 +40,9 @@ require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$langs->load('orders');
$langs->load('sendings');
$langs->load('companies');
$langs->load('bills');
$langs->load('deliveries');
$langs->load('products');
$langs->load('stocks');
// Load translation files required by the page
$langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks"));
if (! empty($conf->productbatch->enabled))
$langs->load('productbatch');

View File

@ -38,14 +38,8 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('orders');
$langs->load('other');
$langs->load('sendings');
$langs->load('companies');
$langs->load('bills');
$langs->load('deliveries');
$langs->load('products');
$langs->load('stocks');
// Load translation files required by the page
$langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks","other"));
$id = GETPOST('id','int');
$ref = GETPOST('ref', 'alpha');

View File

@ -34,8 +34,8 @@ $orderid = GETPOST('orderid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
$langs->load("suppliers");
$langs->load("orders");
// Load translation files required by the page
$langs->loadLangs(array("suppliers", "orders"));
/*

View File

@ -33,10 +33,8 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("orders");
$langs->load("suppliers");
$langs->load("companies");
$langs->load('stocks');
// Load translation files required by the page
$langs->loadLangs(array("suppliers", "orders", "companies", "stocks"));
$id=GETPOST('id','int');
$ref=GETPOST('ref','alpha');

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -32,10 +32,8 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("orders");
$langs->load("suppliers");
$langs->load("companies");
$langs->load('stocks');
// Load translation files required by the page
$langs->loadLangs(array("suppliers", "orders", "companies", "stocks"));
$id = GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int');
$ref = GETPOST('ref');

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
@ -8,7 +8,7 @@
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -41,9 +41,8 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
}
$langs->load('orders');
$langs->load('deliveries');
$langs->load('companies');
// Load translation files required by the page
$langs->loadLangs(array("orders", "companies", "deliveries"));
if (! $user->rights->fournisseur->facture->creer)
accessforbidden();
@ -105,9 +104,9 @@ if (($action == 'create' || $action == 'add') && ! $error) {
if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$langs->load('bills');
$langs->load('products');
$langs->load('main');
// Load translation files required by the page
$langs->loadLangs(array("bills", "main", "products"));
if (isset($_GET['orders_to_invoice'])) {
$orders_id = GETPOST('orders_to_invoice','',1);
$n = count($orders_id);

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -310,22 +311,22 @@ class Establishment extends CommonObject
elseif ($mode == 2)
{
if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts_short[$status]);
if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]);
}
elseif ($mode == 3)
{
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5');
if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4');
}
elseif ($mode == 4)
{
if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts[$status]);
if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]);
}
elseif ($mode == 5)
{
if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut5');
if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4');
elseif ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4');
}
}
@ -351,7 +352,7 @@ class Establishment extends CommonObject
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_creation = $this->db->jdate($obj->datec);
if ($obj->fk_user_author)
{
$cuser = new User($this->db);

View File

@ -937,7 +937,7 @@ else
define('ROWS_9',8);
}
$heightforframes=48;
$heightforframes=50;
// Init menu manager
if (! defined('NOREQUIREMENU'))

View File

@ -3,7 +3,7 @@
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) ---Put here your own copyright and developer email---
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -126,7 +126,7 @@ class ProductStockEntrepot extends CommonObject
if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
if (!$notrigger) {
//if (!$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
@ -134,7 +134,7 @@ class ProductStockEntrepot extends CommonObject
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) $error++;
//// End call triggers
}
//}
}
// Commit or rollback
@ -340,7 +340,7 @@ class ProductStockEntrepot extends CommonObject
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
}
if (!$error && !$notrigger) {
//if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -348,7 +348,7 @@ class ProductStockEntrepot extends CommonObject
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
//}
// Commit or rollback
if ($error) {
@ -378,8 +378,7 @@ class ProductStockEntrepot extends CommonObject
$this->db->begin();
if (!$error) {
if (!$notrigger) {
//if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -387,8 +386,7 @@ class ProductStockEntrepot extends CommonObject
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
//}
if (!$error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
@ -526,34 +524,33 @@ class ProductStockEntrepot extends CommonObject
if ($mode == 0)
{
$prefix='';
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
elseif ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
elseif ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
}
}

View File

@ -529,7 +529,7 @@ class Societe extends CommonObject
$this->add_commercial($user, $this->commercial_id);
}
// si un commercial cree un client il lui est affecte automatiquement
else if (empty($user->rights->societe->client->voir))
elseif (empty($user->rights->societe->client->voir))
{
$this->add_commercial($user, $user->id);
}
@ -652,15 +652,15 @@ class Societe extends CommonObject
{
$this->errors[] = 'ErrorBadCustomerCodeSyntax';
}
if ($rescode == -2)
elseif ($rescode == -2)
{
$this->errors[] = 'ErrorCustomerCodeRequired';
}
if ($rescode == -3)
elseif ($rescode == -3)
{
$this->errors[] = 'ErrorCustomerCodeAlreadyUsed';
}
if ($rescode == -4)
elseif ($rescode == -4)
{
$this->errors[] = 'ErrorPrefixRequired';
}
@ -677,15 +677,15 @@ class Societe extends CommonObject
{
$this->errors[] = 'ErrorBadSupplierCodeSyntax';
}
if ($rescode == -2)
elseif ($rescode == -2)
{
$this->errors[] = 'ErrorSupplierCodeRequired';
}
if ($rescode == -3)
elseif ($rescode == -3)
{
$this->errors[] = 'ErrorSupplierCodeAlreadyUsed';
}
if ($rescode == -5)
elseif ($rescode == -5)
{
$this->errors[] = 'ErrorprefixRequired';
}
@ -1064,7 +1064,7 @@ class Societe extends CommonObject
$error++;
}
}
else if ($result < 0)
elseif ($result < 0)
{
$this->error=$lmember->error;
$error++;
@ -1960,37 +1960,37 @@ class Societe extends CommonObject
$label.= '<u>' . $langs->trans("ShowCustomer") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
}
else if ($option == 'prospect' && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
elseif ($option == 'prospect' && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
{
$label.= '<u>' . $langs->trans("ShowProspect") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id;
}
else if ($option == 'supplier')
elseif ($option == 'supplier')
{
$label.= '<u>' . $langs->trans("ShowSupplier") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
}
else if ($option == 'agenda')
elseif ($option == 'agenda')
{
$label.= '<u>' . $langs->trans("ShowAgenda") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/agenda.php?socid='.$this->id;
}
else if ($option == 'project')
elseif ($option == 'project')
{
$label.= '<u>' . $langs->trans("ShowProject") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/project.php?socid='.$this->id;
}
else if ($option == 'margin')
elseif ($option == 'margin')
{
$label.= '<u>' . $langs->trans("ShowMargin") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/margin/tabs/thirdpartyMargins.php?socid='.$this->id.'&type=1';
}
else if ($option == 'contact')
elseif ($option == 'contact')
{
$label.= '<u>' . $langs->trans("ShowContacts") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/contact.php?socid='.$this->id;
}
else if ($option == 'ban')
elseif ($option == 'ban')
{
$label.= '<u>' . $langs->trans("ShowBan") . '</u>';
$linkstart = '<a href="'.DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$this->id;
@ -2103,37 +2103,37 @@ class Societe extends CommonObject
if ($mode == 0)
{
if ($statut==0) return $langs->trans("ActivityCeased");
if ($statut==1) return $langs->trans("InActivity");
elseif ($statut==1) return $langs->trans("InActivity");
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut==0) return $langs->trans("ActivityCeased");
if ($statut==1) return $langs->trans("InActivity");
elseif ($statut==1) return $langs->trans("InActivity");
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased");
if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity");
elseif ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity");
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
elseif ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased");
if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity");
elseif ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity");
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans("ActivityCeased").'</span> '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans("InActivity").'</span> '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
elseif ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans("InActivity").'</span> '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
}
if ($mode == 6)
elseif ($mode == 6)
{
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans("ActivityCeased").'</span> '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans("InActivity").'</span> '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
elseif ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans("InActivity").'</span> '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
}
}

View File

@ -79,24 +79,24 @@ $stripeacc = $stripe->getStripeAccount($service);
if (!$rowid)
{
print '<FORM method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<INPUT type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<INPUT type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<INPUT type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<INPUT type="hidden" name="action" value="list">';
print '<INPUT type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<INPUT type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<INPUT type="hidden" name="page" value="'.$page.'">';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
$title=$langs->trans("StripeChargeList");
$title.=($stripeacc?' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)');
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit);
print '<DIV class="div-table-responsive">';
print '<TABLE class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<TR class="liste_titre">';
print '<tr class="liste_titre">';
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
print_liste_field_titre("Customer",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
@ -105,9 +105,9 @@ if (!$rowid)
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre("Paid",$_SERVER["PHP_SELF"],"","","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"","","",'align="right"');
print "</TR>\n";
print "</tr>\n";
print "</TR>\n";
print "</tr>\n";
if ($stripeacc)
{
@ -148,7 +148,7 @@ if (!$rowid)
$memberstatic->id = 0;
}
print '<TR class="oddeven">';
print '<tr class="oddeven">';
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
@ -158,9 +158,9 @@ if (!$rowid)
{
$url='https://dashboard.stripe.com/'.$connect.'payments/'.$charge->id;
}
print "<TD><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></TD>\n";
print "<td><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></td>\n";
// Stripe customer
print "<TD>";
print "<td>";
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
$url='https://dashboard.stripe.com/'.$connect.'test/customers/'.$charge->customer;
@ -168,11 +168,11 @@ if (!$rowid)
{
$url='https://dashboard.stripe.com/'.$connect.'customers/'.$charge->customer;
}
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').' '.$charge->customer.'</a>';
print '<a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').' '.$charge->customer.'</a>';
print "</TD>\n";
print "</td>\n";
// Link
print "<TD>";
print "<td>";
if ($societestatic->id > 0)
{
print $societestatic->getNomUrl(1);
@ -181,27 +181,27 @@ if (!$rowid)
{
print $memberstatic->getNomUrl(1);
}
print "</TD>\n";
print "</td>\n";
// Origine
print "<TD>";
print "<td>";
if ($charge->metadata->dol_type=="order"){
$object = new Commande($db);
$object->fetch($charge->metadata->dol_id);
if ($object->id > 0) {
print "<A href='".DOL_URL_ROOT."/commande/card.php?id=".$object->id."'>".img_picto('', 'object_order')." ".$object->ref."</A>";
print "<a href='".DOL_URL_ROOT."/commande/card.php?id=".$object->id."'>".img_picto('', 'object_order')." ".$object->ref."</a>";
} else print $FULLTAG;
} elseif ($charge->metadata->dol_type=="invoice"){
$object = new Facture($db);
$object->fetch($charge->metadata->dol_id);
if ($object->id > 0) {
print "<A href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
print "<a href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</a>";
} else print $FULLTAG;
} else print $FULLTAG;
print "</TD>\n";
print "</td>\n";
// Date payment
print '<TD align="center">'.dol_print_date($charge->created,'%d/%m/%Y %H:%M')."</TD>\n";
print '<td align="center">'.dol_print_date($charge->created,'%d/%m/%Y %H:%M')."</td>\n";
// Type
print '<TD>';
print '<td>';
if ($charge->source->object=='card')
{
print $langs->trans("card");
@ -211,11 +211,11 @@ if (!$rowid)
} elseif ($charge->source->type=='three_d_secure'){
print $langs->trans("card3DS");
}
print '</TD>';
print '</td>';
// Amount
print "<TD align=\"right\">".price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."</TD>";
print "<td align=\"right\">".price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."</td>";
// Status
print '<TD align="right">';
print '<td align="right">';
if ($charge->refunded=='1'){
print img_picto($langs->trans("refunded"),'statut6');
} elseif ($charge->paid=='1'){
@ -228,9 +228,9 @@ if (!$rowid)
$label.="Statut: ".$langs->trans("".$charge->outcome->seller_message."");
print $form->textwithpicto(img_picto($langs->trans("".$charge->status.""),'statut8'),$label,1);
}
print "</TD>\n";
print "</td>\n";
print "</TR>\n";
print "</tr>\n";
}
} else {

View File

@ -808,20 +808,24 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$i = 0;
//print '<tr><td colspan="3">';
print '<br>';
print_barre_liste($langs->trans('StripeInvoiceList').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
print_barre_liste($langs->trans('StripeInvoiceList').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$arraytitle.'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td>'.$langs->trans('Currency').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyalreadypayedlabel.'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyremaindertopay.'</td>';
if (!empty($conf->multicurrency->enabled)) {
print '<td>'.$langs->trans('Currency').'</td>';
print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
print '<td align="right">'.$multicurrencyalreadypayedlabel.'</td>';
print '<td align="right">'.$multicurrencyremaindertopay.'</td>';
}
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right">'.$alreadypayedlabel.'</td>';
print '<td align="right">'.$remaindertopay.'</td>';
print '<td align="right">'.$langs->trans('PaymentAmount').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
if (!empty($conf->multicurrency->enabled)) {
print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
}
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
@ -980,17 +984,21 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Print total
print '<tr class="liste_total">';
print '<td colspan="2" align="left">'.$langs->trans('TotalTTC').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
if (!empty($conf->multicurrency->enabled)) {
print '<td></td>';
print '<td></td>';
print '<td></td>';
}
print '<td align="right"><b>'.price($sign * $total_ttc).'</b></td>';
print '<td align="right"><b>'.price($sign * $totalrecu);
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
print '</b></td>';
print '<td align="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
print '<td align="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
print '<td align="right" id="result" style="font-weight: bold;"></td>';
if (!empty($conf->multicurrency->enabled)) {print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';}
if (!empty($conf->multicurrency->enabled)) {
print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
}
print "</tr>\n";
}
print "</table>";

View File

@ -2169,9 +2169,7 @@ class User extends CommonObject
*/
function getPhotoUrl($width, $height, $cssclass='', $imagesize='')
{
$result='';
$result.='<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
$result ='<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
$result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize);
$result.='</a>';
@ -2199,7 +2197,7 @@ class User extends CommonObject
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $menumanager;
if(!$user->rights->user->user->lire && $user->id !=$this->id) $option='nolink';
if(!$user->rights->user->user->lire && $user->id !=$this->id) $option='nolink';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
@ -2348,7 +2346,7 @@ class User extends CommonObject
$linkend='</a>';
}
if ($option == 'nolink')
if ($option == 'nolink')
{
$linkstart = '';
$linkend='';
@ -2388,34 +2386,33 @@ class User extends CommonObject
if ($mode == 0)
{
$prefix='';
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
elseif ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
elseif ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled');
elseif ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"');
elseif ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled');
elseif ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"');
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"');
elseif ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"');
}
}
@ -2436,8 +2433,8 @@ class User extends CommonObject
global $conf;
$dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN;
if ($mode==1) $dn=$conf->global->LDAP_USER_DN;
if ($mode==2) $dn=$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS];
elseif ($mode==1) $dn=$conf->global->LDAP_USER_DN;
elseif ($mode==2) $dn=$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS];
return $dn;
}
@ -2511,7 +2508,7 @@ class User extends CommonObject
if (! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
}
// Set LDAP password if possible
else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
elseif ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
{
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
{
@ -2524,7 +2521,7 @@ class User extends CommonObject
}
}
// Use $this->pass_indatabase value if exists
else if (! empty($this->pass_indatabase))
elseif (! empty($this->pass_indatabase))
{
if (! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
if (! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
@ -3020,7 +3017,7 @@ class User extends CommonObject
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'user'
'user',
);
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
@ -3077,7 +3074,7 @@ class User extends CommonObject
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf,$user,$langs;
global $conf, $user, $langs;
$langs->load("user");