*
* 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
@@ -47,11 +48,11 @@ if (! $sortorder) $sortorder="ASC";
$mode = GETPOST("mode");
$filter=GETPOST("filter");
-$search_name=GETPOST("search_name");
-$search_contract=GETPOST("search_contract");
-$search_service=GETPOST("search_service");
-$search_status=GETPOST("search_status", "alpha");
-$statut=GETPOST('statut')?GETPOST('statut'):1;
+$search_name=GETPOST("search_name", 'alpha');
+$search_contract=GETPOST("search_contract", 'alpha');
+$search_service=GETPOST("search_service", 'alpha');
+$search_status=GETPOST("search_status", 'alpha');
+$statut=GETPOST('statut', 'int')?GETPOST('statut', 'int'):1;
$search_product_category=GETPOST('search_product_category', 'int');
$socid=GETPOST('socid', 'int');
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'contractservicelist'.$mode;
@@ -61,20 +62,20 @@ $opouvertureprevueday=GETPOST('opouvertureprevueday');
$opouvertureprevueyear=GETPOST('opouvertureprevueyear');
$filter_opouvertureprevue=GETPOST('filter_opouvertureprevue');
-$op1month=GETPOST('op1month');
-$op1day=GETPOST('op1day');
-$op1year=GETPOST('op1year');
-$filter_op1=GETPOST('filter_op1');
+$op1month=GETPOST('op1month', 'int');
+$op1day=GETPOST('op1day', 'int');
+$op1year=GETPOST('op1year', 'int');
+$filter_op1=GETPOST('filter_op1', 'alpha');
-$op2month=GETPOST('op2month');
-$op2day=GETPOST('op2day');
-$op2year=GETPOST('op2year');
-$filter_op2=GETPOST('filter_op2');
+$op2month=GETPOST('op2month', 'int');
+$op2day=GETPOST('op2day', 'int');
+$op2year=GETPOST('op2year', 'int');
+$filter_op2=GETPOST('filter_op2', 'alpha');
-$opcloturemonth=GETPOST('opcloturemonth');
-$opclotureday=GETPOST('opclotureday');
-$opclotureyear=GETPOST('opclotureyear');
-$filter_opcloture=GETPOST('filter_opcloture');
+$opcloturemonth=GETPOST('opcloturemonth', 'int');
+$opclotureday=GETPOST('opclotureday', 'int');
+$opclotureyear=GETPOST('opclotureyear', 'int');
+$filter_opcloture=GETPOST('filter_opcloture', 'alpha');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -523,7 +524,7 @@ if (! empty($arrayfields['status']['checked']))
print '';
}
// Action column
-print '';
+print ' ';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
print ' ';
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index af2093481c3..836652ea819 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -43,7 +43,7 @@ if (GETPOST('addfile', 'alpha'))
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
- dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0);
+ dol_add_file_process($upload_dir_tmp, 1, 0, 'addedfile', '', null, $trackid, 0);
$action='presend';
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 57f2a7ef97c..ab29a100894 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1227,12 +1227,12 @@ abstract class CommonObject
$result=array();
$i=0;
//cas particulier pour les expeditions
- if($this->element=='shipping' && $this->origin_id != 0) {
+ if ($this->element=='shipping' && $this->origin_id != 0) {
$id=$this->origin_id;
$element='commande';
- } elseif($this->element=='reception' && $this->origin_id != 0) {
- $id=$this->origin_id;
- $element='order_supplier';
+ } elseif ($this->element=='reception' && $this->origin_id != 0) {
+ $id=$this->origin_id;
+ $element='order_supplier';
} else {
$id=$this->id;
$element=$this->element;
@@ -2086,25 +2086,25 @@ abstract class CommonObject
* Change the shipping method
*
* @param int $shipping_method_id Id of shipping method
- * @param bool $notrigger false=launch triggers after, true=disable triggers
- * @param User $userused Object user
+ * @param bool $notrigger false=launch triggers after, true=disable triggers
+ * @param User $userused Object user
*
* @return int 1 if OK, 0 if KO
*/
public function setShippingMethod($shipping_method_id, $notrigger = false, $userused = null)
{
- global $user;
+ global $user;
- if (empty($userused)) $userused=$user;
+ if (empty($userused)) $userused=$user;
- $error = 0;
+ $error = 0;
if (! $this->table_element) {
dol_syslog(get_class($this)."::setShippingMethod was called on objet with property table_element not defined", LOG_ERR);
return -1;
}
- $this->db->begin();
+ $this->db->begin();
if ($shipping_method_id<0) $shipping_method_id='NULL';
dol_syslog(get_class($this).'::setShippingMethod('.$shipping_method_id.')');
@@ -2112,30 +2112,30 @@ abstract class CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_shipping_method = ".$shipping_method_id;
$sql.= " WHERE rowid=".$this->id;
- $resql = $this->db->query($sql);
+ $resql = $this->db->query($sql);
if (! $resql) {
dol_syslog(get_class($this).'::setShippingMethod Error ', LOG_DEBUG);
$this->error = $this->db->lasterror();
$error++;
- } else {
- if (!$notrigger)
- {
- // Call trigger
- $this->context=array('shippingmethodupdate'=>1);
- $result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
- if ($result < 0) $error++;
- // End call trigger
- }
- }
- if ($error)
- {
- $this->db->rollback();
- return -1;
- } else {
- $this->shipping_method_id = ($shipping_method_id=='NULL')?null:$shipping_method_id;
- $this->db->commit();
- return 1;
- }
+ } else {
+ if (!$notrigger)
+ {
+ // Call trigger
+ $this->context=array('shippingmethodupdate'=>1);
+ $result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
+ if ($result < 0) $error++;
+ // End call trigger
+ }
+ }
+ if ($error)
+ {
+ $this->db->rollback();
+ return -1;
+ } else {
+ $this->shipping_method_id = ($shipping_method_id=='NULL')?null:$shipping_method_id;
+ $this->db->commit();
+ return 1;
+ }
}
@@ -2217,17 +2217,17 @@ abstract class CommonObject
*/
public function setBankAccount($fk_account, $notrigger = false, $userused = null)
{
- global $user;
+ global $user;
- if (empty($userused)) $userused=$user;
+ if (empty($userused)) $userused=$user;
- $error = 0;
+ $error = 0;
if (! $this->table_element) {
dol_syslog(get_class($this)."::setBankAccount was called on objet with property table_element not defined", LOG_ERR);
return -1;
}
- $this->db->begin();
+ $this->db->begin();
if ($fk_account<0) $fk_account='NULL';
dol_syslog(get_class($this).'::setBankAccount('.$fk_account.')');
@@ -2236,36 +2236,36 @@ abstract class CommonObject
$sql.= " SET fk_account = ".$fk_account;
$sql.= " WHERE rowid=".$this->id;
- $resql = $this->db->query($sql);
- if (! $resql)
- {
- dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error());
- $this->error = $this->db->lasterror();
- $error++;
- }
- else
- {
- if (!$notrigger)
- {
- // Call trigger
- $this->context=array('bankaccountupdate'=>1);
- $result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
- if ($result < 0) $error++;
- // End call trigger
- }
- }
- if ($error)
- {
- $this->db->rollback();
- return -1;
- }
- else
- {
- $this->fk_account = ($fk_account=='NULL')?null:$fk_account;
- $this->db->commit();
- return 1;
- }
- }
+ $resql = $this->db->query($sql);
+ if (! $resql)
+ {
+ dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error());
+ $this->error = $this->db->lasterror();
+ $error++;
+ }
+ else
+ {
+ if (!$notrigger)
+ {
+ // Call trigger
+ $this->context=array('bankaccountupdate'=>1);
+ $result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused);
+ if ($result < 0) $error++;
+ // End call trigger
+ }
+ }
+ if ($error)
+ {
+ $this->db->rollback();
+ return -1;
+ }
+ else
+ {
+ $this->fk_account = ($fk_account=='NULL')?null:$fk_account;
+ $this->db->commit();
+ return 1;
+ }
+ }
// TODO: Move line related operations to CommonObjectLine?
@@ -2967,7 +2967,7 @@ abstract class CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Add objects linked in llx_element_element.
*
@@ -2978,7 +2978,7 @@ abstract class CommonObject
*/
public function add_object_linked($origin = null, $origin_id = null)
{
- // phpcs:enable
+ // phpcs:enable
$origin = (! empty($origin) ? $origin : $this->origin);
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
@@ -2986,7 +2986,7 @@ abstract class CommonObject
if ($origin == 'order') $origin='commande';
if ($origin == 'invoice') $origin='facture';
if ($origin == 'invoice_template') $origin='facturerec';
- if ($origin == 'supplierorder') $origin='order_supplier';
+ if ($origin == 'supplierorder') $origin='order_supplier';
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
@@ -3003,16 +3003,16 @@ abstract class CommonObject
dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
if ($this->db->query($sql))
- {
- $this->db->commit();
- return 1;
- }
- else
- {
- $this->error=$this->db->lasterror();
- $this->db->rollback();
- return 0;
- }
+ {
+ $this->db->commit();
+ return 1;
+ }
+ else
+ {
+ $this->error=$this->db->lasterror();
+ $this->db->rollback();
+ return 0;
+ }
}
/**
@@ -3649,10 +3649,11 @@ abstract class CommonObject
{
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
$totalToShip+=$line->qty_shipped; // defined for shipment only
- }elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
- {
- if (empty($totalToShip)) $totalToShip=0;
- $totalToShip+=$line->qty; // defined for reception only
+ }
+ elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
+ {
+ if (empty($totalToShip)) $totalToShip=0;
+ $totalToShip+=$line->qty; // defined for reception only
}
// Define qty, weight, volume, weight_units, volume_units
@@ -3912,7 +3913,7 @@ abstract class CommonObject
// Define usemargins
$usemargins=0;
- if (! empty($conf->margin->enabled) && ! empty($this->element) && in_array($this->element, array('facture','propal','commande'))) $usemargins=1;
+ if (! empty($conf->margin->enabled) && ! empty($this->element) && in_array($this->element, array('facture','facturerec','propal','commande'))) $usemargins=1;
$num = count($this->lines);
@@ -4271,7 +4272,7 @@ abstract class CommonObject
$productstatic->id = $line->fk_product;
$productstatic->ref = $line->ref;
$productstatic->type = $line->fk_product_type;
- if(empty($productstatic->ref)){
+ if (empty($productstatic->ref)) {
$line->fetch_product();
$productstatic = $line->product;
}
@@ -4637,14 +4638,14 @@ abstract class CommonObject
if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true;
}
if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) {
- $setsharekey=true;
- }
+ $setsharekey=true;
+ }
if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) {
- $setsharekey=true;
- }
+ $setsharekey=true;
+ }
if ($this->element == 'bank_account' && ! empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD)) {
- $setsharekey=true;
- }
+ $setsharekey=true;
+ }
if ($setsharekey)
{
@@ -4807,7 +4808,7 @@ abstract class CommonObject
/* For triggers */
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Call trigger based on this instance.
* Some context information may also be provided into array property this->context.
@@ -4818,9 +4819,9 @@ abstract class CommonObject
* @param User $user Object user
* @return int Result of run_triggers
*/
- public function call_trigger($trigger_name, $user)
+ public function call_trigger($trigger_name, $user)
{
- // phpcs:enable
+ // phpcs:enable
global $langs,$conf;
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@@ -4845,7 +4846,7 @@ abstract class CommonObject
/* Functions for extrafields */
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to get extra fields of an object into $this->array_options
* This method is in most cases called by method fetch of objects but you can call it separately.
@@ -4854,9 +4855,9 @@ abstract class CommonObject
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
*/
- public function fetch_optionals($rowid = null, $optionsArray = null)
+ public function fetch_optionals($rowid = null, $optionsArray = null)
{
- // phpcs:enable
+ // phpcs:enable
if (empty($rowid)) $rowid=$this->id;
// To avoid SQL errors. Probably not the better solution though
@@ -5484,7 +5485,7 @@ abstract class CommonObject
elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
{
$morecss = 'maxwidth75';
- } elseif ($type == 'url') {
+ } elseif ($type == 'url') {
$morecss='minwidth400';
}
elseif ($type == 'boolean')
@@ -7178,8 +7179,8 @@ abstract class CommonObject
* @param array $fieldsentry Properties of field
* @return string
*/
- protected function quote($value, $fieldsentry)
- {
+ protected function quote($value, $fieldsentry)
+ {
if (is_null($value)) return 'NULL';
elseif (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
else return "'".$this->db->escape($value)."'";
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index d3ca2c6126f..a92b876989f 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -640,6 +640,10 @@ class Conf
$this->expensereport->payment = new stdClass();
$this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60;
}
+ if (isset($this->holiday)) {
+ $this->holiday->approve = new stdClass();
+ $this->holiday->approve->warning_delay=(isset($this->global->MAIN_DELAY_HOLIDAYS)?$this->global->MAIN_DELAY_HOLIDAYS:0)*24*60*60;
+ }
if (! empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT))
{
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index d947d7c129b..d70a63293c5 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -91,7 +91,7 @@ class DolGraph
public function __construct($library = 'jflot')
{
global $conf;
- global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
+ global $theme_bordercolor, $theme_datacolor, $theme_bgcolor;
// To use old feature
if ($library == 'artichow')
@@ -883,7 +883,6 @@ class DolGraph
private function draw_jflot($file, $fileurl)
{
// phpcs:enable
- global $artichow_defaultfont;
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index caea57280b9..22e9dbf663c 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1276,14 +1276,16 @@ class ExtraFields
$labeltoshow = dol_trunc($labeltoshow, 45);
if ($value == $obj->rowid) {
- foreach ($fields_label as $field_toshow) {
- $translabel = $langs->trans($obj->$field_toshow);
- if ($translabel != $obj->$field_toshow) {
- $labeltoshow = dol_trunc($translabel, 18) . ' ';
- } else {
- $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
- }
- }
+ if (!$notrans) {
+ foreach ($fields_label as $field_toshow) {
+ $translabel = $langs->trans($obj->$field_toshow);
+ if ($translabel != $obj->$field_toshow) {
+ $labeltoshow = dol_trunc($translabel, 18) . ' ';
+ } else {
+ $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
+ }
+ }
+ }
$out .= '' . $labeltoshow . ' ';
} else {
if (!$notrans) {
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c86874cdde9..e7d8742a3f5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -103,7 +103,7 @@ class Form
* @return string HTML edit field
*/
public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id')
- {
+ {
global $conf,$langs;
$ret='';
@@ -144,7 +144,7 @@ class Form
}
return $ret;
- }
+ }
/**
* Output value of a field for an editable field
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index c9c1bc3d782..31353ea3d10 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -205,9 +205,7 @@ class FormActions
$newcardbutton='';
if (! empty($conf->agenda->enabled))
{
- $newcardbutton = ''.$langs->trans("AddEvent").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:($socid>0?'&socid='.$socid:'')).($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage));
}
print ''."\n";
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 858d16948e2..9b8801aa4cc 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1830,7 +1830,7 @@ class FormFile
print '' . dol_print_date($link->datea, "dayhour", "tzuser") . ' ';
print ' ';
print '';
- print '' . img_edit() . ' '; // id= is included into $param
+ print '' . img_edit() . ' '; // id= is included into $param
if ($permtodelete) {
print ' ' . img_delete() . ' '; // id= is included into $param
} else {
diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php
index f022d2c3791..f9b0a59280f 100644
--- a/htdocs/core/class/html.formmargin.class.php
+++ b/htdocs/core/class/html.formmargin.class.php
@@ -96,7 +96,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
}
- $pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
+ $pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 243e943143e..6635220cc23 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1044,9 +1044,9 @@ function unActivateModule($value, $requiredby = 1)
$result=$objMod->remove();
if ($result <= 0) $ret=$objMod->error;
}
- else
+ else // We come here when we try to unactivate a module when module does not exists anymore in sources
{
- //print $dir.$modFile;
+ //print $dir.$modFile;exit;
// TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
$genericMod = new DolibarrModules($db);
@@ -1054,11 +1054,11 @@ function unActivateModule($value, $requiredby = 1)
$genericMod->rights_class=strtolower(preg_replace('/^mod/i', '', $modName));
$genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', $modName));
dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName);
- $genericMod->_remove(array());
+ $genericMod->remove('');
}
- // Desactivation des modules qui dependent de lui
- if (! $ret && $requiredby)
+ // Disable modules that depends on module we disable
+ if (! $ret && $requiredby && is_object($objMod) && is_array($objMod->requiredby))
{
$countrb=count($objMod->requiredby);
for ($i = 0; $i < $countrb; $i++)
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index d6fe993aa2d..e080cc89796 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -730,9 +730,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$newcardbutton='';
if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink))
{
- $newcardbutton=''.$langs->trans("AddProject").' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";
@@ -934,9 +932,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
if ($user->rights->societe->contact->creer)
{
$addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
- $newcardbutton=''.$addcontact.' ';
- $newcardbutton.= ' ';
- $newcardbutton.= ' ';
+ $newcardbutton.= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
print "\n";
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index c7585b65254..8ad47bd4444 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1557,7 +1557,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$info = pathinfo($destfull);
$destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
$info = pathinfo($destfile);
+
$destfile = dol_sanitizeFileName($info['filename'].($info['extension']!='' ? ('.'.strtolower($info['extension'])) : ''));
+ // We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
+ // this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
+ $destfile = dol_string_nohtmltag($destfile);
+ $destfull = dol_string_nohtmltag($destfull);
+
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 3ee0cd1f3e1..f6e530ba8de 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -660,16 +660,19 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
if (empty($type)) // For a filesystem path
{
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard default path
- foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
+ if (is_array($conf->file->dol_document_root))
{
- if ($key == 'main')
+ foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array("main"=>"/home/main/htdocs", "alt0"=>"/home/dirmod/htdocs", ...)
{
- continue;
- }
- if (file_exists($dirroot.'/'.$path))
- {
- $res=$dirroot.'/'.$path;
- return $res;
+ if ($key == 'main')
+ {
+ continue;
+ }
+ if (file_exists($dirroot.'/'.$path))
+ {
+ $res=$dirroot.'/'.$path;
+ return $res;
+ }
}
}
if ($returnemptyifnotfound) // Not found into alternate dir
@@ -6582,7 +6585,7 @@ function dol_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembe
* or descending output and uses optionally natural case insensitive sorting (which
* can be optionally case sensitive as well).
*
- * @param array $array Array to sort (array of array('key','otherkey1','otherkey2'...))
+ * @param array $array Array to sort (array of array('key1'=>val1,'key2'=>val2,'key3'...) or array of objects)
* @param string $index Key in array to use for sorting criteria
* @param int $order Sort order ('asc' or 'desc')
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort)
@@ -6601,7 +6604,17 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
if ($sizearray>0)
{
$temp = array();
- foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
+ foreach(array_keys($array) as $key)
+ {
+ if (is_object($array[$key]))
+ {
+ $temp[$key]=$array[$key]->$index;
+ }
+ else
+ {
+ $temp[$key]=$array[$key][$index];
+ }
+ }
if (! $natsort) {
($order=='asc') ? asort($temp) : arsort($temp);
@@ -8004,6 +8017,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
{
global $conf;
+ $return = '';
+
// image's filename are still in French
$statusImg=array(
'status0' => 'statut0'
@@ -8140,3 +8155,117 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
return '<'.$tag.' '.$compiledAttributes.'>'.$html.''.$tag.'>
';
}
+
+
+
+/**
+ * Function dolGetButtonTitle : this kind of buttons are used in title in list
+ *
+ * @param string $label label of button
+ * @param string $helpText optional : content for help tooltip
+ * @param string $iconClass class for icon element
+ * @param string $url the url for link
+ * @param string $id attribute id of button
+ * @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
+ * @param array $params various params for future : recommended rather than adding more function arguments
+ * @return string html button
+ */
+function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $status = 1, $params = array())
+{
+ global $langs, $conf, $user;
+
+ // Actually this conf is used in css too for external module compatibility and smooth transition to this function
+ if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin) && $status <= 0) {
+ return '';
+ }
+
+ $class = 'btnTitle' ;
+
+ // hidden conf keep during button transition TODO: remove this block
+ if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ $class = 'butActionNew';
+ }
+
+ $attr=array(
+ 'class' => $class
+ ,'href' => empty($url)?'':$url
+ );
+
+ if(!empty($helpText)){
+ $attr['title'] = dol_escape_htmltag($helpText);
+ }
+
+ if($status <= 0){
+ $attr['class'] .= ' refused';
+
+ // hidden conf keep during button transition TODO: remove this block
+ if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ $attr['class'] = 'butActionNewRefused';
+ }
+
+ $attr['href'] = '';
+
+ if($status == -1){ // Not enough permissions
+ $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled"));
+ }
+ elseif($status == 0){ // disable
+ $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions"));
+ }
+ }
+
+ if(!empty($attr['title'])){
+ $attr['class'] .= ' classfortooltip';
+ }
+
+ if(empty($id)){
+ $attr['id'] = $id;
+ }
+
+ // Override attr
+ if(!empty($params['attr']) && is_array($params['attr'])){
+ foreach($params['attr'] as $key => $value){
+ if($key == 'class'){
+ $attr['class'].= ' '.$value;
+ }
+ elseif($key == 'classOverride'){
+ $attr['class'] = $value;
+ }
+ else{
+ $attr[$key] = $value;
+ }
+ }
+ }
+
+ if(isset($attr['href']) && empty($attr['href'])){
+ unset($attr['href']);
+ }
+
+ // TODO : add a hook
+
+ // escape all attribute
+ $attr = array_map('dol_escape_htmltag', $attr);
+
+ $TCompiledAttr = array();
+ foreach($attr as $key => $value){
+ $TCompiledAttr[] = $key.'="'.$value.'"';
+ }
+
+ $compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
+
+ $tag = !empty($attr['href'])?'a':'span';
+
+
+ $button ='<'.$tag.' '.$compiledAttributes.' >';
+ $button.= ' ';
+ $button.= ''.$label.' ';
+ $button.= ''.$tag.'>';
+
+ // hidden conf keep during button transition TODO: remove this block
+ if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
+ $button='<'.$tag.' '.$compiledAttributes.' >'.$label.' ';
+ $button.= ' ';
+ $button.= ''.$tag.'>';
+ }
+
+ return $button;
+}
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 76d3d54515d..fac25451ece 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1282,6 +1282,10 @@ function check_value($mask, $value)
if (! empty($reg[3]) && preg_match('/^@/', $reg[3])) $maskraz=preg_replace('/^@/', '', $reg[3]);
if ($maskraz >= 0)
{
+ if ($maskraz == 99) {
+ $maskraz = date('m');
+ $resetEveryMonth = true;
+ }
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
// Define reg
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index cc40fcb9272..14c0435b4ad 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1374,6 +1374,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
if (! empty($object->lines[$i]->date_start) || ! empty($object->lines[$i]->date_end))
{
$format='day';
+ $period = '';
// Show duration if exists
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 4ce610aaf90..7da112fa255 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -145,8 +145,8 @@ function user_prepare_head($object)
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))
- || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id)
- || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id )
+ || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
+ || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->read_all))
)
{
// Bank
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 9f81d343c8b..3710cc2cf91 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -540,10 +540,10 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname,
global $langs;
if ($showmode == 1) {
- print '';
- print '';
+ print ' ';
print '';
print $text;
print ' ';
@@ -1659,9 +1659,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
{
$langs->load("hrm");
- $newmenu->add("/user/list.php?leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
- $newmenu->add("/user/card.php?action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write);
- $newmenu->add("/user/list.php?leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read);
+ $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
+ $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write);
+ $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read);
}
// Leave/Holiday/Vacation module
@@ -1670,19 +1670,19 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Load translation files required by the page
$langs->loadLangs(array("holiday","trips"));
- $newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
- $newmenu->add("/holiday/card.php?action=request", $langs->trans("New"), 1, $user->rights->holiday->write);
- $newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read);
+ $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
+ $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("New"), 1, $user->rights->holiday->write);
+ $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read);
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") {
- $newmenu->add("/holiday/list.php?search_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read);
- $newmenu->add("/holiday/list.php?search_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read);
- $newmenu->add("/holiday/list.php?search_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read);
- $newmenu->add("/holiday/list.php?search_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read);
- $newmenu->add("/holiday/list.php?search_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read);
+ $newmenu->add("/holiday/list.php?search_statut=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read);
+ $newmenu->add("/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read);
+ $newmenu->add("/holiday/list.php?search_statut=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read);
+ $newmenu->add("/holiday/list.php?search_statut=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read);
+ $newmenu->add("/holiday/list.php?search_statut=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read);
}
- $newmenu->add("/holiday/define_holiday.php?action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read);
- $newmenu->add("/holiday/month_report.php", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all);
- $newmenu->add("/holiday/view_log.php?action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
+ $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read);
+ $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all);
+ $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
}
// Trips and expenses (old module)
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 1fc25035933..c7158413e24 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -667,7 +667,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
array(
'doc/' => dol_buildpath(strtolower($this->name).'/doc/', 1),
'img/' => dol_buildpath(strtolower($this->name).'/img/', 1),
- 'images/' => dol_buildpath(strtolower($this->name).'/imgages/', 1),
+ 'images/' => dol_buildpath(strtolower($this->name).'/images/', 1),
)
);
}
@@ -746,7 +746,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$filefound= false;
// Define path to file README.md.
- // First check README-la_LA.md then README.md
+ // First check ChangeLog-la_LA.md then ChangeLog.md
$pathoffile = dol_buildpath(strtolower($this->name).'/ChangeLog-'.$langs->defaultlang.'.md', 0);
if (dol_is_file($pathoffile)) {
$filefound = true;
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index 03dae9cbe5e..97fedf45808 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -353,11 +353,17 @@ class pdf_strato extends ModelePDFContract
$desc=dol_htmlentitiesbr($objectligne->desc, 1); // Desc (not empty for free lines)
$txt='';
$txt.=$outputlangs->transnoentities("Quantity").' : '.$objectligne->qty.' - '.$outputlangs->transnoentities("UnitPrice").' : '.price($objectligne->subprice).' '; // Desc (not empty for free lines)
- $txt.=' ';
- $txt.=$outputlangs->transnoentities("DateStartPlannedShort")." : ".$datei." - ".$outputlangs->transnoentities("DateEndPlanned")." : ".$datee.' ';
- $txt.=' ';
- $txt.=$outputlangs->transnoentities("DateStartRealShort")." : ".$daters.' ';
- if ($objectligne->date_cloture) $txt.=" - ".$outputlangs->transnoentities("DateEndRealShort")." : ''".$datere.' ';
+ if (empty($conf->global->CONTRACT_HIDE_PLANNED_DATE_ON_PDF))
+ {
+ $txt.=' ';
+ $txt.=$outputlangs->transnoentities("DateStartPlannedShort")." : ".$datei." - ".$outputlangs->transnoentities("DateEndPlanned")." : ".$datee.' ';
+ }
+ if (empty($conf->global->CONTRACT_HIDE_REAL_DATE_ON_PDF))
+ {
+ $txt.=' ';
+ $txt.=$outputlangs->transnoentities("DateStartRealShort")." : ".$daters.' ';
+ if ($objectligne->date_cloture) $txt.=" - ".$outputlangs->transnoentities("DateEndRealShort")." : ''".$datere.' ';
+ }
$pdf->startTransaction();
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txtpredefinedservice, dol_concatdesc($txt, $desc)), 0, 1, 0);
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index 8250549b9e1..66b2a511bf7 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -243,11 +243,12 @@ class modAccounting extends DolibarrModules
$this->export_icon[$r]='Accounting';
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
- $this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
+ $this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.account_parent'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');
$this->export_entities_array[$r]=array('ac.rowid'=>"Accounting",'ac.pcg_version'=>"Accounting",'aa.rowid'=>'Accounting','aa.account_number'=>"Accounting",'aa.label'=>"Accounting",'aa.accountparent'=>"Accounting",'aa.pcg_type'=>"Accounting",'aa.pcgsubtype'=>"Accounting",'aa_active'=>"Accounting");
$this->export_sql_start[$r]='SELECT DISTINCT ';
- $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa, '.MAIN_DB_PREFIX.'accounting_system as ac';
+ $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'accounting_account as aa';
+ $this->export_sql_end[$r] .=' ,'.MAIN_DB_PREFIX.'accounting_system as ac';
$this->export_sql_end[$r] .=' WHERE ac.pcg_version = aa.fk_pcg_version AND aa.entity IN ('.getEntity('accounting').') ';
diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php
index f07ddeaeaae..ad516e9a787 100644
--- a/htdocs/core/modules/modCron.class.php
+++ b/htdocs/core/modules/modCron.class.php
@@ -134,7 +134,7 @@ class modCron extends DolibarrModules
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'CronList',
- 'url'=>'/cron/list.php?status=-2&leftmenu=admintools',
+ 'url'=>'/cron/list.php?leftmenu=admintools',
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200,
'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index 5ee2a6ba8a3..3a18749bcde 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -169,6 +169,7 @@ class modProduct extends DolibarrModules
$this->export_permission[$r]=array(array("produit","export"));
$this->export_fields_array[$r]=array(
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",
+ 'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode",
'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",
'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
@@ -184,7 +185,8 @@ class modProduct extends DolibarrModules
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
$this->export_TypeFields_array[$r]=array(
- 'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",
+ 'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
+ 'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
'p.note'=>"Text",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'
@@ -289,7 +291,8 @@ class modProduct extends DolibarrModules
$this->export_permission[$r]=array(array("produit","export"));
$this->export_fields_array[$r]=array(
'p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",
- 'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",
+ 'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode",
+ 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",
'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode',
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",
'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'
@@ -298,7 +301,8 @@ class modProduct extends DolibarrModules
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('pa.qty'=>'Qty','pa.incdec'=>'ComposedProductIncDecStock'));
$this->export_TypeFields_array[$r]=array(
- 'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",
+ 'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
+ 'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text',
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
'p.datec'=>'Date','p.tms'=>'Date'
@@ -308,7 +312,8 @@ class modProduct extends DolibarrModules
$this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('pa.qty'=>'Numeric'));
$this->export_entities_array[$r]=array(
'p.rowid'=>"virtualproduct",'p.ref'=>"virtualproduct",'p.label'=>"virtualproduct",'p.description'=>"virtualproduct",'p.url'=>"virtualproduct",
- 'p.accountancy_code_sell'=>'virtualproduct','p.accountancy_code_buy'=>'virtualproduct','p.note'=>"virtualproduct",'p.length'=>"virtualproduct",
+ 'p.accountancy_code_sell'=>'virtualproduct','p.accountancy_code_sell_intra'=>'virtualproduct','p.accountancy_code_sell_export'=>'virtualproduct',
+ 'p.accountancy_code_buy'=>'virtualproduct','p.note'=>"virtualproduct",'p.length'=>"virtualproduct",
'p.surface'=>"virtualproduct",'p.volume'=>"virtualproduct",'p.weight'=>"virtualproduct",'p.customcode'=>'virtualproduct',
'p.price_base_type'=>"virtualproduct",'p.price'=>"virtualproduct",'p.price_ttc'=>"virtualproduct",'p.tva_tx'=>"virtualproduct",
'p.tosell'=>"virtualproduct",'p.tobuy'=>"virtualproduct",'p.datec'=>"virtualproduct",'p.tms'=>"virtualproduct"
@@ -492,6 +497,8 @@ class modProduct extends DolibarrModules
'p.duration' => "eg. 365d/12m/1y",
'p.url' => 'link to product (no https)',
'p.accountancy_code_sell' => "",
+ 'p.accountancy_code_sell_intra' => "",
+ 'p.accountancy_code_sell_export' => "",
'p.accountancy_code_buy' => "",
'p.weight' => "",
'p.weight_units' => 'use a unit of measure from the dictionary. g/Kg/T etc....matches field "Short Label" for unit type "weight" in table "' . MAIN_DB_PREFIX . 'c_units',
diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php
index ecbd3b9c8c4..e961e6924f3 100644
--- a/htdocs/core/modules/modTakePos.class.php
+++ b/htdocs/core/modules/modTakePos.class.php
@@ -65,7 +65,7 @@ class modTakePos extends DolibarrModules
$this->descriptionlong = "Point Of Sales (compliant with touch screen)";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
- $this->version = 'experimental';
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where TAKEPOS is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index 10a2ce752d8..dfbe97c3fd5 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -301,7 +301,7 @@ class pdf_beluga extends ModelePDFProjects
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire,
- 'lang'=>'order'),
+ 'lang'=>'orders'),
'invoice'=>array(
'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
index cf71d691715..612595b8c44 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
@@ -1810,7 +1810,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
global $hookmanager;
$parameters=array(
- 'object' => $object,
'curY' =>& $curY,
'columnText' => $columnText,
'colKey' => $colKey
diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php
index 129c1a70575..f6d59435e74 100644
--- a/htdocs/core/tpl/commonfields_view.tpl.php
+++ b/htdocs/core/tpl/commonfields_view.tpl.php
@@ -48,7 +48,7 @@ foreach($object->fields as $key => $val)
$value=$object->$key;
print ' 0) print ' fieldrequired'; // No fieldrequired on the view output
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
print '">';
@@ -65,11 +65,13 @@ foreach($object->fields as $key => $val)
}
print '