Merge branch '3.8' of github.com:Dolibarr/dolibarr into 3.8

This commit is contained in:
Laurent Destailleur 2016-01-10 18:47:47 +01:00
commit a9f0d6964a
12 changed files with 63 additions and 27 deletions

View File

@ -430,6 +430,25 @@ Dolibarr better:
- Function get_exdir require now 6 parameters. This is to prepare a future feature. - Function get_exdir require now 6 parameters. This is to prepare a future feature.
***** ChangeLog for 3.7.3 compared to 3.7.2 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #3890 Expected transactions bank account page, shows negative numbers
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
FIX: #4081 Added missing translation
FIX: #4097 Public holiday calculation
FIX: #4242 Allow disabling dashes in documents
FIX: #4243 sql injection
FIX: Can use formated float number on old expense report module.
FIX: Change object statut when closing shipment and remove erratic db commit
FIX: Export with category contact extrafields
FIX: NB task and percent progress in box project
FIX: Not delete a product when have customer price
FIX: Not deleting contrats on element_element table
FIX: Not use localtaxes when invoice some orders
FIX: Product link in project box
FIX: Use "WHERE true" instead of "WHERE 1" #4132
***** ChangeLog for 3.7.2 compared to 3.7.1 ***** ***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX: #2957 : missing $langs object for trigger FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS FIX: #2983 Load gravatar avatar images securely over HTTPS
@ -738,6 +757,17 @@ Dolibarr better:
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it. - Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.6 compared to 3.6.5 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #4081 Added missing translation
FIX: #4097 Public holiday calculation
FIX: #4242 Allow disabling dashes in documents
FIX: #4243 sql injection
FIX: Add a protection to not make release if ChangeLog was not generated. Prepare package 3.6.5
FIX: export with category contact extrafields
FIX: Not delete a product when have customer price
FIX: Not deleting contrats on element_element table
***** ChangeLog for 3.6.5 compared to 3.6.4 ***** ***** ChangeLog for 3.6.5 compared to 3.6.4 *****
FIX: #2957 : missing $langs object for trigger FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS FIX: #2983 Load gravatar avatar images securely over HTTPS

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -95,7 +96,7 @@ if ($actionsave)
// Save nb of agenda // Save nb of agenda
if (! $error) if (! $error)
{ {
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity); $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
@ -214,9 +215,9 @@ while ($i <= $MAXAGENDA)
// Nb // Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>"; print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
// Name // Name
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key):$conf->global->$name) . '" size="28"></td>'; print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha'):$conf->global->$name) . '" size="28"></td>';
// URL // URL
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key):$conf->global->$src) . '" size="60"></td>'; print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha'):$conf->global->$src) . '" size="60"></td>';
// Offset TZ // Offset TZ
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ'.$key):$conf->global->$offsettz) . '" size="2"></td>'; print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'. (GETPOST('AGENDA_EXT_OFFSETTZ'.$key)?GETPOST('AGENDA_EXT_OFFSETTZ'.$key):$conf->global->$offsettz) . '" size="2"></td>';
// Color (Possible colors are limited by Google) // Color (Possible colors are limited by Google)

View File

@ -1294,7 +1294,7 @@ class Categorie extends CommonObject
if (is_numeric( $type )) { if (is_numeric( $type )) {
// We want to reverse lookup // We want to reverse lookup
$map_type = array_flip( $this->MAP_ID ); $map_type = array_flip( $this->MAP_ID );
$type = $map_type; $type = $map_type[$type];
dol_syslog( get_class( $this ) . "::rechercher(): numeric types are deprecated, please use string instead", dol_syslog( get_class( $this ) . "::rechercher(): numeric types are deprecated, please use string instead",
LOG_WARNING ); LOG_WARNING );
} }

View File

@ -2755,6 +2755,7 @@ abstract class CommonObject
/** /**
* Return if a country is inside the EEC (European Economic Community) * Return if a country is inside the EEC (European Economic Community)
* TODO Add a field into dictionary
* *
* @return boolean true = country inside EEC, false = country outside EEC * @return boolean true = country inside EEC, false = country outside EEC
*/ */
@ -2776,6 +2777,7 @@ abstract class CommonObject
'FR', // France 'FR', // France
'GB', // United Kingdom 'GB', // United Kingdom
'GR', // Greece 'GR', // Greece
'HR', // Croatia
'NL', // Holland 'NL', // Holland
'HU', // Hungary 'HU', // Hungary
'IE', // Ireland 'IE', // Ireland

View File

