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

This commit is contained in:
Laurent Destailleur 2012-02-29 19:41:45 +01:00
commit 7e3cb90f5a
18 changed files with 228 additions and 157 deletions

View File

@ -71,31 +71,47 @@ if ($action == 'specimen')
$commande = new Commande($db); $commande = new Commande($db);
$commande->initAsSpecimen(); $commande->initAsSpecimen();
// Charge le modele // Check if there is external models to do asked by plugins
$dir = "/core/modules/commande/doc/"; if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
$file = "pdf_".$modele.".modules.php"; $conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
$file = dol_buildpath($dir.$file); }
if (file_exists($file))
// Search template file
$file=''; $classname=''; $filefound=0;
foreach ($conf->file->dol_document_root as $dirroot)
{
// Charge le modele
$dir = $dirroot."/core/modules/commande/doc/";
$file = $dir."pdf_".$modele.".modules.php";
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
require_once($file);
}
}
if ($filefound)
{ {
$classname = "pdf_".$modele;
require_once($file); require_once($file);
$obj = new $classname($db); $module = new $classname($db);
if ($obj->write_file($commande,$langs) > 0) if ($module->write_file($commande,$langs) > 0)
{ {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf");
return; return;
} }
else else
{ {
$mesg='<div class="error">'.$obj->error.'</div>'; $mesg='<font class="error">'.$module->error.'</font>';
dol_syslog($obj->error, LOG_ERR); dol_syslog($module->error, LOG_ERR);
} }
} }
else else
{ {
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>'; $mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
} }

View File

@ -70,31 +70,47 @@ if ($action == 'specimen')
$facture = new Facture($db); $facture = new Facture($db);
$facture->initAsSpecimen(); $facture->initAsSpecimen();
// Load template // Check if there is external models to do asked by plugins
$dir = DOL_DOCUMENT_ROOT . "/core/modules/facture/doc/"; if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
$file = "pdf_".$modele.".modules.php"; $conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
if (file_exists($dir.$file)) }
// Search template file
$file=''; $classname=''; $filefound=0;
foreach ($conf->file->dol_document_root as $dirroot)
{ {
$classname = "pdf_".$modele; // Load template
require_once($dir.$file); $dir = $dirroot."/core/modules/facture/doc/";
$file = $dir."pdf_".$modele.".modules.php";
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
$obj = new $classname($db); if ($filefound)
{
require_once($file);
if ($obj->write_file($facture,$langs) > 0) $module = new $classname($db);
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf"); if ($module->write_file($facture,$langs) > 0)
return; {
} header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf");
else return;
{ }
$mesg='<font class="error">'.$obj->error.'</font>'; else
dol_syslog($obj->error, LOG_ERR); {
} $mesg='<font class="error">'.$module->error.'</font>';
dol_syslog($module->error, LOG_ERR);
}
} }
else else
{ {
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>'; $mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
} }

View File

