Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
ldestailleur 2019-01-02 19:42:15 +01:00
commit bc00fb177a
19 changed files with 136 additions and 18 deletions

View File

@ -132,6 +132,71 @@ Following changes may create regressions for some external modules, but were nec
* Remove the no more used and deprecated dol_print_graph function
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
FIX: #10030 better german chart
FIX: #10036
FIX: #10080 Supplier translations are in english
FIX: #10183 using backport of fix done in 9.0
FIX: #10218 Bad redirection after deleting a user or group
FIX: #3234
FIX: #6580
FIX: #8741
FIX: #9629 #9625
FIX: #9971
FIX: avoid Class 'AdherentType' not found
FIX: Can relaunch install on v8
FIX: Can't create a thirdparty from member if customer code is mandatory.
FIX: Can't delete a line of minimal stock per warehouse
FIX: check if "entity" is already defined in "$param"
FIX: contact/address tab issue when changing company
FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account
FIX: CVE-2018-19799
FIX: CVE-2018-19992
FIX: CVE-2018-19993
FIX: CVE-2018-19994
FIX: CVE-2018-19995 and CVE-2018-19998
FIX: Error reported when creation of thirdparty from member fails
FIX: export only prices of the current entity !
FIX: Extrafields on shipment module
FIX: filter on product category doesn't work
FIX: form actions: select_type_actions could be too small + bad $db init
FIX: form actions: select_type_actions could be too small + bad init
FIX: fourn payment modes musn't be available on customer docs
FIX: Function updatePrice with wrong parameters
FIX: hidden extrafield
FIX: if qty is 0
FIX: If we change customer/supplier rule we can't edit old thirdparty.
FIX: lang not loaded
FIX: Lines are not inserted correctly if VAT have code
FIX: marge sign
FIX: Method setValid not found
FIX: Migration do not create not used table
FIX: missing action "edit" for the hook
FIX: missing field "visible"
FIX: Missing last month on vat report per month
FIX: mode is only customer in stats fichinter
FIX: OppStatusShort doesn't exists
FIX: Remote ip detection was wrong with proxy (example: cloudflare)
FIX: Removed not use table
FIX: Replenishment with option STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE
FIX: responsive
FIX: Same on customer card
FIX: same on lines
FIX: screen size fall
FIX: Select first mail model by default
FIX: slow SQL query on creating a new supplier invoice
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
FIX: supplier order list keep socid
FIX: Same on customer card
FIX: same on lines
FIX: screen size fall
FIX: Select first mail model by default
FIX: slow SQL query on creating a new supplier invoice
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
FIX: supplier order list keep socid
FIX: Vendor translations are in english
FIX: Warning: count()
FIX: We want to be able to send PDF of paid invoices
***** ChangeLog for 8.0.3 compared to 8.0.2 *****
FIX: #9161

View File

@ -2187,7 +2187,7 @@ if ($action == 'create')
print '</tr></table>';
print '</td><td>';
if (! empty($object->brouillon) && $action == 'editmode' && $usercancreate) {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}

View File

@ -2253,7 +2253,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print $form->editfieldkey("PaymentMode", 'mode', '', $object, $editenable);
print '</td><td>';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}

View File

@ -1335,11 +1335,11 @@ else
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
}
else
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none', 'CRDT');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none');
}
print '</td></tr>';

View File

@ -382,6 +382,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
if (empty($conf->use_javascript_ajax)) return '';
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ! defined('REQUIRE_JQUERY_MULTISELECT')) return '';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0;

View File

@ -467,6 +467,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// Background color THEME_ELDY_BACKBODY
@ -513,6 +514,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// TopMenuBackgroundColor
@ -561,6 +563,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// LeftMenuBackgroundColor
@ -609,6 +612,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// TextTitleColor for title of Pages
@ -719,6 +723,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// BackgroundTableLineEvenColor
@ -748,6 +753,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// Text LinkColor
@ -798,6 +804,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// Use Hover
@ -888,5 +895,38 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '</tr>';
}
// Use MAIN_OPTIMIZEFORTEXTBROWSER
if ($foruserprofile)
{
$default=$langs->trans('No');
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").'</td>';
print '<td colspan="'.($colspan-1).'">';
if ($edit)
{
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1);
}
else
{
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
print yn($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER);
}
else
{
print yn(1);
if (empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' ('.$langs->trans("ForcedByGlobalSetup").')';
}
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>'.yn(0).'</strong>) ';
print $form->textwithpicto('', $langs->trans("MAIN_OPTIMIZEFORTEXTBROWSERDesc"));
print '</td>';
print '</tr>';
}
else
{
// TODO
}
print '</table>';
}