@ -93,10 +93,14 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
//dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress); //dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
$countryid=$seller->country_id; $countryid=$seller->country_id;
if (is_numeric($uselocaltax1_rate)) $uselocaltax1_rate=(float) $uselocaltax1_rate;
if (is_numeric($uselocaltax2_rate)) $uselocaltax2_rate=(float) $uselocaltax2_rate;
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj; if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
dol_syslog('Price.lib::calcul_price_total qty='.$qty.' pu='.$pu.' remise_percent_ligne='.$remise_percent_ligne.' txtva='.$txtva.' uselocaltax1_rate='.$uselocaltax1_rate.' uselocaltax2_rate='.$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress); dol_syslog('Price.lib::calcul_price_total qty='.$qty.' pu='.$pu.' remise_percent_ligne='.$remise_percent_ligne.' txtva='.$txtva.' uselocaltax1_rate='.$uselocaltax1_rate.' uselocaltax2_rate='.$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$price_base_type.' type='.$type.' progress='.$progress);
// Now we search localtaxes information ourself (rates and types). // Now we search localtaxes information ourself (rates and types).
$localtax1_type=0; $localtax1_type=0;

View File

@ -447,7 +447,7 @@ if (empty($reshook))
'HT', 'HT',
$product_type, $product_type,
$lines[$i]->rang, $lines[$i]->rang,
1, 0,
$lines[$i]->array_options, $lines[$i]->array_options,
$lines[$i]->fk_unit $lines[$i]->fk_unit
); );

View File

@ -580,10 +580,10 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes')
$newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted')); $newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde); $result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde, $cp->fk_type);
// Mise à jour du solde // Mise à jour du solde
$result2=$cp->updateSoldeCP($cp->fk_user, $newSolde); $result2=$cp->updateSoldeCP($cp->fk_user, $newSolde, $cp->fk_type);
if ($result1 < 0 || $result2 < 0) if ($result1 < 0 || $result2 < 0)
{ {

View File

@ -251,7 +251,7 @@ $out='';
$typeleaves=$holiday->getTypes(1,1); $typeleaves=$holiday->getTypes(1,1);
foreach($typeleaves as $key => $val) foreach($typeleaves as $key => $val)
{ {
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']); $nb_type = $holiday->getCPforUser($user_id, $val['rowid']);
$nb_holiday += $nb_type; $nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>'; $out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
} }

View File

@ -98,7 +98,8 @@ function test_sql_and_script_inject($val, $type)
// All examples on page: http://ha.ckers.org/xss.html#XSScalc // All examples on page: http://ha.ckers.org/xss.html#XSScalc
$sql_inj += preg_match('/<script/i', $val); $sql_inj += preg_match('/<script/i', $val);
if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val); if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val);
$sql_inj += preg_match('/base[\s]+href/i', $val); $sql_inj += preg_match('/base[\s]+href/si', $val);
$sql_inj += preg_match('/<.*onmouseover/si', $val); // onmouseover can be set on img or any html tag like <img title='>' onmouseover=alert(1)>
if ($type == 1) if ($type == 1)
{ {
$sql_inj += preg_match('/javascript:/i', $val); $sql_inj += preg_match('/javascript:/i', $val);

View File

@ -133,8 +133,7 @@ if (is_array($object->lines) && (count($object->lines)>0))
dol_syslog("cron_run_jobs.php fetch cronjobid: ".$line->id, LOG_WARNING); dol_syslog("cron_run_jobs.php fetch cronjobid: ".$line->id, LOG_WARNING);
//If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database
if ((($line->datenextrun <= $now) && $line->dateend < $now) if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now))
|| ((empty($line->datenextrun)) && (empty($line->dateend))))
{ {
dol_syslog("cron_run_jobs.php:: torun line->datenextrun:".dol_print_date($line->datenextrun,'dayhourtext')." line->dateend:".dol_print_date($line->dateend,'dayhourtext')." now:".dol_print_date($now,'dayhourtext')); dol_syslog("cron_run_jobs.php:: torun line->datenextrun:".dol_print_date($line->datenextrun,'dayhourtext')." line->dateend:".dol_print_date($line->dateend,'dayhourtext')." now:".dol_print_date($now,'dayhourtext'));

View File

@ -177,10 +177,8 @@ dol_fiche_end();
print '<br>'; print '<br>';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?socid='.$socid.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'.$socid.'">'."\n";
$sql_select=''; $sql_select='';
/*if ($type_element == 'action') /*if ($type_element == 'action')

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -33,6 +33,7 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks
// Pour autre que companylogo, on charge environnement + info issus de logon comme le user // Pour autre que companylogo, on charge environnement + info issus de logon comme le user
if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1');