FIX download of file must be done using a GET href link, not a POST.
This commit is contained in:
parent
564382ec6c
commit
edf779505c
@ -588,14 +588,13 @@ foreach ($listofchoices as $choice => $val) {
|
|||||||
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
|
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.$disabled.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="submit" class="button" name="search" value="'.$langs->trans("Search").'">';
|
print '<input type="submit" class="button small" name="search" value="'.$langs->trans("Search").'">';
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
if (!empty($date_start) && !empty($date_stop)) {
|
if (!empty($date_start) && !empty($date_stop)) {
|
||||||
$param = 'action=searchfiles';
|
|
||||||
$param .= '&date_startday='.GETPOST('date_startday', 'int');
|
$param .= '&date_startday='.GETPOST('date_startday', 'int');
|
||||||
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');
|
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');
|
||||||
$param .= '&date_startyear='.GETPOST('date_startyear', 'int');
|
$param .= '&date_startyear='.GETPOST('date_startyear', 'int');
|
||||||
@ -603,13 +602,30 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
$param .= '&date_stopmonth='.GETPOST('date_stopmonth', 'int');
|
$param .= '&date_stopmonth='.GETPOST('date_stopmonth', 'int');
|
||||||
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
|
$param .= '&date_stopyear='.GETPOST('date_stopyear', 'int');
|
||||||
foreach ($listofchoices as $choice => $val) {
|
foreach ($listofchoices as $choice => $val) {
|
||||||
$param .= '&'.$choice.'='.(GETPOST($choice, 'int') ? 1 : 0);
|
if (GETPOST($choice, 'int')) {
|
||||||
|
$param .= '&'.$choice.'=1';
|
||||||
}
|
}
|
||||||
print '<form name="dl" action="'.$_SERVER["PHP_SELF"].'?action=dl" method="POST">'."\n";
|
}
|
||||||
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
|
||||||
|
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
||||||
|
|
||||||
|
|
||||||
|
$filename = dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel').'_export.zip';
|
||||||
|
|
||||||
echo dol_print_date($date_start, 'day', 'tzuserrel')." - ".dol_print_date($date_stop, 'day', 'tzuserrel');
|
echo dol_print_date($date_start, 'day', 'tzuserrel')." - ".dol_print_date($date_stop, 'day', 'tzuserrel');
|
||||||
|
|
||||||
|
print '<a class="marginleftonly small'.(empty($TData) ? ' butActionRefused' : ' butAction').'" href="'.$_SERVER["PHP_SELF"].'?action=dl&token='.newToken().'&output=file&file='.urlencode($filename).$param.'"';
|
||||||
|
if (empty($TData)) {
|
||||||
|
print " disabled";
|
||||||
|
}
|
||||||
|
print '>'."\n";
|
||||||
|
print $langs->trans("Download");
|
||||||
|
print '</a><br>';
|
||||||
|
|
||||||
|
$param .= '&action=searchfiles';
|
||||||
|
|
||||||
|
/*
|
||||||
|
print '<input type="hidden" name="token" value="'.currentToken().'">';
|
||||||
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
print '<input type="hidden" name="date_startday" value="'.GETPOST('date_startday', 'int').'" />';
|
||||||
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
print '<input type="hidden" name="date_startmonth" value="'.GETPOST('date_startmonth', 'int').'" />';
|
||||||
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
print '<input type="hidden" name="date_startyear" value="'.GETPOST('date_startyear', 'int').'" />';
|
||||||
@ -620,8 +636,13 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
print '<input type="hidden" name="'.$choice.'" value="'.GETPOST($choice).'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input class="butAction butDownload" type="submit" value="'.$langs->trans("Download").'" />';
|
print '<input class="butAction butDownload small marginleftonly" type="submit" value="'.$langs->trans("Download").'"';
|
||||||
|
if (empty($TData)) {
|
||||||
|
print " disabled";
|
||||||
|
}
|
||||||
|
print '/>';
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
*/
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
@ -645,11 +666,9 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
print '<td class="center">'.$langs->trans("Currency").'</td>';
|
print '<td class="center">'.$langs->trans("Currency").'</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($result) {
|
|
||||||
$TData = dol_sort_array($filesarray, $sortfield, $sortorder);
|
|
||||||
|
|
||||||
if (empty($TData)) {
|
if (empty($TData)) {
|
||||||
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td>';
|
print '<tr class="oddeven"><td colspan="13"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td>';
|
||||||
if (!empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
@ -821,7 +840,7 @@ if (!empty($date_start) && !empty($date_stop)) {
|
|||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user