Minor change

This commit is contained in:
Laurent Destailleur 2009-01-09 22:52:45 +00:00
parent d199656812
commit 8d19da30f4
7 changed files with 66 additions and 47 deletions

View File

@ -41,7 +41,7 @@ $diroutputpdf=$conf->facture->dir_output . '/unpayed/temp';
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture',$facid,'');
$result = restrictedArea($user,'facture',$facid,'');
/*
@ -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)
@ -231,7 +231,17 @@ if ($result)
$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"));
if ($option == 'late') $titre.=' ('.$langs->trans("Late").')';
@ -264,16 +274,16 @@ if ($result)
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<tr 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">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
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 '<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 '<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 '<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>';
@ -321,12 +331,14 @@ if ($result)
$filename=sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . sanitizeFileName($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1,$param);
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";
@ -368,13 +380,17 @@ if ($result)
* Show list of available documents
*/
$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;
$delallowed=$user->rights->facture->lire;
print '<br>';
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>';
$db->free();

View File

@ -88,7 +88,7 @@ $titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("Payme
print_fiche_titre($titre);
// Formulaire de génération
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">';
$cmonth = date("n", time());
$syear = date("Y", time());

View File

@ -437,7 +437,7 @@ if ($action == 'remove_file')
clearstatcache();
$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))
{
@ -446,7 +446,7 @@ if ($action == 'remove_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));

View File

@ -122,18 +122,19 @@ class FormFile
* \param filedir Dir to scan
* \param urlsource Url of origin page (for return)
* \param genallowed Generation is allowed (1/0 or array of formats)
* \param delallowed Suppression autoris<EFBFBD>e (1/0)
* \param modelselected Modele <EFBFBD> pr<EFBFBD>-s<EFBFBD>lectionner par d<EFBFBD>faut
* \param delallowed Remove is allowed (1/0)
* \param modelselected Model to preselect by default
* \param modelliste Tableau des modeles possibles. Use '' to hide combo select list.
* \param forcenomultilang N'affiche pas option langue meme si MAIN_MULTILANGS d<EFBFBD>fini
* \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 maxfilenamelength Max length for filename shown
* \param noform Do not output html form start and end
* \remarks Le fichier de facture d<EFBFBD>taill<EFBFBD>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
* \return int <0 si ko, nbre de fichiers affich<EFBFBD>s 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)
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
@ -330,7 +331,7 @@ class FormFile
}
$file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.$png,'date',SORT_DESC);
// Affiche en-tete tableau si non deja affich<EFBFBD>
// Affiche en-tete tableau si non deja affiche
if (sizeof($file_list) && ! $headershown && !$iconPDF)
{
$headershown=1;
@ -338,12 +339,12 @@ class FormFile
print '<table class="border" width="100%">';
}
// Boucle sur chaque ligne trouv<EFBFBD>e
// Boucle sur chaque ligne trouvee
foreach($file_list as $i => $file)
{
$var=!$var;
// D<EFBFBD>fini chemin relatif par rapport au module pour lien download
// Defini chemin relatif par rapport au module pour lien download
$relativepath=$file["name"]; // Cas general
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
// Autre cas
@ -372,7 +373,10 @@ class FormFile
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>';

View File

@ -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?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 ($conf->global->BILL_ADD_PAYMENT_VALIDATION)

View File

@ -1,6 +1,6 @@
<?php
/* 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
* it under the terms of the GNU General Public License as published by
@ -19,25 +19,25 @@
*/
/**
\file htdocs/includes/modules/rapport/pdf_paiement.class.php
\ingroup banque
\brief Fichier de la classe permettant de g<EFBFBD>n<EFBFBD>rer les rapports de paiement
\version $Id$
*/
* \file htdocs/includes/modules/rapport/pdf_paiement.class.php
* \ingroup banque
* \brief Fichier de la classe permettant de g<EFBFBD>n<EFBFBD>rer les rapports de paiement
* \version $Id$
*/
require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
/**
\class pdf_paiement
\brief Classe permettant de g<EFBFBD>n<EFBFBD>rer les rapports de paiement
*/
* \class pdf_paiement
* \brief Classe permettant de generer les rapports de paiement
*/
class pdf_paiement extends FPDF
{
/**
\brief Constructeur
\param db handler acc<EFBFBD>s base de donn<EFBFBD>e
*/
* \brief Constructeur
* \param db handler acces base de donnee
*/
function pdf_paiement($db)
{
global $langs;

View File

@ -421,6 +421,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='')
// What is page code of texts from strftime functions ?
$pagecodefrom='ISO-8859-1';
$localtime=setlocale(LC_TIME,0);
//print $localtime;
if (eregi('UTF',$localtime)) $pagecodefrom='UTF-8';
if (! is_object($outputlangs)) $outputlangs=$langs;