';
- $urloption = '?action=create'; // we use create not edit for more flexibility
+ $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility
$url = DOL_URL_ROOT.'/comm/action/card.php'.$urloption;
// update task list
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 111b411549e..6630b29a746 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2015 Jean-François Ferry
* Copyright (C) 2019 Nicolas ZABOURI
+ * Copyright (C) 2020 Pierre Ardoin
*
* 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
@@ -149,6 +150,9 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql .= ", s.code_client";
+ $sql .= ", s.email";
+ $sql .= ", s.entity";
+ $sql .= ", s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -193,6 +197,9 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
+ $companystatic->entity = $obj->entity;
+ $companystatic->email = $obj->email;
+ $companystatic->code_compta = $obj->code_compta;
print $companystatic->getNomUrl(1, 'customer', 16);
print '
';
print '
'.price($obj->total_ht).'
';
@@ -233,6 +240,9 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql .= ", s.code_client";
+ $sql .= ", s.code_fournisseur";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -276,6 +286,8 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
+ $companystatic->entity = $obj->entity;
+ $companystatic->email = $obj->email;
print $companystatic->getNomUrl(1, 'supplier', 16);
print '';
print '
'.price($obj->total_ht).'
';
@@ -315,6 +327,9 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql .= ", s.code_client";
+ $sql .= ", s.email";
+ $sql .= ", s.entity";
+ $sql .= ", s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -358,6 +373,8 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
+ $companystatic->email = $obj->email;
+ $companystatic->entity = $obj->entity;
print $companystatic->getNomUrl(1, 'customer', 16);
print '';
if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
@@ -404,6 +421,8 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande-
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql .= ", s.code_client";
$sql .= ", s.code_fournisseur";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -447,6 +466,8 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande-
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
+ $companystatic->entity = $obj->entity;
+ $companystatic->email = $obj->email;
print $companystatic->getNomUrl(1, 'supplier', 16);
print '';
if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
@@ -496,6 +517,9 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
$sql .= ", s.code_client";
+ $sql .= ", s.code_compta";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.client IN (1, 2, 3)";
@@ -532,6 +556,9 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas = $objp->canvas;
+ $companystatic->code_compta = $objp->code_compta;
+ $companystatic->entity = $objp->entity;
+ $companystatic->email = $objp->email;
print '
';
print '
'.$companystatic->getNomUrl(1, 'customer', 48).'
';
print '
';
@@ -560,6 +587,8 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
$sql .= ", s.code_fournisseur";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.fournisseur = 1";
@@ -591,6 +620,8 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas = $objp->canvas;
+ $companystatic->entity = $objp->entity;
+ $companystatic->email = $objp->email;
print '
';
print '
'.$companystatic->getNomUrl(1, 'supplier', 44).'
';
print '
'.dol_print_date($db->jdate($objp->dm), 'day').'
';
@@ -636,6 +667,8 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TOD
$sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
$sql .= ", s.code_client";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= " c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."contrat as c";
@@ -673,6 +706,8 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TOD
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas = $objp->canvas;
+ $companystatic->entity = $objp->entity;
+ $companystatic->email = $objp->email;
print $companystatic->getNomUrl(1, 'customer', 44);
print ''."\n";
print "
".$staticcontrat->LibStatut($obj->statut, 3)."
\n";
@@ -697,6 +732,8 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
$langs->load("propal");
$sql = "SELECT s.nom as name, s.rowid, s.code_client";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= ", p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
@@ -760,6 +797,8 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
+ $companystatic->entity = $obj->entity;
+ $companystatic->email = $obj->email;
print $companystatic->getNomUrl(1, 'customer', 44);
print '';
print '
';
@@ -802,6 +841,8 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
$sql .= ", s.code_client";
+ $sql .= ", s.entity";
+ $sql .= ", s.email";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -864,6 +905,8 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
+ $companystatic->entity = $obj->entity;
+ $companystatic->email = $obj->email;
print $companystatic->getNomUrl(1, 'customer', 44);
print '
';
print '
';
diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
index f5acafcfb19..04e2ec69d88 100644
--- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
@@ -65,7 +65,7 @@ class FormAdvTargetEmailing extends Form
$sql .= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$sql .= " WHERE active > 0";
$sql .= " ORDER BY sortorder";
- dol_syslog(get_class($this).'::multiselectProspectionStatus sql='.$sql, LOG_DEBUG);
+
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
@@ -111,7 +111,6 @@ class FormAdvTargetEmailing extends Form
$sql .= " WHERE active = 1 AND code<>''";
$sql .= " ORDER BY code ASC";
- dol_syslog(get_class($this)."::select_country sql=".$sql);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
@@ -260,7 +259,6 @@ class FormAdvTargetEmailing extends Form
}
// $sql.= ' WHERE entity = '.$conf->entity;
- dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
@@ -297,7 +295,7 @@ class FormAdvTargetEmailing extends Form
$sql = "SELECT rowid, code, label as civilite, active FROM ".MAIN_DB_PREFIX."c_civility";
$sql .= " WHERE active = 1";
- dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
+ dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -385,7 +383,7 @@ class FormAdvTargetEmailing extends Form
$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."categorie";
$sql .= " WHERE type=".$type;
- dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
+ dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -432,7 +430,7 @@ class FormAdvTargetEmailing extends Form
$sql .= " WHERE type_element='$type_element'";
$sql .= " ORDER BY c.name";
- dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
+ dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$out .= '
'.$tabstring;
- if ($shorturlwithoutparam) print '';
+ if ($shorturlwithoutparam) print '';
else print '';
print $menu_array[$i]['titre'];
if ($shorturlwithoutparam) print '';
diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php
index d6cae560298..9d66ae32e5f 100644
--- a/htdocs/core/modules/mailings/modules_mailings.php
+++ b/htdocs/core/modules/mailings/modules_mailings.php
@@ -187,7 +187,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$sql.= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").",";
$sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['lastname'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',";
$sql .= "'".$this->db->escape($targetarray['source_type'])."')";
- dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
+ dol_syslog(__METHOD__, LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
@@ -207,7 +207,7 @@ class MailingTargets // This can't be abstract as it is used for some method
}
}
- dol_syslog(get_class($this)."::".__METHOD__.": mailing ".$j." targets added");
+ dol_syslog(__METHOD__.": mailing ".$j." targets added");
/*
//Update the status to show thirdparty mail that don't want to be contacted anymore'
@@ -215,7 +215,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$sql .= " SET statut=3";
$sql .= " WHERE fk_mailing=".$mailing_id." AND email in (SELECT email FROM ".MAIN_DB_PREFIX."societe where fk_stcomm=-1)";
$sql .= " AND source_type='thirdparty'";
- dol_syslog(get_class($this)."::".__METHOD__.": mailing update status to display thirdparty mail that do not want to be contacted");
+ dol_syslog(__METHOD__.": mailing update status to display thirdparty mail that do not want to be contacted");
$result=$this->db->query($sql);
//Update the status to show contact mail that don't want to be contacted anymore'
@@ -223,7 +223,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$sql .= " SET statut=3";
$sql .= " WHERE fk_mailing=".$mailing_id." AND source_type='contact' AND (email in (SELECT sc.email FROM ".MAIN_DB_PREFIX."socpeople AS sc ";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid=sc.fk_soc WHERE s.fk_stcomm=-1 OR no_email=1))";
- dol_syslog(get_class($this)."::".__METHOD__.": mailing update status to display contact mail that do not want to be contacted",LOG_DEBUG);
+ dol_syslog(__METHOD__.": mailing update status to display contact mail that do not want to be contacted",LOG_DEBUG);
$result=$this->db->query($sql);
*/
@@ -231,7 +231,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$sql .= " SET statut=3";
$sql .= " WHERE fk_mailing=".$mailing_id." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))";
- dol_syslog(get_class($this)."::".__METHOD__.":mailing update status to display emails that do not want to be contacted anymore", LOG_DEBUG);
+ dol_syslog(__METHOD__.":mailing update status to display emails that do not want to be contacted anymore", LOG_DEBUG);
$result=$this->db->query($sql);
if (! $result)
{
diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php
index 5489e2b92ca..aa68fdeb698 100644
--- a/htdocs/core/modules/modProjet.class.php
+++ b/htdocs/core/modules/modProjet.class.php
@@ -217,17 +217,26 @@ class modProjet extends DolibarrModules
$this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('projecttask'=>'pt.rowid', 'task_time'=>'ptt.rowid');
- $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
- 's.phone'=>'Text','s.email'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
- 'p.rowid'=>"List:projet:ref::project",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.opp_amount'=>'Numeric','p.description'=>"Text",'p.entity'=>'Numeric',
- 'pt.rowid'=>'Numeric','pt.ref'=>'Text','pt.label'=>'Text','pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Numeric",'pt.progress'=>"Numeric",'pt.description'=>"Text",
- 'ptt.rowid'=>'Numeric','ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)",'ptt.note'=>"Text");
- $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
- 's.phone'=>'company','s.email'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company');
-
- $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
- 's.phone'=>'Phone','s.email'=>'Email','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
- 'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.title'=>'ProjectLabel', 'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'ProjectStatus','cls.code'=>'OpportunityStatus','p.opp_percent'=>'OpportunityProbability','p.opp_amount'=>'OpportunityAmount','p.description'=>"Description");
+ $this->export_TypeFields_array[$r]=array(
+ 's.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
+ 's.phone'=>'Text','s.email'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
+ 'p.rowid'=>"List:projet:ref::project",'p.ref'=>"Text",'p.title'=>"Text",
+ 'p.usage_opportunity'=>'Boolean', 'p.usage_task'=>'Boolean', 'p.usage_bill_time'=>'Boolean',
+ 'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.opp_amount'=>'Numeric','p.description'=>"Text",'p.entity'=>'Numeric',
+ 'pt.rowid'=>'Numeric','pt.ref'=>'Text','pt.label'=>'Text','pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Numeric",'pt.progress'=>"Numeric",'pt.description'=>"Text",
+ 'ptt.rowid'=>'Numeric','ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)",'ptt.note'=>"Text"
+ );
+ $this->export_entities_array[$r]=array(
+ 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
+ 's.phone'=>'company','s.email'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company'
+ );
+ $this->export_fields_array[$r]=array(
+ 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
+ 's.phone'=>'Phone','s.email'=>'Email','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
+ 'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.title'=>'ProjectLabel',
+ 'p.usage_opportunity'=>'ProjectFollowOpportunity', 'p.usage_task'=>'ProjectFollowTasks', 'p.usage_bill_time'=>'BillTime',
+ 'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'ProjectStatus','cls.code'=>'OpportunityStatus','p.opp_percent'=>'OpportunityProbability','p.opp_amount'=>'OpportunityAmount','p.description'=>"Description"
+ );
// Add multicompany field
if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED))
{
@@ -254,8 +263,11 @@ class modProjet extends DolibarrModules
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
// End add extra fields
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('ptt.rowid'=>'IdTaskTime','ptt.task_date'=>'TaskTimeDate','ptt.task_duration'=>"TimesSpent",'ptt.fk_user'=>"TaskTimeUser",'ptt.note'=>"TaskTimeNote"));
- $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('ptt.rowid'=>'task_time','ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time"));
-
+ $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('ptt.rowid'=>'task_time','ptt.task_date'=>'task_time','ptt.task_duration'=>"task_time",'ptt.fk_user'=>"task_time",'ptt.note'=>"task_time"));
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('f.ref'=>"Billed"));
+ $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r], array('f.ref'=>"task_time"));
+ }
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'projet as p';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object';
@@ -264,6 +276,9 @@ class modProjet extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid';
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture as f ON ptt.invoice_id = f.rowid';
+ }
$this->export_sql_end[$r] .=" WHERE p.entity IN (".getEntity('project').")";
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index f8767a82163..1ef3ef07255 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -73,7 +73,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
//print $key.'-'.$enabled.'-'.$perms.'-'.$label.$_POST["options_" . $key].' '."\n";
if (empty($enabled)) continue; // 0 = Never visible field
- if (abs($enabled) != 1 && abs($enabled) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
+ if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
if (empty($perms)) continue; // 0 = Not visible
// Load language if required
@@ -135,7 +135,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
if ($object->element == 'productlot') $permok = $user->rights->stock->creer;
if ($object->element == 'facturerec') $permok = $user->rights->facture->creer;
if (($object->statut == 0 || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key]))
- && $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key)
+ && $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $key)
&& empty($extrafields->attributes[$object->table_element]['computed'][$key]))
{
$fieldid = 'id';
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index b60c48da09c..6fd135af821 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -541,6 +541,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
}
+
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value
return true;
@@ -552,26 +553,26 @@ if (!empty($usemargins) && $user->rights->margins->creer)
/* JQuery for product free or predefined select */
jQuery(document).ready(function() {
- jQuery("#price_ht").keyup(function(event) {
- // console.log(event.which); // discard event tag and arrows
- if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#price_ht").val() != '') {
- jQuery("#price_ttc").val('');
- jQuery("#multicurrency_subprice").val('');
- }
+ jQuery("#price_ht").keyup(function(event) {
+ // console.log(event.which); // discard event tag and arrows
+ if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#price_ht").val() != '') {
+ jQuery("#price_ttc").val('');
+ jQuery("#multicurrency_subprice").val('');
+ }
});
jQuery("#price_ttc").keyup(function(event) {
- // console.log(event.which); // discard event tag and arrows
- if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
- jQuery("#price_ht").val('');
- jQuery("#multicurrency_subprice").val('');
- }
+ // console.log(event.which); // discard event tag and arrows
+ if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
+ jQuery("#price_ht").val('');
+ jQuery("#multicurrency_subprice").val('');
+ }
});
jQuery("#multicurrency_subprice").keyup(function(event) {
- // console.log(event.which); // discard event tag and arrows
- if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
- jQuery("#price_ht").val('');
- jQuery("#price_ttc").val('');
- }
+ // console.log(event.which); // discard event tag and arrows
+ if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
+ jQuery("#price_ht").val('');
+ jQuery("#price_ttc").val('');
+ }
});
$("#prod_entry_mode_free").on( "click", function() {
@@ -630,15 +631,24 @@ if (!empty($usemargins) && $user->rights->margins->creer)
if (empty($conf->global->MAIN_DISABLE_EDIT_PREDEF_PRICEHT) && empty($senderissupplier))
{
?>
- // Get the HT price for the product and display it
- console.log("Load price without tax and set it into #price_ht");
- $.post('/product/ajax/products.php?action=fetch',
- { 'id': $(this).val(), 'socid' : socid; ?> },
- function(data) { jQuery("#price_ht").val(data.price_ht); },
- 'json'
- );
+ var pbq = parseInt($('option:selected', this).attr('data-pbq'));
+ if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
+ {
+ console.log("We are in a price per qty context, we do not call ajax/product");
+ } else {
+ // Get the HT price for the product and display it
+ console.log("Load price without tax and set it into #price_ht for id="+$(this).val()+" socid=socid; ?>");
+ $.post('/product/ajax/products.php?action=fetch',
+ { 'id': $(this).val(), 'socid': socid; ?> },
+ function(data) {
+ jQuery("#price_ht").val(data.price_ht);
+ },
+ 'json'
+ );
+ }
rights->margins->creer)
{
$langs->load('stocks');
@@ -744,15 +754,20 @@ if (!empty($usemargins) && $user->rights->margins->creer)
}
?>
- /* To process customer price per quantity */
+ /* To process customer price per quantity (CUSTOMER_PRICE_PER_QTY works only if combo product is not an ajax after x key pressed) */
var pbq = parseInt($('option:selected', this).attr('data-pbq'));
+ var pbqup = parseInt($('option:selected', this).attr('data-pbqup'));
+ var pbqbase = $('option:selected', this).attr('data-pbqbase');
var pbqqty = parseFloat($('option:selected', this).attr('data-pbqqty'));
var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
- if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && typeof pbq !== "undefined")
+ if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
{
- console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
+ var pbqupht = pbqup; /* TODO support of price per qty TTC not yet available */
+
+ console.log("We choose a price by quanty price_by_qty id = "+pbq+" price_by_qty upht = "+pbqupht+" price_by_qty qty = "+pbqqty+" price_by_qty percent = "+pbqpercent);
jQuery("#pbq").val(pbq);
+ jQuery("#price_ht").val(pbqupht);
if (jQuery("#qty").val() < pbqqty)
{
jQuery("#qty").val(pbqqty);
@@ -809,7 +824,6 @@ if (!empty($usemargins) && $user->rights->margins->creer)
jQuery("#price_ht").val('').hide();
jQuery("#multicurrency_price_ht").val('').hide();
- jQuery("#price_ht").val('');
jQuery("#price_ttc, #fourn_ref, #tva_tx, #title_vat, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").hide();
jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide();
jQuery("#buying_price").show();
diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
index b50008dba2e..0ee3cdb73ab 100644
--- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
+++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
@@ -1,10 +1,11 @@
- * Copyright (C) 2009-2017 Regis Houssin
- * Copyright (C) 2011-2014 Juanjo Menent
- * Copyright (C) 2013 Cedric GROSS
- * Copyright (C) 2014 Marcos García
- * Copyright (C) 2015 Bahfir Abbes
+/*
+ * Copyright (C) 2005-2017 Laurent Destailleur
+ * Copyright (C) 2009-2017 Regis Houssin
+ * Copyright (C) 2011-2014 Juanjo Menent
+ * Copyright (C) 2013 Cedric GROSS
+ * Copyright (C) 2014 Marcos García
+ * Copyright (C) 2015 Bahfir Abbes
*
* 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
@@ -13,7 +14,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
@@ -21,29 +22,31 @@
*/
/**
- * \file htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
- * \ingroup agenda
- * \brief Trigger file for company - contactroles
+ * \file htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
+ * \ingroup agenda
+ * \brief Trigger file for company - contactroles
*/
-
-require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
-
+require_once DOL_DOCUMENT_ROOT . '/core/triggers/dolibarrtriggers.class.php';
/**
- * Class of triggered functions for agenda module
+ * Class of triggered functions for agenda module
*/
class InterfaceContactRoles extends DolibarrTriggers
{
+
public $family = 'agenda';
+
public $description = "Triggers of this module auto link contact to company.";
/**
* Version of the trigger
+ *
* @var string
*/
public $version = self::VERSION_DOLIBARR;
/**
+ *
* @var string Image of the trigger
*/
public $picto = 'action';
@@ -53,56 +56,56 @@ class InterfaceContactRoles extends DolibarrTriggers
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
*
* Following properties may be set before calling trigger. The may be completed by this trigger to be used for writing the event into database:
- * $object->socid or $object->fk_soc(id of thirdparty)
- * $object->element (element type of object)
+ * $object->socid or $object->fk_soc(id of thirdparty)
+ * $object->element (element type of object)
*
- * @param string $action Event action code
- * @param Object $object Object
- * @param User $user Object user
- * @param Translate $langs Object langs
- * @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @param string $action Event action code
+ * @param Object $object Object
+ * @param User $user Object user
+ * @param Translate $langs Object langs
+ * @param conf $conf Object conf
+ * @return int <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
+ if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE'
+ || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' || $action === 'PROPOSAL_SUPPLIER_CREATE'
+ || $action === 'CONTRACT_CREATE' || $action === 'FICHINTER_CREATE' || $action === 'PROJECT_CREATE' || $action === 'TICKET_CREATE') {
+ dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
- if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE' || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE'
- || $action === 'CONTRACT_CREATE' || $action === 'FICHINTER_CREATE' || $action === 'PROJECT_CREATE' || $action === 'TICKET_CREATE' || $action === 'ACTION_CREATE') {
- dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
-
- $socid=(property_exists($object, 'socid')?$object->socid:$object->fk_soc);
+ $socid = (property_exists($object, 'socid') ? $object->socid : $object->fk_soc);
if (! empty($socid) && $socid > 0) {
- require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contactdefault = new Contact($this->db);
- $contactdefault->socid=$socid;
+ $contactdefault->socid = $socid;
$TContact = $contactdefault->getContactRoles($object->element);
- $TContactAlreadyLinked = array();
- if ($object->id > 0)
- {
- $class = get_class($object);
- $cloneFrom = new $class($this->db);
- $r = $cloneFrom->fetch($object->id);
+ if (is_array($TContact) && ! empty($TContact)) {
+ $TContactAlreadyLinked = array();
+ if ($object->id > 0) {
+ $cloneFrom = dol_clone($object, 1);
- if (!empty($cloneFrom->id)) $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(-1, 'external'), $cloneFrom->liste_contact(-1, 'internal'));
- }
+ if (! empty($cloneFrom->id)) {
+ $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(- 1, 'external'), $cloneFrom->liste_contact(- 1, 'internal'));
+ }
+ }
- if (is_array($TContact))
- {
- foreach($TContact as $i => $infos) {
+ foreach ($TContact as $i => $infos) {
foreach ($TContactAlreadyLinked as $contactData) {
- if ($contactData['id'] == $infos['fk_socpeople'] && $contactData['fk_c_type_contact'] == $infos['type_contact']) unset($TContact[$i]);
+ if ($contactData['id'] == $infos['fk_socpeople'] && $contactData['fk_c_type_contact'] == $infos['type_contact'])
+ unset($TContact[$i]);
}
}
$nb = 0;
- foreach($TContact as $infos) {
+ foreach ($TContact as $infos) {
$res = $object->add_contact($infos['fk_socpeople'], $infos['type_contact']);
- if ($res > 0) $nb++;
+ if ($res > 0)
+ $nb ++;
}
- if($nb > 0) {
+ if ($nb > 0) {
setEventMessages($langs->trans('ContactAddedAutomatically', $nb), null, 'mesgs');
}
}
diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php
index b43fddad60d..5e6be580742 100644
--- a/htdocs/exports/class/export.class.php
+++ b/htdocs/exports/class/export.class.php
@@ -547,7 +547,7 @@ class Export
$indice=0;
asort($array_selected);
- dol_syslog(get_class($this)."::".__FUNCTION__." ".$model.", ".$datatoexport.", ".implode(",", $array_selected));
+ dol_syslog(__METHOD__." ".$model.", ".$datatoexport.", ".implode(",", $array_selected));
// Check parameters or context properties
if (empty($this->array_export_fields) || ! is_array($this->array_export_fields))
@@ -588,7 +588,7 @@ class Export
// Run the sql
$this->sqlusedforexport=$sql;
- dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG);
+ dol_syslog(__METHOD__."", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index 5373ea3a3b2..1e5c26d5b03 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Load translation files required by the page
-$langs->loadlangs(array('admin', 'exports', 'other', 'users', 'companies', 'projects', 'suppliers', 'products', 'bank'));
+$langs->loadlangs(array('admin', 'exports', 'other', 'users', 'companies', 'projects', 'suppliers', 'products', 'bank', 'bills'));
// Everybody should be able to go on this page
//if (! $user->admin)
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index b09b67ba1d3..b6720a93e57 100644
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -159,17 +159,14 @@ else
/*
* Legends / Status
- *
- * Motivo: Mostrar todos os Status e dar a possibilidade de filtrar apenas um deles
- * Reason: Show all Status and give the possibility to filter only one
*/
-$sql = "SELECT count(cf.rowid), fk_statut";
+$sql = "SELECT count(cf.rowid) as nb, cf.fk_statut";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE cf.fk_soc = s.rowid";
-$sql .= " AND s.entity = ".$conf->entity;
+$sql.= " AND cf.entity IN (".getEntity("supplier_order").")"; // Thirdparty sharing is mandatory with supplier order sharing
if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " GROUP BY cf.fk_statut";
@@ -189,11 +186,11 @@ if ($resql)
while ($i < $num)
{
- $row = $db->fetch_row($resql);
+ $obj = $db->fetch_object($resql);
print '
";
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index ffdfb07baa0..6ab40c3924c 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -917,6 +917,10 @@ if (empty($reshook))
}
}
}
+ elseif (!empty($object->origin) && !empty($object->origin_id))
+ {
+ $object->linkedObjectsIds[$object->origin] = $object->origin_id;
+ }
$id = $object->create($user);
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index e9198ebcc91..19fed7a3387 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -297,9 +297,13 @@ if (empty($reshook))
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array of amounts
$paiement->multicurrency_amounts = $multicurrency_amounts;
- $paiement->paiementid = $_POST['paiementid'];
- $paiement->num_paiement = $_POST['num_paiement'];
- $paiement->note = $_POST['comment'];
+ $paiement->paiementid = GETPOST('paiementid', 'int');
+
+ $paiement->num_payment = GETPOST('num_paiement', 'alpha');
+ $paiement->note_private = GETPOST('comment', 'alpha');
+ $paiement->num_paiement = $paiement->num_payment; // For bacward compatibility
+ $paiement->note = $paiement->note_private; // For bacward compatibility
+
if (!$error)
{
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices') == 'on' ? 1 : 0), $thirdparty);
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 0bf914d0e22..3fde658960e 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1973,4 +1973,5 @@ NotAPublicIp=Not a public IP
MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation.
FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
EmailTemplate=Template for email
-EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax
\ No newline at end of file
+EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax
+FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
\ No newline at end of file
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 43331220bd0..8f8480a03cb 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -352,6 +352,8 @@ PriceUTTC=U.P. (inc. tax)
Amount=Amount
AmountInvoice=Invoice amount
AmountInvoiced=Amount invoiced
+AmountInvoicedHT=Amount invoiced (incl. tax)
+AmountInvoicedTTC=Amount invoiced (excl. tax)
AmountPayment=Payment amount
AmountHTShort=Amount (excl.)
AmountTTCShort=Amount (inc. tax)
@@ -1010,7 +1012,7 @@ ContactDefault_project=Project
ContactDefault_project_task=Task
ContactDefault_propal=Proposal
ContactDefault_supplier_proposal=Supplier Proposal
-ContactDefault_ticketsup=Ticket
+ContactDefault_ticket=Ticket
ContactAddedAutomatically=Contact added from contact thirdparty roles
More=More
ShowDetails=Show details
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index b9293b6187c..6f3994572c6 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -363,7 +363,7 @@ UsePercentageVariations=Use percentage variations
PercentageVariation=Percentage variation
ErrorDeletingGeneratedProducts=There was an error while trying to delete existing product variants
NbOfDifferentValues=No. of different values
-NbProducts=No. of products
+NbProducts=Number of products
ParentProduct=Parent product
HideChildProducts=Hide variant products
ShowChildProducts=Show variant products
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 55f70e68b21..9c1f5029604 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -39,8 +39,8 @@ ShowProject=Show project
ShowTask=Show task
SetProject=Set project
NoProject=No project defined or owned
-NbOfProjects=No. of projects
-NbOfTasks=No. of tasks
+NbOfProjects=Number of projects
+NbOfTasks=Number of tasks
TimeSpent=Time spent
TimeSpentByYou=Time spent by you
TimeSpentByUser=Time spent by user
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 01a999c6a8b..438dbcda4ec 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -2031,7 +2031,7 @@ function top_menu_search()
-
+
'.$dropDownHtml.'
';
@@ -2062,7 +2062,8 @@ function top_menu_search()
// close drop down
$(document).on("click", function(event) {
- if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
+ if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
+ console.log("click close");
// Hide the menus.
$("#topmenu-global-search-dropdown").removeClass("open");
}
@@ -2070,6 +2071,7 @@ function top_menu_search()
// Open drop down
$("#topmenu-global-search-dropdown .dropdown-toggle").on("click", function(event) {
+ console.log("click open");
openGlobalSearchDropDown();
});
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 9d126ca96d9..e80ea9e6984 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1235,10 +1235,10 @@ else
// Accountancy_code_sell
print '
';
}
diff --git a/htdocs/public/error-401.php b/htdocs/public/error-401.php
index d6a6ed548ff..ac921fc9f78 100644
--- a/htdocs/public/error-401.php
+++ b/htdocs/public/error-401.php
@@ -21,7 +21,7 @@
Sorry. You are not allowed to access this resource.
-
+
diff --git a/htdocs/public/error-404.php b/htdocs/public/error-404.php
index 36547d26704..34a4ac03e9e 100644
--- a/htdocs/public/error-404.php
+++ b/htdocs/public/error-404.php
@@ -21,7 +21,7 @@
You requested a website or a page that does not exists.
-
+
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index f0206175d0d..6ae3f0cac28 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -238,7 +238,10 @@ $max = 15;
$sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur";
$sql .= ", s.code_client";
$sql .= ", s.code_fournisseur";
+$sql .= ", s.code_compta_fournisseur";
+$sql .= ", s.code_compta";
$sql .= ", s.logo";
+$sql .= ", s.entity";
$sql .= ", s.canvas, s.tms as date_modification, s.status as status";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -285,6 +288,9 @@ if ($result)
$thirdparty_static->code_fournisseur = $objp->code_fournisseur;
$thirdparty_static->canvas = $objp->canvas;
$thirdparty_static->email = $objp->email;
+ $thirdparty_static->entity = $objp->entity;
+ $thirdparty_static->code_compta_fournisseur = $objp->code_compta_fournisseur;
+ $thirdparty_static->code_compta = $objp->code_compta;
print '
';
// Name
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 47a116c7fdf..e480d68eca4 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -10,6 +10,7 @@
* Copyright (C) 2017 Rui Strecht
* Copyright (C) 2017 Juanjo Menent
* Copyright (C) 2018 Nicolas ZABOURI
+
*
* 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
@@ -390,6 +391,7 @@ if ($resql)
else dol_print_error($db);
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,";
+$sql.= " s.entity,";
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
$sql.= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
$sql.= " s.tms as date_update, s.datec as date_creation,";
@@ -1026,6 +1028,7 @@ while ($i < min($num, $limit))
$companystatic->fk_prospectlevel = $obj->fk_prospectlevel;
$companystatic->fk_parent = $obj->fk_parent;
+ $companystatic->entity = $obj->entity;
print '
call_trigger('PROPAL_SUPPLIER_CREATE', $user);
+ $result = $this->call_trigger('PROPOSAL_SUPPLIER_CREATE', $user);
if ($result < 0) { $error++; }
// End call triggers
}
@@ -2834,7 +2834,7 @@ class SupplierProposalLine extends CommonObjectLine
// From llx_product
/**
* @deprecated
- * @see product_ref
+ * @see $product_ref
*/
public $ref;
diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php
index fb8856d4687..63b7a268440 100644
--- a/htdocs/theme/eldy/dropdown.inc.php
+++ b/htdocs/theme/eldy/dropdown.inc.php
@@ -5,10 +5,60 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
* Dropdown of user popup
*/
-.open>.dropdown-menu{
+button.dropdown-item.global-search-item {
+ outline: none;
+}
+
+.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu{
display: block;
}
+.dropdown-search {
+ border-color: #eee;
+
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1000;
+ display: none;
+ float: left;
+ min-width: 160px;
+ margin: 2px 0 0;
+ font-size: 14px;
+ text-align: left;
+ list-style: none;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0,0,0,.15);
+ border-radius: 4px;
+ -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
+ box-shadow: 0 6px 12px rgba(0,0,0,.175);
+}
+.dropdown-bookmark {
+ border-color: #eee;
+
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1000;
+ display: none;
+ float: left;
+ min-width: 160px;
+ margin: 2px 0 0;
+ font-size: 14px;
+ text-align: left;
+ list-style: none;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0,0,0,.15);
+ border-radius: 4px;
+ -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
+ box-shadow: 0 6px 12px rgba(0,0,0,.175);
+}
.dropdown-menu {
border-color: #eee;
@@ -34,7 +84,6 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
}
-
.dropdown-toggle{
text-decoration: none !important;
}
@@ -177,7 +226,8 @@ a.top-menu-dropdown-link {
.dropdown-body::-webkit-scrollbar-thumb {
-webkit-border-radius: 0;
border-radius: 0;
- background: rgb();
+ /* background: rgb(); */
+ background: #aaa;
}
.dropdown-body::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 670734e6706..fa4f751d6a6 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -1539,6 +1539,7 @@ div#id-top {
background: rgb();
background-image: linear-gradient(-45deg, , rgb());
+ /* box-shadow: 0px 0px 5px #eee; */
}
@@ -4764,6 +4765,11 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
+.select2-container--default .select2-results__option--highlighted[aria-selected] {
+ background-color: rgb();
+ color: #;
+}
+
.select2-container--focus span.select2-selection.select2-selection--single {
border-bottom: 1px solid #666 !important;
}
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 188a6b59d31..9ff7bd56634 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -289,7 +289,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
* Last salaries
*/
if (!empty($conf->salaries->enabled) &&
- ($user->rights->salaries->read && $object->id == $user->id)
+ ( ($object->fk_user == $user->id) || ($user->rights->salaries->read && $object->id == $user->id) )
)
{
$salary = new PaymentSalary($db);
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 9bfe66d9dec..cc405571990 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -3347,7 +3347,7 @@ class User extends CommonObject
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) $sql .= $this->db->plimit($limit + 1, $offset);
- dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
+ dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php
index e7f232e1049..733071c0f58 100644
--- a/test/phpunit/CodingPhpTest.php
+++ b/test/phpunit/CodingPhpTest.php
@@ -158,6 +158,19 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$filecontent=file_get_contents($file['fullname']);
+ $ok=true;
+ $matches=array();
+ // Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
+ preg_match_all('/'.preg_quote('get_class($this)."::".__METHOD__', '/').'/', $filecontent, $matches, PREG_SET_ORDER);
+ foreach($matches as $key => $val)
+ {
+ $ok=false;
+ break;
+ }
+ //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n";
+ $this->assertTrue($ok, 'Found string get_class($this)."::".__METHOD__ that must be replaced with __METHOD__ only in '.$file['fullname']);
+ //exit;
+
$ok=true;
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.