View File

@ -153,7 +153,7 @@ function print_start_menu_array_auguria()
global $conf;
print '<div class="tmenudiv">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
print '<ul role="navigation" class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
/**

View File

@ -382,7 +382,7 @@ function print_start_menu_array()
global $conf;
print '<div class="tmenudiv">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
print '<ul role="navigation" class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
/**

View File

@ -29,7 +29,7 @@ class MenuManager
* @var DoliDB Database handler.
*/
public $db;
var $type_user=0; // Put 0 for internal users, 1 for external users
var $atarget=""; // To store default target to use onto links
@ -521,7 +521,7 @@ function print_start_menu_array_empty()
global $conf;
print '<div class="tmenudiv">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
print '<ul role="navigation" class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
/**

View File

@ -81,6 +81,7 @@ else
$showtitlebefore = GETPOST('showtitlebefore','int');
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
$i=0;
$accesskeyalreadyassigned=array();
foreach($arrayresult as $key => $val)
{
@ -94,7 +95,9 @@ else
$accesskey=$val['label'][0];
$accesskeyalreadyassigned[$accesskey]=$accesskey;
}
$searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('',$val['img'],'', 0, 1), $showtitlebefore);
$searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('',$val['img'],'', 0, 1), $showtitlebefore, ($i>0?0:1));
$i++;
}
}

View File

@ -256,7 +256,7 @@ if ($object->id > 0)
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_supplier_id,'mode_reglement_supplier_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_supplier_id,'mode_reglement_supplier_id', 'DBIT', 1, 1);
}
else
{

View File

@ -1949,7 +1949,7 @@ elseif (! empty($object->id))
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id','DBIT', 1, 1);
}
else
{

View File

@ -2529,11 +2529,11 @@ else
print '</td><td colspan="2">';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT', 1, 1);
}
else
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none', 'DBIT');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none');
}
print '</td></tr>';

View File

@ -463,6 +463,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_EXTERNALSITE'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',

View File

@ -1744,7 +1744,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax))
{
$urltosearch=DOL_URL_ROOT.'/core/search_page.php?showtitlebefore=1';
$searchform='<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>';
$searchform='<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" accesskey="s" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>';
}
elseif ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_USE_OLD_SEARCH_FORM))
{
@ -1939,9 +1939,10 @@ function getHelpParamFor($helppagename,$langs)
* @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page
* @param string $img Image to use
* @param string $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers.
* @param string $autofocus Set autofocus on field
* @return string
*/
function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='',$img='', $showtitlebefore=0)
function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='',$img='', $showtitlebefore=0, $autofocus=0)
{
global $conf,$langs,$user;
@ -1955,6 +1956,7 @@ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinpu
$ret.=' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"';
$ret.=($accesskey?' accesskey="'.$accesskey.'"':'');
$ret.=' placeholder="'.strip_tags($title).'"';
$ret.=($autofocus?' autofocus':'');
$ret.=' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />';
//$ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.$langs->trans("Go").'">';
$ret.='<button type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">';

View File

@ -4245,7 +4245,7 @@ class Product extends CommonObject
{
$result=array();
$sql = "SELECT pb.batch, pb.eatby, pb.sellby, SUM(pb.qty) FROM ".MAIN_DB_PREFIX."product_batch as pb, ".MAIN_DB_PREFIX."product_stock as ps";
$sql = "SELECT pb.batch, pb.eatby, pb.sellby, SUM(pb.qty) AS qty FROM ".MAIN_DB_PREFIX."product_batch as pb, ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " WHERE pb.fk_product_stock = ps.rowid AND ps.fk_product = ".$this->id." AND pb.batch = '".$this->db->escape($batch)."'";
$sql.= " GROUP BY pb.batch, pb.eatby, pb.sellby";
dol_syslog(get_class($this)."::loadBatchInfo load first entry found for lot/serial = ".$batch, LOG_DEBUG);

View File

@ -1436,7 +1436,7 @@ class Societe extends CommonObject
}
// Use first price level if level not defined for third party
if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->price_level)) $this->price_level=1;
if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && empty($this->price_level)) $this->price_level=1;
return $result;
}

View File

@ -1510,7 +1510,7 @@ if ($action == 'create')
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT', 1, 1);
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}

View File

@ -150,6 +150,12 @@ if (empty($reshook)) {
$tabparam["THEME_ELDY_USE_CHECKED"] = 0;
}
if (GETPOST('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 1;
} else {
$tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0;
}
$result = dol_set_user_param($db, $conf, $object, $tabparam);
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);