| ';
- print $ligne->LibStatut($row[1], 1);
+ print $line->LibStatut($row[1], 1);
print ' | ';
print price($row[0]);
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 781daacd030..f766c8beeb8 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -412,8 +412,8 @@ else
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
- $result = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($result);
+ $resql = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
@@ -423,14 +423,14 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql .= $db->plimit($limit + 1, $offset);
-$result = $db->query($sql);
-if (!$result)
+$resql = $db->query($sql);
+if (! $resql)
{
dol_print_error($db);
exit;
}
-$num = $db->num_rows($result);
+$num = $db->num_rows($resql);
$arrayofselected = is_array($toselect) ? $toselect : array();
@@ -786,7 +786,7 @@ $i = 0;
$totalarray = array();
while ($i < min($num, $limit))
{
- $obj = $db->fetch_object($result);
+ $obj = $db->fetch_object($resql);
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
$contactstatic->lastname = $obj->lastname;
@@ -986,7 +986,7 @@ while ($i < min($num, $limit))
$i++;
}
-$db->free($result);
+$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index be23895fe7f..544cc105416 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -1082,7 +1082,8 @@ abstract class CommonDocGenerator
$parameters = array(
'curY' => &$curY,
'columnText' => $columnText,
- 'colKey' => $colKey
+ 'colKey' => $colKey,
+ 'pdf' => &$pdf,
);
$reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 9601320af49..7fc42512baf 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1899,14 +1899,15 @@ abstract class CommonObject
$row = $this->db->fetch_row($result);
$this->ref_previous = $row[0];
-
$sql = "SELECT MIN(te.".$fieldid.")";
$sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te";
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug";
}
- if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
- elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
+ if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
+ $tmparray = explode('@', $this->ismultientitymanaged);
+ $sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity
+ } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid
if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc";
$sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
@@ -1917,8 +1918,10 @@ abstract class CommonObject
if (!preg_match('/^\s*AND/i', $filter)) $sql .= " AND "; // For backward compatibility
$sql .= $filter;
}
- if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
- elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
+ if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
+ $tmparray = explode('@', $this->ismultientitymanaged);
+ $sql .= ' AND te.'.$tmparray[0].' = '.($tmparray[1] == 'societe' ? 's' : 'parenttable').'.rowid'; // If we need to link to this table to limit select to entity
+ } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
@@ -1931,6 +1934,10 @@ abstract class CommonObject
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
}
}
+ if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged) && $this->element != 'societe') {
+ $tmparray = explode('@', $this->ismultientitymanaged);
+ $sql .= ' AND parenttable.entity IN ('.getEntity($tmparray[1]).')';
+ }
if ($this->restrictiononfksoc == 1 && $socid && $this->element != 'societe') $sql .= ' AND te.fk_soc = '.$socid;
if ($this->restrictiononfksoc == 2 && $socid && $this->element != 'societe') $sql .= ' AND (te.fk_soc = '.$socid.' OR te.fk_soc IS NULL)';
if ($this->restrictiononfksoc && $socid && $this->element == 'societe') $sql .= ' AND te.rowid = '.$socid;
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 6b71366c46c..08b23156f64 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -183,6 +183,8 @@ class DoliDBPgsql extends DoliDB
if ($type == 'dml')
{
+ $reg = array();
+
$line = preg_replace('/\s/', ' ', $line); // Replace tabulation with space
// we are inside create table statement so lets process datatypes
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 12fb15d3b2a..7b3d66f9003 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -721,16 +721,16 @@ function translation_prepare_head()
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
- $head[$h][1] = $langs->trans("TranslationOverwriteKey").'';
- $head[$h][2] = 'overwrite';
- $h++;
-
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey";
$head[$h][1] = $langs->trans("TranslationKeySearch");
$head[$h][2] = 'searchkey';
$h++;
+ $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
+ $head[$h][1] = $langs->trans("TranslationOverwriteKey").'';
+ $head[$h][2] = 'overwrite';
+ $h++;
+
complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin', 'remove');
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index e102e0e155d..67611649142 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -1286,7 +1286,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Object db
- * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object
+ * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
* @param Contact $objcon Filter on object contact to filter events on a contact
* @param int $noprint Return string but does not output it
* @param string $actioncode Filter on actioncode
@@ -1294,9 +1294,10 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
* @param array $filters Filter on other fields
* @param string $sortfield Sort field
* @param string $sortorder Sort order
+ * @param string $module You can add module name here if elementtype in table llx_actioncomm is objectkey@module
* @return string|void Return html part or void if noprint is 1
*/
-function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC')
+function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '')
{
global $user, $conf;
global $form;
@@ -1416,7 +1417,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && is_array($filterobj->fields['ref']) && $filterobj->table_element && $filterobj->element)
{
- $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element)."'";
+ // Generic case
+ $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? '@'.$module : '')."'";
if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id;
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a72d2057004..967849d775a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3172,7 +3172,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'setup', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
- 'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic',
+ 'home', 'hrm', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'members', 'ticket', 'generic',
'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
)
@@ -3195,7 +3195,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
- 'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
+ 'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group',
@@ -5694,8 +5694,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1)
{
$allowed_tags = array(
"html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
- "ol", "p", "q", "s", "section", "span", "strike", "strong", "title",
- "table", "tr", "th", "td", "u", "ul"
+ "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6"
);
$allowed_tags_string = join("><", $allowed_tags);
$allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string);
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index b50090ee2cf..84670de46d2 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1809,18 +1809,19 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
$ret = '';
$regs = array();
- // If we ask an resource form external module (instead of default path)
+ // If we ask a resource form external module (instead of default path)
if (preg_match('/^([^@]+)@([^@]+)$/i', $objecttype, $regs)) {
$myobject = $regs[1];
$module = $regs[2];
}
-
- // Parse $objecttype (ex: project_task)
- $module = $myobject = $objecttype;
- if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs))
- {
- $module = $regs[1];
- $myobject = $regs[2];
+ else {
+ // Parse $objecttype (ex: project_task)
+ $module = $myobject = $objecttype;
+ if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs))
+ {
+ $module = $regs[1];
+ $myobject = $regs[2];
+ }
}
// Generic case for $classpath
@@ -1896,7 +1897,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
// Generic case for $classfile and $classname
$classfile = strtolower($myobject); $classname = ucfirst($myobject);
- //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname;
+ //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname." classpath=".$classpath;
if ($objecttype == 'invoice_supplier') {
$classfile = 'fournisseur.facture';
diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php
index 3d2847e926b..96d66c3272a 100644
--- a/htdocs/core/lib/order.lib.php
+++ b/htdocs/core/lib/order.lib.php
@@ -65,10 +65,10 @@ function commande_prepare_head(Commande $object)
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
$text = '';
if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments");
- if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= '/';
+ if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - ';
if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings");
if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''.($nbShipments ? $nbShipments : 0);
- if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= '/';
+ if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - ';
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0);
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '';
$head[$h][1] = $text;
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 63789a18e62..2f41a7df6eb 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1859,7 +1859,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
}
if (empty($reshook))
{
- if ($object->lines[$i]->special_code == 3) return '';
if (empty($hidedetails) || $hidedetails > 1) $result .= $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
}
return $result;
diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php
index a404e19184e..8008c9fd51f 100644
--- a/htdocs/core/lib/prelevement.lib.php
+++ b/htdocs/core/lib/prelevement.lib.php
@@ -39,8 +39,13 @@ function prelevement_prepare_head(BonPrelevement $object)
$h = 0;
$head = array();
+ $titleoftab = "WithdrawalsReceipts";
+ if ($object->type == 'bank-transfer') {
+ $titleoftab = "BankTransferReceipts";
+ }
+
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id;
- $head[$h][1] = $langs->trans("WithdrawalsReceipts");
+ $head[$h][1] = $langs->trans($titleoftab);
$head[$h][2] = 'prelevement';
$h++;
diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php
index 81c62958418..2cb8d8e30f6 100644
--- a/htdocs/core/lib/price.lib.php
+++ b/htdocs/core/lib/price.lib.php
@@ -40,8 +40,8 @@
* @param float $pu Unit price (HT or TTC selon price_base_type)
* @param float $remise_percent_ligne Discount for line
* @param float $txtva 0=do not apply VAT tax, VAT rate=apply (this is VAT rate only without text code, we don't need text code because we alreaydy have all tax info into $localtaxes_array)
- * @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
- * @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
+ * @param float $uselocaltax1_rate 0=do not use localtax1, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
+ * @param float $uselocaltax2_rate 0=do not use localtax2, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1.
* @param float $remise_percent_global 0
* @param string $price_base_type HT=Unit price parameter is HT, TTC=Unit price parameter is TTC
* @param int $info_bits Miscellaneous informations on line
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 0b07e96ab50..96a868c4599 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -22,7 +22,7 @@
/**
* \file htdocs/core/lib/usergroups.lib.php
- * \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes
+ * \brief Set of function to manage users, groups and permissions
*/
/**
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 03f8951b0f8..ec75b35073c 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -29,6 +29,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?mainmenu=home&leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?mainmenu=home&leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?mainmenu=home&leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/defaultvalues.php?mainmenu=home&leftmenu=setup', 'DefaultValues', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?mainmenu=home&leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?mainmenu=home&leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__);
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 50f64304e50..24fcaa62afa 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -131,7 +131,24 @@ if ($action == 'presend')
{
$formmail->fromid = $user->id;
}
- $formmail->trackid = $trackid;
+
+ if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) {
+ $formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER;
+ $formmail->fromname = '';
+ $formmail->fromtype = 'special';
+ }
+ if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) {
+ $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER;
+ $formmail->fromname = '';
+ $formmail->fromtype = 'special';
+ }
+ if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) {
+ $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER;
+ $formmail->fromname = '';
+ $formmail->fromtype = 'special';
+ }
+
+ $formmail->trackid=$trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
{
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index 0d2949b4e24..817d1aadfc9 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
// we keep position for the first line
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
}
- $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
+ if (is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
}
if (!empty($val['isameasure']))
{
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index 9b324817464..f3a181f0b2e 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -54,50 +54,48 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$extrafields_collapse_num = '';
$extrafields_collapse_num_old = '';
$i = 0;
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
+ foreach ($extrafields->attributes[$object->table_element]['label'] as $tmpkeyextra => $tmplabelextra)
{
$i++;
// Discard if extrafield is a hidden field on form
$enabled = 1;
- if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$key]))
+ if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra]))
{
- $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1);
+ $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1);
}
- if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key]))
+ if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra]))
{
- $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
+ $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1);
}
$perms = 1;
- if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
+ if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra]))
{
- $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
+ $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1);
}
- //print $key.'-'.$enabled.'-'.$perms.'-'.$label.$_POST["options_" . $key].' '."\n";
+ //print $tmpkeyextra.'-'.$enabled.'-'.$perms.'-'.$tmplabelextra.$_POST["options_" . $tmpkeyextra].' '."\n";
if (empty($enabled)) continue; // 0 = Never visible field
if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation
if (empty($perms)) continue; // 0 = Not visible
// Load language if required
- if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);
+ if (!empty($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra]);
if ($action == 'edit_extras')
{
- $value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]);
- }
- else
- {
- $value = $object->array_options["options_".$key];
- //var_dump($key.' - '.$value);
+ $value = (isset($_POST["options_".$tmpkeyextra]) ? $_POST["options_".$tmpkeyextra] : $object->array_options["options_".$tmpkeyextra]);
+ } else {
+ $value = $object->array_options["options_".$tmpkeyextra];
+ //var_dump($tmpkeyextra.' - '.$value);
}
// Print line tr of extra field
- if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate')
+ if ($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra] == 'separate')
{
$extrafields_collapse_num = '';
- $extrafield_param = $extrafields->attributes[$object->table_element]['param'][$key];
+ $extrafield_param = $extrafields->attributes[$object->table_element]['param'][$tmpkeyextra];
if (!empty($extrafield_param) && is_array($extrafield_param)) {
$extrafield_param_list = array_keys($extrafield_param['options']);
@@ -105,17 +103,15 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
if ($extrafield_collapse_display_value == 1 || $extrafield_collapse_display_value == 2) {
- $extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$key];
+ $extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$tmpkeyextra];
}
}
}
- print $extrafields->showSeparator($key, $object);
+ print $extrafields->showSeparator($tmpkeyextra, $object);
- $lastseparatorkeyfound = $key;
- }
- else
- {
+ $lastseparatorkeyfound = $tmpkeyextra;
+ } else {
print ' |
';
print '';
- $html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
+ $html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : '';
- print '';
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 95b6f6208a5..f2cb455cc6b 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1542,8 +1542,11 @@ if ($action == 'create')
}
if ($subj == 0) // Line not shown yet, we show it
{
- print '';
- print ' | ';
+
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
$disabled = '';
@@ -1551,6 +1554,9 @@ if ($action == 'create')
{
$disabled = 'disabled="disabled"';
}
+ if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty.
+ $disabled = 'disabled="disabled"';
+ }
print ' ';
}
else
@@ -1562,7 +1568,6 @@ if ($action == 'create')
print ' | ';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
- $warehouse_selected_id = GETPOST('entrepot_id', 'int');
if ($warehouse_selected_id > 0)
{
$warehouseObject = new Entrepot($db);
@@ -1949,7 +1954,7 @@ elseif ($id || $ref)
print '';
print ' ';
- print ' ';
+ print '';
// Sending method
print '| ';
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index b6cb00ec091..8e17403635a 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -292,6 +292,7 @@ class Expedition extends CommonObject
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expedition (";
+
$sql .= "ref";
$sql .= ", entity";
$sql .= ", ref_customer";
@@ -331,10 +332,10 @@ class Expedition extends CommonObject
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null");
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
- $sql .= ", ".$this->weight;
- $sql .= ", ".$this->sizeS; // TODO Should use this->trueDepth
- $sql .= ", ".$this->sizeW; // TODO Should use this->trueWidth
- $sql .= ", ".$this->sizeH; // TODO Should use this->trueHeight
+ $sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL');
+ $sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth
+ $sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth
+ $sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight
$sql .= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL');
$sql .= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL');
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index fc0d5cea6eb..5ca0a154312 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -332,9 +332,11 @@ class CommandeFournisseur extends CommonOrder
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
- $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
+
+ if (empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
+ else $sql .= " WHERE c.rowid=".$id;
+
if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'";
- else $sql .= " AND c.rowid=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -1292,11 +1294,15 @@ class CommandeFournisseur extends CommonOrder
$error = 0;
$now = dol_now();
+ // $date_commande is deprecated
+ $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set
+ if(empty($date)) $date = $now;
+
// Clean parameters
if (empty($this->source)) $this->source = 0;
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
- if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
+ if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
{
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 37dbc2752ca..63ca7e0d88b 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -359,7 +359,7 @@ class FactureFournisseur extends CommonInvoice
$remise = $this->remise;
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
- if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
+ if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
{
@@ -486,7 +486,7 @@ class FactureFournisseur extends CommonInvoice
$idligne,
$this->lines[$i]->description,
$this->lines[$i]->pu_ht,
- $this->lines[$i]->tva_tx,
+ $this->lines[$i]->tva_tx.($this->lines[$i]->vat_src_code ? ' ('.$this->lines[$i]->vat_src_code.')' : ''),
$this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx,
$this->lines[$i]->qty,
@@ -1945,6 +1945,8 @@ class FactureFournisseur extends CommonInvoice
$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $mysoc, $this->thirdparty);
+ $reg = array();
+
// Clean vat code
$vat_src_code = '';
if (preg_match('/\((.*)\)/', $vatrate, $reg))
@@ -2648,6 +2650,8 @@ class FactureFournisseur extends CommonInvoice
$object->id = 0;
$object->statut = self::STATUS_DRAFT;
+ $object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor
+
// Clear fields
$object->ref_supplier = (empty($this->ref_supplier) ? $langs->trans("CopyOf").' '.$object->ref_supplier : $this->ref_supplier);
$object->author = $user->id;
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index c00ee77df53..1643ae69846 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -1025,7 +1025,7 @@ class ProductFournisseur extends Product
//$out .= ' | '.$langs->trans("QtyMin").' | ';
$out .= ''.$langs->trans("User").' | ';
foreach ($productFournLogList as $productFournLog) {
- $out .= '| '.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').' | ';
+ $out .= ' | '.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').' | ';
$out .= ''.price($productFournLog['price']).' | ';
//$out.= ''.$productFournLog['quantity'].' | ';
$out .= ''.$productFournLog['lastname'].' | ';
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 71ed66ffc09..ff79524f874 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2390,7 +2390,7 @@ elseif (!empty($object->id))
{
if ($user->rights->fournisseur->commande->approuver)
{
- if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id))
+ if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id))
{
print ''.$langs->trans("ApproveOrder").'';
}
@@ -2406,7 +2406,7 @@ elseif (!empty($object->id))
}
// Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set)
- if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
+ if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
if ($object->statut == CommandeFournisseur::STATUS_VALIDATED)
{
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 2113d7ebb12..10cf8ee1b6f 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2004-2020 Laurent Destailleur
* Copyright (C) 2004 Christophe Combelles
* Copyright (C) 2005 Marc Barilley
* Copyright (C) 2005-2013 Regis Houssin
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index d957ade168e..5e8798d901a 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -268,7 +268,7 @@ else
print ' | ';
// Action column
- print '';
+ print ' | ';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print ' | ';
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index e31266f755c..ba33ecbbdb3 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -77,7 +77,7 @@ $childids[] = $user->id;
llxHeader('', $langs->trans('HRMArea'));
-print load_fiche_titre($langs->trans("HRMArea"), '', 'user');
+print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm');
if (!empty($setupcompanynotcomplete))
diff --git a/htdocs/includes/DebugBar/Resources/debugbar.js b/htdocs/includes/DebugBar/Resources/debugbar.js
index faf567e37c1..1dcbec2146f 100644
--- a/htdocs/includes/DebugBar/Resources/debugbar.js
+++ b/htdocs/includes/DebugBar/Resources/debugbar.js
@@ -409,12 +409,11 @@ if (typeof(PhpDebugBar) == 'undefined') {
className: "phpdebugbar " + csscls('minimized'),
- options: {
- bodyMarginBottom: true,
- bodyMarginBottomHeight: parseInt($('body').css('margin-bottom'))
- },
-
initialize: function() {
+ this.options = {
+ bodyMarginBottom: true,
+ bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
+ };
this.controls = {};
this.dataMap = {};
this.datasets = {};
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index 82a0f11e893..2d5bcd5d28e 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -329,3 +329,5 @@ ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_de
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT Rate 0',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1);
+
+ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
diff --git a/htdocs/install/mysql/tables/llx_c_format_cards.sql b/htdocs/install/mysql/tables/llx_c_format_cards.sql
index b69b9eb19d1..d3885b5d256 100644
--- a/htdocs/install/mysql/tables/llx_c_format_cards.sql
+++ b/htdocs/install/mysql/tables/llx_c_format_cards.sql
@@ -36,4 +36,4 @@ CREATE TABLE llx_c_format_cards
custom_x double(24,8) NOT NULL,
custom_y double(24,8) NOT NULL,
active integer NOT NULL
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql
index 89fec8f54e2..83cfadb7307 100644
--- a/htdocs/install/mysql/tables/llx_establishment.sql
+++ b/htdocs/install/mysql/tables/llx_establishment.sql
@@ -37,5 +37,5 @@ CREATE TABLE llx_establishment (
datec datetime NOT NULL,
tms timestamp NOT NULL,
status tinyint DEFAULT 1
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
index 7a6a3bfd777..43b64451364 100644
--- a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
+++ b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
@@ -23,5 +23,5 @@ CREATE TABLE llx_expeditiondet_batch (
batch varchar(128) DEFAULT NULL,
qty double NOT NULL DEFAULT '0',
fk_origin_stock integer NOT NULL
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_expensereport_rules.sql b/htdocs/install/mysql/tables/llx_expensereport_rules.sql
index aa6d7553639..2a10cc24a7d 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_rules.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_rules.sql
@@ -31,4 +31,4 @@ CREATE TABLE llx_expensereport_rules (
code_expense_rules_type varchar(50) NOT NULL,
is_for_all tinyint DEFAULT 0,
entity integer DEFAULT 1
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_inventory.sql b/htdocs/install/mysql/tables/llx_inventory.sql
index 70e409193aa..4ccb234e26e 100644
--- a/htdocs/install/mysql/tables/llx_inventory.sql
+++ b/htdocs/install/mysql/tables/llx_inventory.sql
@@ -35,4 +35,4 @@ CREATE TABLE llx_inventory
date_validation datetime DEFAULT NULL,
import_key varchar(14) -- import key
)
-ENGINE=InnoDB;
+ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_inventorydet.sql b/htdocs/install/mysql/tables/llx_inventorydet.sql
index b4df529433e..161e34183a0 100644
--- a/htdocs/install/mysql/tables/llx_inventorydet.sql
+++ b/htdocs/install/mysql/tables/llx_inventorydet.sql
@@ -30,4 +30,4 @@ qty_stock double DEFAULT NULL, -- The targeted value. can be filled during dra
qty_view double DEFAULT NULL, -- must be filled once regulation is done
qty_regulated double DEFAULT NULL -- must be filled once regulation is done
)
-ENGINE=InnoDB;
+ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_oauth_state.sql b/htdocs/install/mysql/tables/llx_oauth_state.sql
index 39ade6bc529..77093f6d1b4 100644
--- a/htdocs/install/mysql/tables/llx_oauth_state.sql
+++ b/htdocs/install/mysql/tables/llx_oauth_state.sql
@@ -22,4 +22,4 @@ CREATE TABLE llx_oauth_state (
fk_user integer,
fk_adherent integer,
entity integer DEFAULT 1
-)ENGINE=InnoDB;
+)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_oauth_token.sql b/htdocs/install/mysql/tables/llx_oauth_token.sql
index bbc236be6c1..145e646230d 100644
--- a/htdocs/install/mysql/tables/llx_oauth_token.sql
+++ b/htdocs/install/mysql/tables/llx_oauth_token.sql
@@ -24,4 +24,4 @@ CREATE TABLE llx_oauth_token (
fk_user integer,
fk_adherent integer,
entity integer DEFAULT 1
-)ENGINE=InnoDB;
+)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_comments.sql b/htdocs/install/mysql/tables/llx_opensurvey_comments.sql
index 74a9d9ec3cb..3fcc5a0abf9 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_comments.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_comments.sql
@@ -21,5 +21,5 @@ CREATE TABLE llx_opensurvey_comments (
comment text NOT NULL,
tms timestamp,
usercomment text
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql b/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql
index 044fabc5029..8a15936c86f 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_formquestions.sql
@@ -20,5 +20,5 @@ CREATE TABLE llx_opensurvey_formquestions (
id_sondage VARCHAR(16),
question TEXT,
available_answers TEXT -- List of available answers
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql b/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql
index c3f1cdbfee1..0521f533fdd 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_sondage.sql
@@ -31,4 +31,4 @@ CREATE TABLE llx_opensurvey_sondage (
allow_spy tinyint NOT NULL DEFAULT 1,
tms TIMESTAMP,
sujet TEXT -- Not filled if format = 'F'. Question are into table llx_opensurvey_formquestions
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql b/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql
index bd55d256a06..957818db4a1 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_user_formanswers.sql
@@ -19,4 +19,4 @@ CREATE TABLE llx_opensurvey_user_formanswers (
fk_user_survey INTEGER NOT NULL,
fk_question INTEGER NOT NULL,
reponses TEXT
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql b/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
index 16ef0b2cf7e..a2ddafa1b54 100644
--- a/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
+++ b/htdocs/install/mysql/tables/llx_opensurvey_user_studs.sql
@@ -21,4 +21,4 @@ CREATE TABLE llx_opensurvey_user_studs (
id_sondage VARCHAR(16) NOT NULL,
reponses VARCHAR(100) NOT NULL, -- Not used for 'F' surveys
tms timestamp
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_product_batch.sql b/htdocs/install/mysql/tables/llx_product_batch.sql
index 7b09d6a0024..9b736278e3a 100644
--- a/htdocs/install/mysql/tables/llx_product_batch.sql
+++ b/htdocs/install/mysql/tables/llx_product_batch.sql
@@ -27,5 +27,5 @@ CREATE TABLE llx_product_batch (
batch varchar(128) NOT NULL,
qty double NOT NULL DEFAULT 0,
import_key varchar(14) DEFAULT NULL
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_product_lot.sql b/htdocs/install/mysql/tables/llx_product_lot.sql
index 885f699d800..4d59a46c153 100644
--- a/htdocs/install/mysql/tables/llx_product_lot.sql
+++ b/htdocs/install/mysql/tables/llx_product_lot.sql
@@ -29,4 +29,4 @@ CREATE TABLE llx_product_lot (
fk_user_creat integer,
fk_user_modif integer,
import_key integer
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql
index e081b97969f..0c636b2507c 100644
--- a/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql
+++ b/htdocs/install/mysql/tables/llx_propal_merge_pdf_product.sql
@@ -24,5 +24,5 @@ CREATE TABLE llx_propal_merge_pdf_product (
datec datetime NOT NULL,
tms timestamp NOT NULL,
import_key varchar(14) DEFAULT NULL
-) ENGINE=InnoDB;
+) ENGINE=innodb;
diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql
index 40628f93ac6..22c122a1164 100644
--- a/htdocs/install/pgsql/functions/functions.sql
+++ b/htdocs/install/pgsql/functions/functions.sql
@@ -58,6 +58,7 @@ CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer
-- Add triggers for timestamp fields named tms
CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE plpgsql;
+
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accounting_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accounting_fiscalyear FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -127,6 +128,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_localtax FOR EACH RO
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_menu FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_production FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 860d9e1b64c..c99c436915d 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -300,8 +300,9 @@ MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email for manual sending (User email o
UserEmail=User email
CompanyEmail=Company Email
FeatureNotAvailableOnLinux=Feature not available on Unix like systems. Test your sendmail program locally.
+FixOnTransifex=Fix the translation on the online translation platform of project
SubmitTranslation=If the translation for this language is not complete or you find errors, you can correct this by editing files in directory langs/%s and submit your change to www.transifex.com/dolibarr-association/dolibarr/
-SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or for developers on github.com/Dolibarr/dolibarr.
+SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or, if you are a developer, with a PR on github.com/Dolibarr/dolibarr
ModuleSetup=Module setup
ModulesSetup=Modules/Application setup
ModuleFamilyBase=System
@@ -1686,7 +1687,7 @@ AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view
##### Clicktodial #####
ClickToDialSetup=Click To Dial module setup
ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags __PHONETO__ that will be replaced with the phone number of person to call __PHONEFROM__ that will be replaced with phone number of calling person (yours) __LOGIN__ that will be replaced with clicktodial login (defined on user card) __PASS__ that will be replaced with clicktodial password (defined on user card).
-ClickToDialDesc=This module makea phone numbers clickable links. A click on the icon will make your phone call the number. This can be used to call a call-center system from Dolibarr that can call the phone number on a SIP system for example.
+ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable.
ClickToDialUseTelLink=Use just a link "tel:" on phone numbers
ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field.
##### Point Of Sale (CashDesk) #####
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index ab9ead7e991..f87f3a277de 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1037,4 +1037,5 @@ ShowOtherLanguages=Show other languages
SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language
NotUsedForThisCustomer=Not used for this customer
AmountMustBePositive=Amount must be positive
-ByStatus=By status
\ No newline at end of file
+ByStatus=By status
+InformationMessage=Information
\ No newline at end of file
diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang
index 841a9c2d480..662c587108a 100644
--- a/htdocs/langs/en_US/withdrawals.lang
+++ b/htdocs/langs/en_US/withdrawals.lang
@@ -77,12 +77,12 @@ StatusMotif8=Other reason
CreateForSepaFRST=Create direct debit file (SEPA FRST)
CreateForSepaRCUR=Create direct debit file (SEPA RCUR)
CreateAll=Create direct debit file (all)
-CreateFileForPaymentByBankTransfer=Create credit transfer (all)
+CreateFileForPaymentByBankTransfer=Create file for credit transfer (all)
CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA)
CreateGuichet=Only office
CreateBanque=Only bank
OrderWaiting=Waiting for treatment
-NotifyTransmision=Withdrawal Transmission
+NotifyTransmision=File transmission
NotifyCredit=Withdrawal Credit
NumeroNationalEmetter=National Transmitter Number
WithBankUsingRIB=For bank accounts using RIB
@@ -95,7 +95,8 @@ ShowWithdraw=Show Direct Debit Order
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management.
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Payment by direct debit to generate and manage the direct debit order. When direct debit order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null.
DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Payment by credit transfer to generate and manage the credit transfer order. When credit transfer order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null.
-WithdrawalFile=Withdrawal file
+WithdrawalFile=Debit order file
+CreditTransferFile=Credit transfer file
SetToStatusSent=Set to status "File Sent"
ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null
StatisticsByLineStatus=Statistics by status of lines
@@ -121,6 +122,7 @@ SEPAFrstOrRecur=Type of payment
ModeRECUR=Recurring payment
ModeFRST=One-off payment
PleaseCheckOne=Please check one only
+CreditTransferOrderCreated=Credit transfer order %s created
DirectDebitOrderCreated=Direct debit order %s created
AmountRequested=Amount requested
SEPARCUR=SEPA CUR
diff --git a/htdocs/modulebuilder/template/admin/myobject_extrafields.php b/htdocs/modulebuilder/template/admin/myobject_extrafields.php
index 13a6e7b54c5..065feb6cebe 100644
--- a/htdocs/modulebuilder/template/admin/myobject_extrafields.php
+++ b/htdocs/modulebuilder/template/admin/myobject_extrafields.php
@@ -68,7 +68,7 @@ $linkback = 'trans("MyObjectExtraFields"), -1, 'account');
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 19a5cbc99ce..bfd1cd46fb5 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -840,7 +840,7 @@ class MyObject extends CommonObject
if (empty($this->labelStatus) || empty($this->labelStatusShort))
{
global $langs;
- //$langs->load("mymodule");
+ //$langs->load("mymodule@mymodule");
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
$this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled');
@@ -953,7 +953,7 @@ class MyObject extends CommonObject
public function getNextNumRef()
{
global $langs, $conf;
- $langs->load("mymodule@myobject");
+ $langs->load("mymodule@mymodule");
if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) {
$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard';
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
index 7c242c26444..417a3b0c173 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
@@ -147,7 +147,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$this->db = $db;
$this->name = "standard";
- $this->description = $langs->trans('PDFStandardDescription');
+ $this->description = $langs->trans('DocumentModelStandardPDF');
$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
// Dimension page
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index 8f4117a871e..58d64b622d0 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -249,7 +249,7 @@ if ($object->id > 0)
$filters['search_agenda_label'] = $search_agenda_label;
// TODO Replace this with same code than into list.php
- show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
+ show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'mymmodule');
}
}
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index f67be16ade1..e00c0a3b618 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -589,7 +589,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element.'@mymodule', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
print '';
}
diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php
index 5426546e927..2c6a33f3ef9 100644
--- a/htdocs/multicurrency/class/multicurrency.class.php
+++ b/htdocs/multicurrency/class/multicurrency.class.php
@@ -519,6 +519,7 @@ class MultiCurrency extends CommonObject
global $conf;
$sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m';
+
$sql1 .= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)';
$sql1 .= " WHERE m.code = '".$db->escape($code)."'";
$sql1 .= " AND m.entity IN (".getEntity('multicurrency').")";
@@ -527,7 +528,7 @@ class MultiCurrency extends CommonObject
$tmparray = dol_getdate($date_document);
$sql2 .= " AND mc.date_sync <= '".$db->idate(dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], true))."'";
}
- $sql3 .= ' ORDER BY mc.date_sync DESC LIMIT 1';
+ $sql3 = ' ORDER BY mc.date_sync DESC LIMIT 1';
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $db->query($sql1.$sql2.$sql3);
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index 35b93cac8b9..f5b097d0655 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -204,7 +204,7 @@ if ($id > 0 || !empty($ref))
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder);
print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder);
- print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder);
+ print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder);
print "\n";
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 8193cf78934..ea5feaa170c 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -114,6 +114,7 @@ class Entrepot extends CommonObject
*/
public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10),
+ 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15),
'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30),
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35),
@@ -456,6 +457,7 @@ class Entrepot extends CommonObject
}
$sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id, phone, fax";
+ $sql .= ", entity";
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
if ($id)
{
@@ -475,6 +477,7 @@ class Entrepot extends CommonObject
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
+ $this->entity = $obj->entity;
$this->fk_parent = $obj->fk_parent;
$this->ref = $obj->label;
$this->label = $obj->label;
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index 78418f90db6..47c3ac9d1b5 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -226,13 +226,13 @@ if (!empty($conf->categorie->enabled))
}
foreach ($search as $key => $val)
{
- if ($key == 'status' && $search[$key] == -1) continue;
+ if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue;
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
if ($search[$key] == '-1') $search[$key] = '';
$mode_search = 2;
}
- if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
+ if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : $key), $search[$key], (($key == 'status') ? 2 : $mode_search));
}
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
// Add where from extra fields
diff --git a/htdocs/public/ticket/img/bg_ticket.png b/htdocs/public/ticket/img/bg_ticket.png
deleted file mode 100644
index c5fd05c662a..00000000000
Binary files a/htdocs/public/ticket/img/bg_ticket.png and /dev/null differ
diff --git a/htdocs/public/ticket/img/index.html b/htdocs/public/ticket/img/index.html
deleted file mode 100644
index 8b137891791..00000000000
--- a/htdocs/public/ticket/img/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 97226314209..2ac6d0d33f3 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2044,7 +2044,7 @@ else
print '';
}
print '';
- if ($conf->browser->layout == 'phone') print '';
+ print ' ';
print '| '.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).' | ';
print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1);
if (!isOnlyOneLocalTax(2))
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 97c0ee27e4e..fa87111c2e8 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -897,7 +897,7 @@ class SupplierProposal extends CommonObject
}
// Multicurrency
- if (!empty($this->multicurrency_code)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
+ if (!empty($this->multicurrency_code)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now);
if (empty($this->fk_multicurrency))
{
$this->multicurrency_code = $conf->currency;
diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php
index c5f4b8d248c..3b6bf98a1f9 100644
--- a/htdocs/theme/eldy/info-box.inc.php
+++ b/htdocs/theme/eldy/info-box.inc.php
@@ -381,12 +381,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
height: 0;
}
+.info-box-title {
+ width: calc(100% - 20px);
+}
.info-box-module {
min-width: 350px;
max-width: 350px;
}
-.info-box-title {
- width: calc(100% - 20px);
+@media only screen and (max-width: 1740px) {
+ .info-box-module {
+ min-width: 315px;
+ max-width: 315px;
+ }
}
@media only screen and (max-width: 767px) {
.info-box-module {
diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php
index aae84a27c1b..b86b935c5d1 100644
--- a/htdocs/theme/md/dropdown.inc.php
+++ b/htdocs/theme/md/dropdown.inc.php
@@ -147,7 +147,7 @@ button.dropdown-item.global-search-item {
* MENU Dropdown
*/
.login_block.usedropdown .logout-btn{
- display: none;
+ /* display: none; */
}
.tmenu .open.dropdown, .tmenu .open.dropdown {
diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php
index f1c58b4241e..86e6411a923 100644
--- a/htdocs/theme/md/info-box.inc.php
+++ b/htdocs/theme/md/info-box.inc.php
@@ -439,6 +439,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO =
min-width: 350px;
max-width: 350px;
}
+@media only screen and (max-width: 1740px) {
+ .info-box-module {
+ min-width: 315px;
+ max-width: 315px;
+ }
+}
+@media only screen and (max-width: 767px) {
+ .info-box-module {
+ min-width: 260px;
+ }
+}
+
.info-box-module .info-box-content {
height: 6.3em;
}
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index c81e4068558..2b915fbb46f 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -164,7 +164,7 @@ if ($id > 0)
}
else
{
- print $form->textwithpicto((empty($object->clicktodial_url) ? $langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc"));
+ print $form->textwithpicto((empty($object->clicktodial_url) ? ''.$langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc"));
}
print ' | ';
print ' ';
diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php
index f56d00b5bcd..fccaa4909cc 100644
--- a/test/phpunit/CodingSqlTest.php
+++ b/test/phpunit/CodingSqlTest.php
@@ -164,7 +164,10 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
continue;
print 'Check sql file '.$file."\n";
- $filecontent=file_get_contents($dir.'/'.$file);
+ $filecontent = file_get_contents($dir.'/'.$file);
+
+ // Allow ` for 'rank' column name
+ $filecontent = str_replace('`rank`', '_rank_', $filecontent);
$result=strpos($filecontent, '`');
print __METHOD__." Result for checking we don't have back quote = ".$result."\n";
|