Merge remote-tracking branch 'upstream/develop' into mycompanysocialnetworks
This commit is contained in:
commit
cd87ee8f92
@ -343,7 +343,7 @@ class Notify
|
|||||||
$sql = '';
|
$sql = '';
|
||||||
|
|
||||||
// Check notification per third party
|
// Check notification per third party
|
||||||
if ($object->socid > 0)
|
if (!empty($object->socid) && $object->socid > 0)
|
||||||
{
|
{
|
||||||
$sql .= "SELECT 'tocontactid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
|
$sql .= "SELECT 'tocontactid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
|
||||||
$sql .= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
$sql .= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
||||||
@ -576,7 +576,7 @@ class Notify
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("No notification to thirdparty sent, nothing into notification setup for the thirdparty socid = ".$object->socid);
|
dol_syslog("No notification to thirdparty sent, nothing into notification setup for the thirdparty socid = ".(empty($object->socid) ? '' : $object->socid));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -122,7 +122,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
// For backward compatibility and restore old behavior to get ref of expense report
|
// For backward compatibility and restore old behavior to get ref of expense report
|
||||||
if ($conf->global->EXPENSEREPORT_USE_OLD_NUMBERING_RULE)
|
if (!empty($conf->global->EXPENSEREPORT_USE_OLD_NUMBERING_RULE))
|
||||||
{
|
{
|
||||||
$fuser = null;
|
$fuser = null;
|
||||||
if ($object->fk_user_author > 0)
|
if ($object->fk_user_author > 0)
|
||||||
|
|||||||
@ -217,7 +217,7 @@ class modReception extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'reception as c';
|
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'reception as c';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'reception_extrafields as extra ON c.rowid = extra.fk_object,';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'reception_extrafields as extra ON c.rowid = extra.fk_object,';
|
||||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'societe as s';
|
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'societe as s';
|
||||||
if (!$user->rights->societe->client->voir) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
||||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
|
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
|
||||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch as ed';
|
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch as ed';
|
||||||
@ -231,7 +231,7 @@ class modReception extends DolibarrModules
|
|||||||
}
|
}
|
||||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_reception AND ed.fk_commandefourndet = cd.rowid';
|
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_reception AND ed.fk_commandefourndet = cd.rowid';
|
||||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('reception').')';
|
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('reception').')';
|
||||||
if (!$user->rights->societe->client->voir) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -80,12 +80,16 @@ class ExpenseReport extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_statut;
|
public $fk_statut;
|
||||||
|
|
||||||
|
public $vat_src_code;
|
||||||
|
|
||||||
public $fk_c_paiement;
|
public $fk_c_paiement;
|
||||||
public $paid;
|
public $paid;
|
||||||
|
|
||||||
public $user_author_infos;
|
public $user_author_infos;
|
||||||
public $user_validator_infos;
|
public $user_validator_infos;
|
||||||
|
|
||||||
|
public $rule_warning_message;
|
||||||
|
|
||||||
// ACTIONS
|
// ACTIONS
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
@ -539,7 +543,7 @@ class ExpenseReport extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.ref, d.note_public, d.note_private,"; // DEFAULT
|
$sql = "SELECT d.rowid, d.entity, d.ref, d.note_public, d.note_private,"; // DEFAULT
|
||||||
$sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS
|
$sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS
|
||||||
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
|
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
|
||||||
$sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
|
$sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
|
||||||
@ -561,6 +565,9 @@ class ExpenseReport extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->ref = $obj->ref;
|
$this->ref = $obj->ref;
|
||||||
|
|
||||||
|
$this->entity = $obj->entity;
|
||||||
|
|
||||||
$this->total_ht = $obj->total_ht;
|
$this->total_ht = $obj->total_ht;
|
||||||
$this->total_tva = $obj->total_tva;
|
$this->total_tva = $obj->total_tva;
|
||||||
$this->total_ttc = $obj->total_ttc;
|
$this->total_ttc = $obj->total_ttc;
|
||||||
@ -802,6 +809,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
$this->ref = 'SPECIMEN';
|
$this->ref = 'SPECIMEN';
|
||||||
$this->specimen = 1;
|
$this->specimen = 1;
|
||||||
|
$this->entity = 1;
|
||||||
$this->date_create = $now;
|
$this->date_create = $now;
|
||||||
$this->date_debut = $now;
|
$this->date_debut = $now;
|
||||||
$this->date_fin = $now;
|
$this->date_fin = $now;
|
||||||
@ -2637,7 +2645,7 @@ class ExpenseReportLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* insert
|
* Insert a line of expense report
|
||||||
*
|
*
|
||||||
* @param int $notrigger 1=No trigger
|
* @param int $notrigger 1=No trigger
|
||||||
* @param bool $fromaddline false=keep default behavior, true=exclude the update_price() of parent object
|
* @param bool $fromaddline false=keep default behavior, true=exclude the update_price() of parent object
|
||||||
@ -2649,11 +2657,11 @@ class ExpenseReportLine
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
dol_syslog("ExpenseReportLine::Insert rang=".$this->rang, LOG_DEBUG);
|
dol_syslog("ExpenseReportLine::Insert", LOG_DEBUG);
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->comments = trim($this->comments);
|
$this->comments = trim($this->comments);
|
||||||
if (!$this->value_unit_HT) $this->value_unit_HT = 0;
|
if (empty($this->value_unit)) $this->value_unit = 0;
|
||||||
$this->qty = price2num($this->qty);
|
$this->qty = price2num($this->qty);
|
||||||
$this->vatrate = price2num($this->vatrate);
|
$this->vatrate = price2num($this->vatrate);
|
||||||
if (empty($this->fk_c_exp_tax_cat)) $this->fk_c_exp_tax_cat = 0;
|
if (empty($this->fk_c_exp_tax_cat)) $this->fk_c_exp_tax_cat = 0;
|
||||||
@ -2665,9 +2673,9 @@ class ExpenseReportLine
|
|||||||
$sql .= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat, fk_ecm_files)';
|
$sql .= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat, fk_ecm_files)';
|
||||||
$sql .= " VALUES (".$this->db->escape($this->fk_expensereport).",";
|
$sql .= " VALUES (".$this->db->escape($this->fk_expensereport).",";
|
||||||
$sql .= " ".$this->db->escape($this->fk_c_type_fees).",";
|
$sql .= " ".$this->db->escape($this->fk_c_type_fees).",";
|
||||||
$sql .= " ".$this->db->escape($this->fk_project > 0 ? $this->fk_project : ($this->fk_projet > 0 ? $this->fk_projet : 'null')).",";
|
$sql .= " ".$this->db->escape((!empty($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : ((!empty($this->fk_projet) && $this->fk_projet > 0) ? $this->fk_projet : 'null')).",";
|
||||||
$sql .= " ".$this->db->escape($this->vatrate).",";
|
$sql .= " ".$this->db->escape($this->vatrate).",";
|
||||||
$sql .= " '".$this->db->escape($this->vat_src_code)."',";
|
$sql .= " '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."',";
|
||||||
$sql .= " '".$this->db->escape($this->comments)."',";
|
$sql .= " '".$this->db->escape($this->comments)."',";
|
||||||
$sql .= " ".$this->db->escape($this->qty).",";
|
$sql .= " ".$this->db->escape($this->qty).",";
|
||||||
$sql .= " ".$this->db->escape($this->value_unit).",";
|
$sql .= " ".$this->db->escape($this->value_unit).",";
|
||||||
@ -2675,7 +2683,7 @@ class ExpenseReportLine
|
|||||||
$sql .= " ".$this->db->escape($this->total_tva).",";
|
$sql .= " ".$this->db->escape($this->total_tva).",";
|
||||||
$sql .= " ".$this->db->escape($this->total_ttc).",";
|
$sql .= " ".$this->db->escape($this->total_ttc).",";
|
||||||
$sql .= " '".$this->db->idate($this->date)."',";
|
$sql .= " '".$this->db->idate($this->date)."',";
|
||||||
$sql .= " '".$this->db->escape($this->rule_warning_message)."',";
|
$sql .= " ".(empty($this->rule_warning_message) ? 'null' : "'".$this->db->escape($this->rule_warning_message)."'").",";
|
||||||
$sql .= " ".$this->db->escape($this->fk_c_exp_tax_cat).",";
|
$sql .= " ".$this->db->escape($this->fk_c_exp_tax_cat).",";
|
||||||
$sql .= " ".($this->fk_ecm_files > 0 ? $this->fk_ecm_files : 'null');
|
$sql .= " ".($this->fk_ecm_files > 0 ? $this->fk_ecm_files : 'null');
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|||||||
@ -64,9 +64,16 @@ if (GETPOST('dol_use_jmobile', 'alpha') || !empty($_SESSION['dol_use_jmobile']))
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Validate new password
|
$parameters = array('username' => $username);
|
||||||
if ($action == 'validatenewpassword' && $username && $passwordhash)
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
{
|
if ($reshook < 0) {
|
||||||
|
$message = $hookmanager->error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
|
// Validate new password
|
||||||
|
if ($action == 'validatenewpassword' && $username && $passwordhash)
|
||||||
|
{
|
||||||
$edituser = new User($db);
|
$edituser = new User($db);
|
||||||
$result = $edituser->fetch('', $_GET["username"]);
|
$result = $edituser->fetch('', $_GET["username"]);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -88,10 +95,10 @@ if ($action == 'validatenewpassword' && $username && $passwordhash)
|
|||||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>';
|
$message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Action modif mot de passe
|
// Action modif mot de passe
|
||||||
if ($action == 'buildnewpassword' && $username)
|
if ($action == 'buildnewpassword' && $username)
|
||||||
{
|
{
|
||||||
$sessionkey = 'dol_antispam_value';
|
$sessionkey = 'dol_antispam_value';
|
||||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||||
|
|
||||||
@ -149,6 +156,7 @@ if ($action == 'buildnewpassword' && $username)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -244,7 +244,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testCategorieUpdate
|
* testCategorieUpdate
|
||||||
*
|
*
|
||||||
* @param Category $localobject Category
|
* @param Categorie $localobject Category
|
||||||
* @return int
|
* @return int
|
||||||
|
|
||||||
* @depends testCategorieFetch
|
* @depends testCategorieFetch
|
||||||
@ -269,7 +269,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase
|
|||||||
/**
|
/**
|
||||||
* testCategorieOther
|
* testCategorieOther
|
||||||
*
|
*
|
||||||
* @param Category $localobject Category
|
* @param Categorie $localobject Category
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
* @depends testCategorieUpdate
|
* @depends testCategorieUpdate
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user