Merge remote-tracking branch 'origin/3.6' into 3.6_bug

This commit is contained in:
Regis Houssin 2015-07-08 16:01:26 +02:00
commit aff3f03ae0
17 changed files with 78 additions and 40 deletions

View File

@ -206,6 +206,11 @@ Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a projec
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null
Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error
Fix: [ bug #2976 ] "Report" tab is the current tab but it is not marked as selected by the UI
Fix: [ bug #2861 ] Undefined variable $res when migrating
Fix: [ bug #2837 ] Product list table column header does not match column body
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973

View File

@ -1152,7 +1152,7 @@ class AccountLine extends CommonObject
if ($this->rappro)
{
// Protection to avoid any delete of consolidated lines
$this->error="DeleteNotPossibleLineIsConsolidated";
$this->error="ErrorDeleteNotPossibleLineIsConsolidated";
return -1;
}

View File

@ -313,17 +313,20 @@ class PaymentSocialContribution extends CommonObject
{
global $conf, $langs;
$error=0;
dol_syslog(get_class($this)."::delete");
$this->db->begin();
if (! $error)
if ($this->bank_line > 0)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url";
$sql.= " WHERE type='payment_sc' AND url_id=".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
$accline = new AccountLine($this->db);
$accline->fetch($this->bank_line);
$result = $accline->delete();
if($result < 0) {
$this->errors[] = $accline->error;
$error++;
}
}
if (! $error)

View File

@ -555,7 +555,7 @@ class Contact extends CommonObject
$this->country_id = $obj->country_id;
$this->country_code = $obj->country_id?$obj->country_code:'';
$this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):'';
$this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):'';
$this->socid = $obj->fk_soc;
$this->socname = $obj->socname;

View File

@ -165,7 +165,7 @@ function dol_shutdown()
global $conf,$user,$langs,$db;
$disconnectdone=false; $depth=0;
if (is_object($db) && ! empty($db->connected)) { $depth=$db->transaction_opened; $disconnectdone=$db->close(); }
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_DEBUG));
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_INFO));
}

View File

@ -39,7 +39,7 @@
*/
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')
{
global $langs, $hselected;
global $langs;
print "\n\n<!-- debut cartouche rapport -->\n";
@ -48,7 +48,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
$head[$h][1] = $langs->trans("Report");
$head[$h][2] = 'report';
dol_fiche_head($head, $hselected);
dol_fiche_head($head, 'report');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
foreach($moreparam as $key => $value)

View File

@ -252,6 +252,13 @@ class ExportCsv extends ModeleExports
$newvalue=$this->csv_clean($newvalue,$outputlangs->charset_output);
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
{
$array = unserialize($typefield);
$array = $array['options'];
$newvalue = $array[$newvalue];
}
fwrite($this->handle,$newvalue.$this->separator);
$this->col++;
}

View File

@ -305,7 +305,14 @@ class ExportExcel extends ModeleExports
$newvalue=$this->excel_clean($newvalue);
$typefield=isset($array_types[$code])?$array_types[$code]:'';
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
{
$array = unserialize($typefield);
$array = $array['options'];
$newvalue = $array[$newvalue];
}
// Traduction newvalue
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{

View File

@ -226,7 +226,14 @@ class ExportTsv extends ModeleExports
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) $newvalue=$outputlangs->transnoentities($reg[1]);
$newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output);
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
{
$array = unserialize($typefield);
$array = $array['options'];
$newvalue = $array[$newvalue];
}
fwrite($this->handle,$newvalue.$this->separator);
$this->col++;
}

View File

@ -355,6 +355,9 @@ class modSociete extends DolibarrModules
case 'sellist':
$typeFilter="List:".$obj->param;
break;
case 'select':
$typeFilter="Select:".$obj->param;
break;
}
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;

View File

