Skip to content
Snippets Groups Projects
Commit 8d19da30 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Minor change

parent d1996568
No related branches found
No related tags found
No related merge requests found
...@@ -186,24 +186,24 @@ if ($_GET["filtre"]) ...@@ -186,24 +186,24 @@ if ($_GET["filtre"])
} }
} }
if ($_GET["search_ref"]) if ($_REQUEST["search_ref"])
{ {
$sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'"; $sql .= " AND f.facnumber like '%".$_REQUEST["search_ref"]."%'";
} }
if ($_GET["search_societe"]) if ($_REQUEST["search_societe"])
{ {
$sql .= " AND s.nom like '%".$_GET["search_societe"]."%'"; $sql .= " AND s.nom like '%".$_REQUEST["search_societe"]."%'";
} }
if ($_GET["search_montant_ht"]) if ($_REQUEST["search_montant_ht"])
{ {
$sql .= " AND f.total = '".$_GET["search_montant_ht"]."'"; $sql .= " AND f.total = '".$_REQUEST["search_montant_ht"]."'";
} }
if ($_GET["search_montant_ttc"]) if ($_REQUEST["search_montant_ttc"])
{ {
$sql .= " AND f.total_ttc = '".$_GET["search_montant_ttc"]."'"; $sql .= " AND f.total_ttc = '".$_REQUEST["search_montant_ttc"]."'";
} }
if (strlen($_POST["sf_ref"]) > 0) if (strlen($_POST["sf_ref"]) > 0)
...@@ -231,7 +231,17 @@ if ($result) ...@@ -231,7 +231,17 @@ if ($result)
$soc->fetch($socid); $soc->fetch($socid);
} }
$param="&socid=".$socid."&option=".$option; $param="";
$param.=($socid?"&socid=".$socid:"");
$param.=($option?"&option=".$option:"");
if ($_REQUEST["search_ref"]) $param.='&search_ref='.urlencode($_REQUEST["search_ref"]);
if ($_REQUEST["search_societe"]) $param.='&search_societe='.urlencode($_REQUEST["search_societe"]);
if ($_REQUEST["search_montant_ht"]) $param.='&search_montant_ht='.urlencode($_REQUEST["search_montant_ht"]);
if ($_REQUEST["search_montant_ttc"]) $param.='&search_montant_ttc='.urlencode($_REQUEST["search_montant_ttc"]);
if ($_REQUEST["late"]) $param.='&late='.urlencode($_REQUEST["search_late"]);
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=eregi_replace('&','&',$param);
$titre=($socid?$langs->trans("BillsCustomersUnpayedForCompany",$soc->nom):$langs->trans("BillsCustomersUnpayed")); $titre=($socid?$langs->trans("BillsCustomersUnpayedForCompany",$soc->nom):$langs->trans("BillsCustomersUnpayed"));
if ($option == 'late') $titre.=' ('.$langs->trans("Late").')'; if ($option == 'late') $titre.=' ('.$langs->trans("Late").')';
...@@ -264,16 +274,16 @@ if ($result) ...@@ -264,16 +274,16 @@ if ($result)
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_GET["search_ref"].'"></td>'; print '<input class="flat" size="10" type="text" name="search_ref" value="'.$_REQUEST["search_ref"].'"></td>';
print '<td class="liste_titre" align="center"><input type="checkbox" onclick="checkall(this.checked);"></td>'; print '<td class="liste_titre" align="center"><input type="checkbox" onclick="checkall(this.checked);"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_societe" value="'.$_GET["search_societe"].'">'; print '<input class="flat" type="text" name="search_societe" value="'.$_REQUEST["search_societe"].'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_GET["search_montant_ht"].'">'; print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$_REQUEST["search_montant_ht"].'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="10" name="search_montant_ttc" value="'.$_GET["search_montant_ttc"].'">'; print '<input class="flat" type="text" size="10" name="search_montant_ttc" value="'.$_REQUEST["search_montant_ttc"].'">';
print '</td><td class="liste_titre" colspan="2" align="right">'; print '</td><td class="liste_titre" colspan="2" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '</td>'; print '</td>';
...@@ -321,12 +331,14 @@ if ($result) ...@@ -321,12 +331,14 @@ if ($result)
$filename=sanitizeFileName($objp->facnumber); $filename=sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . sanitizeFileName($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid; $foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1,$param);
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
print '</td></tr></table>'; print '</td></tr></table>';
print '<td align="center"><input id="cb'.$objp->facid.'" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'"></td>' ; // Checkbox
print '<td align="center">';
if ($foundpdf) print '<input id="cb'.$objp->facid.'" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
else print '&nbsp;';
print '</td>' ;
print "</td>\n"; print "</td>\n";
...@@ -368,13 +380,17 @@ if ($result) ...@@ -368,13 +380,17 @@ if ($result)
* Show list of available documents * Show list of available documents
*/ */
$filedir=$diroutputpdf; $filedir=$diroutputpdf;
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id; if ($_REQUEST["search_ref"]) print '<input type="hidden" name="search_ref" value="'.$_REQUEST["search_ref"].'">';
if ($_REQUEST["search_societe"]) print '<input type="hidden" name="search_societe" value="'.$_REQUEST["search_societe"].'">';
if ($_REQUEST["search_montant_ht"]) print '<input type="hidden" name="search_montant_ht" value="'.$_REQUEST["search_montant_ht"].'">';
if ($_REQUEST["search_montant_ttc"]) print '<input type="hidden" name="search_montant_ttc" value="'.$_REQUEST["search_montant_ttc"].'">';
if ($_REQUEST["late"]) print '<input type="hidden" name="late" value="'.$_REQUEST["late"].'">';
$genallowed=$user->rights->facture->lire; $genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->lire;
print '<br>'; print '<br>';
print '<input type="hidden" name="option" value="'.$option.'">'; print '<input type="hidden" name="option" value="'.$option.'">';
$formfile->show_documents('unpayed','',$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,48,1); $formfile->show_documents('unpayed','',$filedir,$urlsource,$genallowed,$delallowed,'','',0,0,48,1,$param);
print '</form>'; print '</form>';
$db->free(); $db->free();
......
...@@ -88,7 +88,7 @@ $titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("Payme ...@@ -88,7 +88,7 @@ $titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("Payme
print_fiche_titre($titre); print_fiche_titre($titre);
// Formulaire de gnration // Formulaire de gnration
print '<br><form method="post" action="rapport.php?year='.$year.'">'; print '<form method="post" action="rapport.php?year='.$year.'">';
print '<input type="hidden" name="action" value="gen">'; print '<input type="hidden" name="action" value="gen">';
$cmonth = date("n", time()); $cmonth = date("n", time());
$syear = date("Y", time()); $syear = date("Y", time());
......
...@@ -437,7 +437,7 @@ if ($action == 'remove_file') ...@@ -437,7 +437,7 @@ if ($action == 'remove_file')
clearstatcache(); clearstatcache();
$filename = basename($original_file); $filename = basename($original_file);
dolibarr_syslog("document.php remove $original_file $filename $urlsource"); dolibarr_syslog("document.php remove $original_file $filename $urlsource", LOG_DEBUG);
if (! file_exists($original_file)) if (! file_exists($original_file))
{ {
...@@ -446,7 +446,7 @@ if ($action == 'remove_file') ...@@ -446,7 +446,7 @@ if ($action == 'remove_file')
} }
unlink($original_file); unlink($original_file);
dolibarr_syslog("document.php back to ".urldecode($urlsource)); dolibarr_syslog("document.php back to ".urldecode($urlsource), LOG_DEBUG);
header("Location: ".urldecode($urlsource)); header("Location: ".urldecode($urlsource));
......
...@@ -122,18 +122,19 @@ class FormFile ...@@ -122,18 +122,19 @@ class FormFile
* \param filedir Dir to scan * \param filedir Dir to scan
* \param urlsource Url of origin page (for return) * \param urlsource Url of origin page (for return)
* \param genallowed Generation is allowed (1/0 or array of formats) * \param genallowed Generation is allowed (1/0 or array of formats)
* \param delallowed Suppression autoris�e (1/0) * \param delallowed Remove is allowed (1/0)
* \param modelselected Modele � pr�-s�lectionner par dfaut * \param modelselected Model to preselect by default
* \param modelliste Tableau des modeles possibles. Use '' to hide combo select list. * \param modelliste Tableau des modeles possibles. Use '' to hide combo select list.
* \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS dfini * \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS defini
* \param iconPDF N'affiche que l'icone PDF avec le lien (1/0) * \param iconPDF N'affiche que l'icone PDF avec le lien (1/0)
* \param maxfilenamelength Max length for filename shown * \param maxfilenamelength Max length for filename shown
* \param noform Do not output html form start and end * \param noform Do not output html form start and end
* \remarks Le fichier de facture d�taill�e est de la forme * \param param More param on http links
* \remarks Le fichier de facture detaillee est de la forme
* REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse * REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse
* \return int <0 si ko, nbre de fichiers affichs si ok * \return int <0 si ko, nbre de fichiers affiches si ok
*/ */
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0) function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='')
{ {
// filedir = conf->...dir_ouput."/".get_exdir(id) // filedir = conf->...dir_ouput."/".get_exdir(id)
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
...@@ -330,7 +331,7 @@ class FormFile ...@@ -330,7 +331,7 @@ class FormFile
} }
$file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.$png,'date',SORT_DESC); $file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.$png,'date',SORT_DESC);
// Affiche en-tete tableau si non deja affich // Affiche en-tete tableau si non deja affiche
if (sizeof($file_list) && ! $headershown && !$iconPDF) if (sizeof($file_list) && ! $headershown && !$iconPDF)
{ {
$headershown=1; $headershown=1;
...@@ -338,12 +339,12 @@ class FormFile ...@@ -338,12 +339,12 @@ class FormFile
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
} }
// Boucle sur chaque ligne trouve // Boucle sur chaque ligne trouvee
foreach($file_list as $i => $file) foreach($file_list as $i => $file)
{ {
$var=!$var; $var=!$var;
// Dfini chemin relatif par rapport au module pour lien download // Defini chemin relatif par rapport au module pour lien download
$relativepath=$file["name"]; // Cas general $relativepath=$file["name"]; // Cas general
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
// Autre cas // Autre cas
...@@ -372,7 +373,10 @@ class FormFile ...@@ -372,7 +373,10 @@ class FormFile
if ($delallowed) if ($delallowed)
{ {
print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'&amp;urlsource='.urlencode($urlsource).'">'.img_delete().'</a></td>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&amp;modulepart='.$modulepart.'&amp;file='.urlencode($relativepath);
print ($param?'&amp;'.$param:'');
print '&amp;urlsource='.urlencode($urlsource);
print '">'.img_delete().'</a></td>';
} }
if (!$iconPDF) print '</tr>'; if (!$iconPDF) print '</tr>';
......
...@@ -435,8 +435,6 @@ class MenuLeft { ...@@ -435,8 +435,6 @@ class MenuLeft {
} }
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpayed"),2,$user->rights->facture->lire); if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpayed"),2,$user->rights->facture->lire);
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/facture/impayees.php?option=late&amp;leftmenu=customers_bills",$langs->trans("Unpayed").' ('.$langs->trans("Late").')',2,$user->rights->facture->lire);
if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire); if (eregi("customers_bills",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
......
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* 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
...@@ -19,24 +19,24 @@ ...@@ -19,24 +19,24 @@
*/ */
/** /**
\file htdocs/includes/modules/rapport/pdf_paiement.class.php * \file htdocs/includes/modules/rapport/pdf_paiement.class.php
\ingroup banque * \ingroup banque
\brief Fichier de la classe permettant de g�n�rer les rapports de paiement * \brief Fichier de la classe permettant de g�n�rer les rapports de paiement
\version $Id$ * \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
/** /**
\class pdf_paiement * \class pdf_paiement
\brief Classe permettant de g�n�rer les rapports de paiement * \brief Classe permettant de generer les rapports de paiement
*/ */
class pdf_paiement extends FPDF class pdf_paiement extends FPDF
{ {
/** /**
\brief Constructeur * \brief Constructeur
\param db handler accs base de donne * \param db handler acces base de donnee
*/ */
function pdf_paiement($db) function pdf_paiement($db)
{ {
......
...@@ -421,6 +421,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='') ...@@ -421,6 +421,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
// What is page code of texts from strftime functions ? // What is page code of texts from strftime functions ?
$pagecodefrom='ISO-8859-1'; $pagecodefrom='ISO-8859-1';
$localtime=setlocale(LC_TIME,0); $localtime=setlocale(LC_TIME,0);
//print $localtime;
if (eregi('UTF',$localtime)) $pagecodefrom='UTF-8'; if (eregi('UTF',$localtime)) $pagecodefrom='UTF-8';
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment