diff --git a/README.md b/README.md
index c38d0ca7dd1..bcff409035f 100644
--- a/README.md
+++ b/README.md
@@ -3,9 +3,9 @@

[](https://houndci.com)
-|6|7|8|develop|
-|----------|----------|----------|----------|
-|||||
+|6|7|8|9|develop|
+|----------|----------|----------|----------|----------|
+||||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb
index 80d1d612d65..27bc4ab2403 100644
Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 5613e42b4c4..c8df00f6cdc 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -641,7 +641,6 @@ if ($num > 0)
$object->id = $line->id;
$object->piece_num = $line->piece_num;
print $object->getNomUrl(1,'',0,'',1);
- //print '' . $line->piece_num . '';
print '';
if (! $i) $totalarray['nbfield']++;
}
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index aaafae90372..5e1f42503e0 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -75,7 +75,7 @@ $offset = $listlimit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if (empty($sortfield)) $sortfield='label, lang, position';
+if (empty($sortfield)) $sortfield='type_template, lang, position, label';
if (empty($sortorder)) $sortorder='ASC';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -85,10 +85,6 @@ $hookmanager->initHooks(array('emailtemplates'));
$tabname=array();
$tabname[25]= MAIN_DB_PREFIX."c_email_templates";
-// Criteria to sort dictionaries
-$tabsqlsort=array();
-$tabsqlsort[25]="label ASC, lang ASC, position ASC";
-
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array();
$tabfield[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content";
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 52a3a1562d3..47488e96273 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
-$langs->loadLangs(array('companies','propal','compta','bills','orders','products','deliveries'));
+$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
$socid=GETPOST('socid','int');
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 235f7a75dbd..dc30c8d3e9a 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
// Load translation files required by the page
-$langs->loadLangs(array('bills', 'companies', 'products'));
+$langs->loadLangs(array('bills', 'companies', 'products', 'categories'));
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$projectid=(GETPOST('projectid')?GETPOST('projectid','int'):0);
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 9ac7d9e258d..af15d873acb 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("companies", "suppliers"));
+$langs->loadLangs(array("companies", "suppliers", "categories"));
$action=GETPOST('action','alpha');
$massaction=GETPOST('massaction','alpha');
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 4739cc12954..ae4ada04f3b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -321,13 +321,18 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
}
}
}
- if (! empty($_SESSION['lastsearch_contextpage_'.$relativepathstring])) // If there is saved contextpage
+ // If there is saved contextpage, page or limit
+ if ($paramname == 'contextpage' && ! empty($_SESSION['lastsearch_contextpage_'.$relativepathstring]))
{
- if ($paramname == 'contextpage')
- {
- $out = $_SESSION['lastsearch_contextpage_'.$relativepathstring];
- //var_dump($paramname.' '.$out);
- }
+ $out = $_SESSION['lastsearch_contextpage_'.$relativepathstring];
+ }
+ elseif ($paramname == 'page' && ! empty($_SESSION['lastsearch_page_'.$relativepathstring]))
+ {
+ $out = $_SESSION['lastsearch_page_'.$relativepathstring];
+ }
+ elseif ($paramname == 'limit' && ! empty($_SESSION['lastsearch_limit_'.$relativepathstring]))
+ {
+ $out = $_SESSION['lastsearch_limit_'.$relativepathstring];
}
}
// Else, retreive default values if we are not doing a sort
diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php
index 792cfc19299..443c7ce1e48 100644
--- a/htdocs/core/modules/modSociete.class.php
+++ b/htdocs/core/modules/modSociete.class.php
@@ -480,14 +480,11 @@ class modSociete extends DolibarrModules
$this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_rib');
$this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.bank'=>"Bank",
'sr.code_banque'=>"BankCode",'sr.code_guichet'=>"DeskCode",'sr.number'=>"BankAccountNumber*",
- 'sr.cle_rib'=>"BankAccountNumberKey",'sr.bic'=>"BIC",'sr.iban_prefix'=>"IBAN", 'sr.domiciliation'=>"BankAccountDomiciliation",'sr.proprio' => "BankAccountOwner", 'sr.owner_address' => "BankAccountOwnerAddress", 'sr.default_rib' => 'Default',
- 'sr.fk_departement'=>"StateId",'sr.fk_pays'=>"CountryCode"
+ 'sr.cle_rib'=>"BankAccountNumberKey",'sr.bic'=>"BIC",'sr.iban_prefix'=>"IBAN", 'sr.domiciliation'=>"BankAccountDomiciliation",'sr.proprio' => "BankAccountOwner", 'sr.owner_address' => "BankAccountOwnerAddress", 'sr.default_rib' => 'Default'
);
$this->import_convertvalue_array[$r]=array(
- 'sr.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
- 'sr.fk_departement'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cstate.class.php','class'=>'Cstate','method'=>'fetch','dict'=>'DictionaryState'),
- 'sr.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
+ 'sr.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty')
);
$this->import_examplevalues_array[$r]=array('sr.fk_soc'=>"MyBigCompany",'sr.bank'=>"ING",
'sr.code_banque'=>"0000", 'sr.code_guichet'=>"1111",'sr.number'=>"3333333333",
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 504a011997f..42189a30380 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -3127,10 +3127,10 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql.= " ".$this->product_type.",";
$sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".price2num($this->subprice).",";
- $sql.= " ".price2num($this->total_ttc/$this->qty).",";
+ $sql.= " ".(! empty($this->qty)?price2num($this->total_ttc / $this->qty):price2num($this->total_ttc)).",";
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").",";
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").",";
- $sql.= ' '.(!empty($this->fk_code_ventilation)?$this->fk_code_ventilation:0).',';
+ $sql.= ' '.(! empty($this->fk_code_ventilation)?$this->fk_code_ventilation:0).',';
$sql.= ' '.$this->rang.',';
$sql.= ' '.$this->special_code.',';
$sql.= " '".$this->db->escape($this->info_bits)."',";
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 0f2f8af452e..2579b870bcd 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -732,18 +732,27 @@ if (! defined('NOLOGIN'))
$relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
//var_dump($relativepathstring);
- // We click on a link that leave a page we have to save search criteria. We save them from tmp to no tmp
+ // We click on a link that leave a page we have to save search criteria, contextpage, limit and page. We save them from tmp to no tmp
if (! empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring]))
{
$_SESSION['lastsearch_values_'.$relativepathstring]=$_SESSION['lastsearch_values_tmp_'.$relativepathstring];
unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]);
}
- // We also save contextpage
if (! empty($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]))
{
$_SESSION['lastsearch_contextpage_'.$relativepathstring]=$_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring];
unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
}
+ if (! empty($_SESSION['lastsearch_page_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_page_tmp_'.$relativepathstring] > 1)
+ {
+ $_SESSION['lastsearch_page_'.$relativepathstring]=$_SESSION['lastsearch_page_tmp_'.$relativepathstring];
+ unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]);
+ }
+ if (! empty($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]) && $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] != $conf->liste_limit)
+ {
+ $_SESSION['lastsearch_limit_'.$relativepathstring]=$_SESSION['lastsearch_limit_tmp_'.$relativepathstring];
+ unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]);
+ }
}
$action = '';
@@ -1967,7 +1976,8 @@ if (! function_exists("llxFooter"))
function llxFooter($comment='',$zone='private', $disabledoutputofmessages=0)
{
global $conf, $langs, $user, $object;
- global $delayedhtmlcontent, $contextpage;
+ global $delayedhtmlcontent;
+ global $contextpage, $page, $limit;
$ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION);
@@ -2002,8 +2012,16 @@ if (! function_exists("llxFooter"))
if (preg_match('/list\.php$/', $relativepathstring))
{
unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
- if (! empty($contextpage)) $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]=$contextpage;
+ unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]);
+ unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]);
+
+ if (! empty($contextpage)) $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]=$contextpage;
+ if (! empty($page) && $page > 1) $_SESSION['lastsearch_page_tmp_'.$relativepathstring]=$page;
+ if (! empty($limit) && $limit != $conf->limit) $_SESSION['lastsearch_limit_tmp_'.$relativepathstring]=$limit;
+
unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]);
+ unset($_SESSION['lastsearch_page_'.$relativepathstring]);
+ unset($_SESSION['lastsearch_limit_'.$relativepathstring]);
}
// Core error message
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 2bfcc66d222..be3c6c483f1 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -907,9 +907,9 @@ div.fiche {
min-width: 150px;
}
.thumbstat150 {
- min-width: 170px;
- max-wdith: 171px;
- /* width: 170px; If I use with, there is trouble on size of flex boxes solved with min+max that is a little bit higer than min */
+ min-width: 168px;
+ max-width: 169px;
+ /* width: 168px; If I use with, there is trouble on size of flex boxes solved with min+max that is a little bit higer than min */
}
.thumbstat, .thumbstat150 {
browser->name == 'ie') { ?>
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index a2fab9f41de..f42c82e89e3 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -6,7 +6,7 @@
* Copyright (C) 2005-2018 Regis Houssin
* Copyright (C) 2005 Lionel Cousteix
* Copyright (C) 2011 Herve Prot
- * Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2012-2018 Juanjo Menent
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2013-2016 Alexandre Spangaro
* Copyright (C) 2015-2017 Jean-François Ferry
@@ -154,7 +154,7 @@ if (empty($reshook)) {
$langs->load("errors");
setEventMessages($langs->trans("ErrorUserCannotBeDelete"), null, 'errors');
} else {
- header("Location: index.php?restore_lastsearch_values=1");
+ header("Location: ".DOL_URL_ROOT."/user/list.php?restore_lastsearch_values=1");
exit;
}
}
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index f4b484a72e0..1be76e8fb4d 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2017 Regis Houssin
* Copyright (C) 2011 Herve Prot
* Copyright (C) 2012 Florian Henry
+ * Copyright (C) 2018 Juanjo Menent
*
* 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
@@ -110,7 +111,7 @@ if (empty($reshook)) {
{
$object->fetch($id);
$object->delete();
- header("Location: index.php?restore_lastsearch_values=1");
+ header("Location: ".DOL_URL_ROOT."/user/group/list.php?restore_lastsearch_values=1");
exit;
}
else