@ -3661,8 +3661,8 @@ function migrate_reload_modules($db,$langs,$conf)
if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
@ -3671,8 +3671,8 @@ function migrate_reload_modules($db,$langs,$conf)
if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
@ -3681,8 +3681,8 @@ function migrate_reload_modules($db,$langs,$conf)
if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) {
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
@ -3732,8 +3732,8 @@ function migrate_reload_modules($db,$langs,$conf)
if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) {
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');

View File

@ -531,7 +531,7 @@ if (! defined('NOLOGIN'))
{
// We are already into an authenticated session
$login=$_SESSION["dol_login"];
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login);
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login, LOG_DEBUG);
$resultFetchUser=$user->fetch('',$login);
if ($resultFetchUser <= 0)

View File

@ -3196,7 +3196,7 @@ class Product extends CommonObject
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
if (dol_is_file($dir.$file) && preg_match('/(\.jp(e?)g|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
{
$nbphoto++;
$photo = $file;

View File

@ -324,7 +324,7 @@ else
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="snom" size="12" value="'.htmlspecialchars($snom).'">';
print '</td>';
// Barcode
if (! empty($conf->barcode->enabled))
{
@ -332,7 +332,7 @@ else
print '<input class="flat" type="text" name="sbarcode" size="6" value="'.htmlspecialchars($sbarcode).'">';
print '</td>';
}
// Date modification
print '<td class="liste_titre">';
print '&nbsp;';

View File

@ -366,10 +366,10 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
// Prix mini
print '<tr><td>' . $langs->trans("MinPrice") . ' ' . $i . '</td><td>';
if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT";
if ($object->multiprices_base_type["$i"] == 'TTC')
if ($object->multiprices_base_type["$i"] == 'TTC')
{
print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
}
}
else
{
print price($object->multiprices_min["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
@ -686,9 +686,8 @@ $sql .= " " . MAIN_DB_PREFIX . "user as u";
$sql .= " WHERE fk_product = " . $object->id;
$sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")";
$sql .= " AND p.fk_user_author = u.rowid";
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES))
$sql .= " AND p.price_level = " . $soc->price_level;
$sql .= " ORDER BY p.date_price DESC, p.price_level ASC";
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level;
$sql .= " ORDER BY p.date_price DESC, p.price_level ASC, p.rowid DESC";
// $sql .= $db->plimit();
dol_syslog("sql=" . $sql);

View File

@ -194,11 +194,11 @@ if ($resql)
if ($sref || $snom || $sall || GETPOST('search'))
{
print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy, $sortfield, $sortorder,'',$num);
print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy.(!empty($search_categ) ? '&amp;search_categ='.$search_categ : '').(!empty($toolowstock) ? '&amp;toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num);
}
else
{
print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":""), $sortfield, $sortorder,'',$num);
print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":"").(!empty($search_categ) ? '&amp;search_categ='.$search_categ : '').(!empty($toolowstock) ? '&amp;toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num);
}
if (! empty($catid))
@ -342,11 +342,11 @@ if ($resql)
{
if ($sref || $snom || $sall || GETPOST('search'))
{
print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, '');
print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy.(!empty($search_categ) ? '&amp;search_categ='.$search_categ : '').(!empty($toolowstock) ? '&amp;toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, 0, '');
}
else
{
print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":"")."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, '');
print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":"")."&amp;tosell=".$tosell."&amp;tobuy=".$tobuy.(!empty($search_categ) ? '&amp;search_categ='.$search_categ : '').(!empty($toolowstock) ? '&amp;toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, 0, '');
}
}

View File

@ -119,16 +119,23 @@ if ($resql)
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
}
$param='';
if ($mine) $param.='mode=mine';
if ($socid) $param.='&socid='.$socid;
if ($search_ref) $param.='&search_ref='.$search_ref;
if ($search_label) $param.='&search_label='.$search_label;
if ($search_societe) $param.='&search_societe='.$search_societe;
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
print '<tr class="liste_titre">';