@ -69,13 +69,28 @@ if ($action == 'specimen')
$propal = new Propal($db); $propal = new Propal($db);
$propal->initAsSpecimen(); $propal->initAsSpecimen();
// Charge le modele // Check if there is external models to do asked by plugins
$dir = "/core/modules/propale/doc/"; if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
$file = "pdf_".$modele.".modules.php"; $conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
$file = dol_buildpath($dir.$file); }
if (file_exists($file))
// Search template file
$file=''; $classname=''; $filefound=0;
foreach ($conf->file->dol_document_root as $dirroot)
{
// Charge le modele
$dir = $dirroot."/core/modules/propale/doc/";
$file = $dir."pdf_".$modele.".modules.php";
if (file_exists($file))
{
$filefound=1;
$classname = "pdf_".$modele;
break;
}
}
if ($filefound)
{ {
$classname = "pdf_".$modele;
require_once($file); require_once($file);
$module = new $classname($db); $module = new $classname($db);

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -34,7 +34,7 @@ $langs->load("categories");
// Security check // Security check
$socid=0; $socid=0;
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$ref = GETPOST("ref"); $ref = GETPOST('ref','alpha');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement', $id); $result = restrictedArea($user, 'prelevement', $id);

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -36,11 +36,11 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement','','','bons'); $result = restrictedArea($user, 'prelevement','','','bons');
// Get supervariables // Get supervariables
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = ((GETPOST("sortorder")=="")) ? "DESC" : GETPOST("sortorder"); $sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
$sortfield = ((GETPOST("sortfield")=="")) ? "p.datec" : GETPOST("sortfield"); $sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha');
$statut = GETPOST("statut"); $statut = GETPOST('statut','int');
$search_line = GETPOST("search_ligne"); $search_line = GETPOST('search_ligne','int');
llxHeader('',$langs->trans("WithdrawalsReceipts")); llxHeader('',$langs->trans("WithdrawalsReceipts"));

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -39,7 +39,7 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement', '', '', 'bons'); $result = restrictedArea($user, 'prelevement', '', '', 'bons');
// Get supervariables // Get supervariables
$action = GETPOST("action"); $action = GETPOST('action','alpha');
/* /*

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@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
@ -37,9 +37,9 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement','','','bons'); $result = restrictedArea($user, 'prelevement','','','bons');
// Get supervariables // Get supervariables
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST('sortorder','alpha');
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST('sortfield','alpha');
/* /*
* View * View
@ -77,9 +77,9 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$statut) $sql.= " AND pfd.traite = 0"; if (!$statut) $sql.= " AND pfd.traite = 0";
if ($statut) $sql.= " AND pfd.traite = ".$statut; if ($statut) $sql.= " AND pfd.traite = ".$statut;
$sql.= " AND pfd.fk_facture = f.rowid"; $sql.= " AND pfd.fk_facture = f.rowid";
if (dol_strlen(trim(GETPOST("search_societe")))) if (dol_strlen(trim(GETPOST('search_societe','alpha'))))
{ {
$sql.= " AND s.nom LIKE '%".GETPOST("search_societe")."%'"; $sql.= " AND s.nom LIKE '%".GETPOST('search_societe','alpha')."%'";
} }
$sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit+1, $offset); $sql.= $db->plimit($conf->liste_limit+1, $offset);
@ -108,8 +108,8 @@ if ($resql)
print '</tr>'; print '</tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.GETPOST("search_facture").'"></td>'; print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.GETPOST('search_facture','alpha').'"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.GETPOST("search_societe").'"></td>'; print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.GETPOST('search_societe','alpha').'"></td>';
print '<td colspan="2" class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; print '<td colspan="2" class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -39,9 +39,9 @@ if ($user->societe_id > 0) accessforbidden();
// Get supervariables // Get supervariables
$prev_id = GETPOST('id','int'); $prev_id = GETPOST('id','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = ((GETPOST("sortorder")=="")) ? "DESC" : GETPOST("sortorder"); $sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
$sortfield = ((GETPOST("sortfield")=="")) ? "p.ref" : GETPOST("sortfield"); $sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.ref" : GETPOST('sortfield','alpha');
llxHeader('',$langs->trans("WithdrawalReceipt")); llxHeader('',$langs->trans("WithdrawalReceipt"));

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -36,7 +36,7 @@ if ($user->societe_id > 0) accessforbidden();
// Get supervariables // Get supervariables
$prev_id = GETPOST('id','int'); $prev_id = GETPOST('id','int');
$page = GETPOST("page"); $page = GETPOST('page','int');
/* /*
* View * View

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -35,7 +35,7 @@ $langs->load("categories");
// Get supervariables // Get supervariables
$prev_id = GETPOST('id','int'); $prev_id = GETPOST('id','int');
$page = GETPOST("page"); $page = GETPOST('page','int');
/* /*
* View * View

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -39,14 +39,14 @@ $langs->load("categories");
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
// Get supervariables // Get supervariables
$action = GETPOST("action"); $action = GETPOST('action','alpha');
$id = GETPOST('id','int'); $id = GETPOST('id','int');
/* /*
* Actions * Actions
*/ */
if ( $action == 'confirm_credite' && GETPOST("confirm") == 'yes') if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
{ {
$bon = new BonPrelevement($db,""); $bon = new BonPrelevement($db,"");
$bon->id = $id; $bon->id = $id;
@ -69,9 +69,9 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . $_FILES['userfile']['name'],1) > 0) if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . $_FILES['userfile']['name'],1) > 0)
{ {
$dt = dol_mktime(12,0,0,GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear")); $dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$bon->set_infotrans($user, $dt, GETPOST("methode")); $bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
} }
Header("Location: fiche.php?id=".$id); Header("Location: fiche.php?id=".$id);
@ -88,7 +88,7 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
{ {
$bon = new BonPrelevement($db,""); $bon = new BonPrelevement($db,"");
$bon->fetch($id); $bon->fetch($id);
$dt = dol_mktime(12,0,0,GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear")); $dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$error = $bon->set_infocredit($user, $dt); $error = $bon->set_infocredit($user, $dt);
@ -121,9 +121,9 @@ if ($id)
$head = prelevement_prepare_head($bon); $head = prelevement_prepare_head($bon);
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment'); dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment');
if (GETPOST("error")!='') if (GETPOST('error','alpha')!='')
{ {
print '<div class="error">'.$bon->ReadError(GETPOST("error")).'</div>'; print '<div class="error">'.$bon->ReadError(GETPOST('error','alpha')).'</div>';
} }
if ($action == 'credite') if ($action == 'credite')

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -38,37 +38,37 @@ $langs->load("withdrawals");
$langs->load("categories"); $langs->load("categories");
// Get supervariables // Get supervariables
$action = GETPOST("action"); $action = GETPOST('action','alpha');
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST('sortorder','alpha');
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST('sortfield','alpha');
if ($action == 'confirm_rejet') if ($action == 'confirm_rejet')
{ {
if ( GETPOST("confirm") == 'yes') if ( GETPOST("confirm") == 'yes')
{ {
$daterej = mktime(2, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); $daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$lipre = new LignePrelevement($db, $user); $lipre = new LignePrelevement($db, $user);
if ($lipre->fetch($id) == 0) if ($lipre->fetch($id) == 0)
{ {
if (GETPOST("motif") > 0 && $daterej < time()) if (GETPOST('motif','alpha') > 0 && $daterej < time())
{ {
$rej = new RejetPrelevement($db, $user); $rej = new RejetPrelevement($db, $user);
$rej->create($user, $id, GETPOST("motif"), $daterej, $lipre->bon_rowid, GETPOST("facturer")); $rej->create($user, $id, GETPOST('motif','alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer','int'));
Header("Location: ligne.php?id=".$id); Header("Location: ligne.php?id=".$id);
exit; exit;
} }
else else
{ {
dol_syslog("Motif : ".GETPOST("motif")); dol_syslog("Motif : ".GETPOST('motif','alpha'));
dol_syslog("$daterej $time "); dol_syslog("$daterej $time ");
Header("Location: ligne.php?id=".$id."&action=rejet"); Header("Location: ligne.php?id=".$id."&action=rejet");
exit; exit;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -38,9 +38,9 @@ $langs->load("categories");
// Get supervariables // Get supervariables
$prev_id = GETPOST('id','int'); $prev_id = GETPOST('id','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = ((GETPOST("sortorder")=="")) ? "DESC" : GETPOST("sortorder"); $sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
$sortfield = ((GETPOST("sortfield")=="")) ? "pl.fk_soc" : GETPOST("sortfield"); $sortfield = ((GETPOST('sortfield','alpha')=="")) ? "pl.fk_soc" : GETPOST('sortfield','alpha');

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -37,14 +37,14 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement','','','bons'); $result = restrictedArea($user, 'prelevement','','','bons');
// Get supervariables // Get supervariables
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = ((GETPOST("sortorder")=="")) ? "DESC" : GETPOST("sortorder"); $sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
$sortfield = ((GETPOST("sortfield")=="")) ? "p.datec" : GETPOST("sortfield"); $sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha');
$search_line = GETPOST("search_ligne"); $search_line = GETPOST('search_ligne','alpha');
$search_bon = GETPOST("search_bon"); $search_bon = GETPOST('search_bon','alpha');
$search_code = GETPOST("search_code"); $search_code = GETPOST('search_code','alpha');
$search_societe = GETPOST("search_societe"); $search_societe = GETPOST('search_societe','alpha');
$statut = GETPOST("statut"); $statut = GETPOST('statut','int');
$bon=new BonPrelevement($db,""); $bon=new BonPrelevement($db,"");
$ligne=new LignePrelevement($db,$user); $ligne=new LignePrelevement($db,$user);

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@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
@ -35,9 +35,9 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'prelevement','','','bons'); $result = restrictedArea($user, 'prelevement','','','bons');
// Get supervariables // Get supervariables
$page = GETPOST("page"); $page = GETPOST('page','int');
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST('sortorder','alpha');
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST('sortfield','alpha');
/* /*
* View * View

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* *
@ -182,22 +182,30 @@ function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0
$srctemplatepath=$tmp[1]; $srctemplatepath=$tmp[1];
} }
// Search template file // Check if there is external models to do asked by plugins
$file=''; $classname=''; $filefound=0; if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
foreach(array('doc','pdf') as $prefix) $conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
{ }
$file = $prefix."_".$modele.".modules.php";
// On verifie l'emplacement du modele foreach ($conf->file->dol_document_root as $dirroot)
$file = dol_buildpath($dir.'doc/'.$file); {
// Search template file
$file=''; $classname=''; $filefound=0;
foreach(array('doc','pdf') as $prefix)
{
$file = $prefix."_".$modele.".modules.php";
if (file_exists($file)) // On verifie l'emplacement du modele
{ $file = $dirroot.$dir.'doc/'.$file;
$filefound=1; if (file_exists($file))
$classname=$prefix.'_'.$modele; {
break; $filefound=1;
} $classname=$prefix.'_'.$modele;
} break;
}
}
if ($filefound) break;
}
// Charge le modele // Charge le modele
if ($filefound) if ($filefound)

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -180,22 +180,30 @@ function facture_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
$srctemplatepath=$tmp[1]; $srctemplatepath=$tmp[1];
} }
// Search template file // Check if there is external models to do asked by plugins
$file=''; $classname=''; $filefound=0; if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
foreach(array('doc','pdf') as $prefix) $conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
{ }
$file = $prefix."_".$modele.".modules.php";
// On verifie l'emplacement du modele foreach ($conf->file->dol_document_root as $dirroot)
$file = dol_buildpath($dir.'doc/'.$file); {
// Search template file
$file=''; $classname=''; $filefound=0;
foreach(array('doc','pdf') as $prefix)
{
$file = $prefix."_".$modele.".modules.php";
if (file_exists($file)) // On verifie l'emplacement du modele
{ $file = $dirroot.$dir.'doc/'.$file;
$filefound=1; if (file_exists($file))
$classname=$prefix.'_'.$modele; {
break; $filefound=1;
} $classname=$prefix.'_'.$modele;
} break;
}
}
if ($filefound) break;
}
// Charge le modele // Charge le modele
if ($filefound) if ($filefound)

View File

@ -183,22 +183,30 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
$srctemplatepath=$tmp[1]; $srctemplatepath=$tmp[1];
} }
// Search template file // Check if there is external models to do asked by plugins
$file=''; $classname=''; $filefound=0; if (is_array($conf->models_modules) && ! empty($conf->models_modules)) {
foreach(array('doc','pdf') as $prefix) $conf->file->dol_document_root = array_merge($conf->file->dol_document_root,$conf->models_modules);
{ }
$file = $prefix."_".$modele.".modules.php";
// On verifie l'emplacement du modele // Search template file
$file = dol_buildpath($dir.'doc/'.$file); $file=''; $classname=''; $filefound=0;
foreach ($conf->file->dol_document_root as $dirroot)
{
foreach(array('doc','pdf') as $prefix)
{
$file = $prefix."_".$modele.".modules.php";
if (file_exists($file)) // On verifie l'emplacement du modele
{ $file = $dirroot.$dir.'doc/'.$file;
$filefound=1; if (file_exists($file))
$classname=$prefix.'_'.$modele; {
break; $filefound=1;
} $classname=$prefix.'_'.$modele;
} break;
}
}
if ($filefound) break;
}
// Charge le modele // Charge le modele
if ($filefound) if ($filefound)