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

Conflicts:
	htdocs/core/class/html.formfile.class.php
	htdocs/filefunc.inc.php
	htdocs/holiday/class/holiday.class.php
This commit is contained in:
Laurent Destailleur 2017-12-08 13:13:53 +01:00
commit f85e79e250
4 changed files with 61 additions and 56 deletions

View File

@ -46,14 +46,14 @@ $confirm=GETPOST('confirm', 'alpha');
// Security check // Security check
$fieldname = (! empty($ref)?'ref':'rowid'); $fieldname = (! empty($ref)?'ref':'rowid');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldname); $result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','fk_user_author',$fieldname);
$sortfield=GETPOST('sortfield', 'alpha'); $sortfield=GETPOST('sortfield', 'alpha');
$sortorder=GETPOST('sortorder', 'alpha'); $sortorder=GETPOST('sortorder', 'alpha');
$page=GETPOST('page', 'int'); $page=GETPOST('page', 'int');
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="b.dateo,b.rowid"; if (! $sortfield) $sortfield="b.dateo,b.rowid";
if ($page < 0) { $page = 0 ; } if (empty($page) || $page == -1) { $page = 0; }
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
@ -490,53 +490,55 @@ if ($action == 'new')
if (count($lines[$bid])) if (count($lines[$bid]))
{ {
foreach ($lines[$bid] as $lid => $value) foreach ($lines[$bid] as $lid => $value)
{ {
$account_id = $bid; //$account_id = $bid; FIXME not used
if (! isset($accounts[$bid]))
$accounts[$bid]=0;
$accounts[$bid] += 1;
print '<tr class="oddeven">'; // FIXME $accounts[$bid] is a label !
print '<td>'.dol_print_date($value["date"],'day').'</td>'; /*if (! isset($accounts[$bid]))
print '<td>'.$value["numero"]."</td>\n"; $accounts[$bid]=0;
print '<td>'.$value["emetteur"]."</td>\n"; $accounts[$bid] += 1;*/
print '<td>'.$value["banque"]."</td>\n";
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
// Link to payment print '<tr class="oddeven">';
print '<td align="center">'; print '<td>'.dol_print_date($value["date"],'day').'</td>';
$paymentstatic->id=$value["paymentid"]; print '<td>'.$value["numero"]."</td>\n";
$paymentstatic->ref=$value["paymentid"]; print '<td>'.$value["emetteur"]."</td>\n";
if ($paymentstatic->id) print '<td>'.$value["banque"]."</td>\n";
{ print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
print $paymentstatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
// Link to bank transaction
print '<td align="center">';
$accountlinestatic->rowid=$value["id"];
if ($accountlinestatic->rowid)
{
print $accountlinestatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
print '<td align="center">'; // Link to payment
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">'; print '<td align="center">';
print '</td>' ; $paymentstatic->id=$value["paymentid"];
print '</tr>'; $paymentstatic->ref=$value["paymentid"];
if ($paymentstatic->id)
{
print $paymentstatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
// Link to bank transaction
print '<td align="center">';
$accountlinestatic->rowid=$value["id"];
if ($accountlinestatic->rowid)
{
print $accountlinestatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
$i++; print '<td align="center">';
} print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
print '</td>' ;
print '</tr>';
$i++;
}
} }
print "</table>"; print "</table>";
print '</div>'; print '</div>';
@ -688,10 +690,12 @@ else
{ {
while ($objp = $db->fetch_object($resql)) while ($objp = $db->fetch_object($resql))
{ {
$account_id = $objp->bid; //$account_id = $objp->bid; FIXME not used
if (! isset($accounts[$objp->bid]))
// FIXME $accounts[$objp->bid] is a label
/*if (! isset($accounts[$objp->bid]))
$accounts[$objp->bid]=0; $accounts[$objp->bid]=0;
$accounts[$objp->bid] += 1; $accounts[$objp->bid] += 1;*/
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td align="center">'.$i.'</td>'; print '<td align="center">'.$i.'</td>';

View File

@ -6,7 +6,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com> * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
* 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
@ -958,10 +958,10 @@ class FormFile
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2,0,0,$object,'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2,0,0,$object,'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.'; if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
} }
// For backward compatiblity, we detect file is stored into an old path // For backward compatiblity, we detect file stored into an old path
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $file['level1name'] == 'photos') if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos')
{ {
$relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/'; $relativepath=preg_replace('/^.*\/produit\//','',$filearray[0]['path']).'/';
} }
// Defined relative dir to DOL_DATA_ROOT // Defined relative dir to DOL_DATA_ROOT
$relativedir = ''; $relativedir = '';

View File

@ -4102,8 +4102,8 @@ class Product extends CommonObject
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
{ {
$dirold .= get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/"; $dir = $sdir . '/'. get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/";
$pdirold .= get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/"; $pdir = '/' . get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/";
} }
// Defined relative dir to DOL_DATA_ROOT // Defined relative dir to DOL_DATA_ROOT
@ -4123,11 +4123,11 @@ class Product extends CommonObject
$filearray=dol_dir_list($dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $filearray=dol_dir_list($dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs /*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs
{ {
$filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$filearray=array_merge($filearray, $filearrayold); $filearray=array_merge($filearray, $filearrayold);
} }*/
completeFileArrayWithDatabaseInfo($filearray, $relativedir); completeFileArrayWithDatabaseInfo($filearray, $relativedir);

View File

@ -6,6 +6,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* 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