From 8ab4ec804f7f43c9b59e4ade900e5c9d6c0f61f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Oct 2011 20:32:03 +0200 Subject: [PATCH] Qual: Removed warnings --- htdocs/cashdesk/affContenu.php | 11 +++++--- htdocs/cashdesk/affIndex.php | 2 +- htdocs/cashdesk/class/Auth.class.php | 22 +++++++--------- htdocs/cashdesk/deconnexion.php | 2 +- htdocs/cashdesk/facturation.php | 37 +++++++++++++-------------- htdocs/cashdesk/facturation_dhtml.php | 2 +- htdocs/cashdesk/facturation_verif.php | 6 ++--- htdocs/cashdesk/index.php | 4 +-- htdocs/cashdesk/index_verif.php | 14 +++++----- htdocs/cashdesk/liste_articles.php | 24 ----------------- htdocs/cashdesk/validation.php | 6 ++--- htdocs/cashdesk/validation_ticket.php | 6 ++--- htdocs/cashdesk/validation_verif.php | 8 +++--- 13 files changed, 60 insertions(+), 84 deletions(-) delete mode 100644 htdocs/cashdesk/liste_articles.php diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index 86e2026727496..dc5c99daa2201 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -44,7 +44,12 @@ } print '
'; -include('liste_articles.php'); + +require ('tpl/liste_articles.tpl.php'); + +$obj_facturation->prix_total_ht($lst_total_ht); +$obj_facturation->prix_total_ttc($lst_total_ttc); + print '
'; print '
'; @@ -55,11 +60,11 @@ } else { - include ('facturation.php'); + include('facturation.php'); } print '
'; -$_SESSION['serObjFacturation'] = serialize ($obj_facturation); +$_SESSION['serObjFacturation'] = serialize($obj_facturation); ?> \ No newline at end of file diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index d6ec051ceb3b5..37f201008483f 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -29,7 +29,7 @@ // Test if already logged if ( $_SESSION['uid'] <= 0 ) { - header ('Location: index.php'); + header('Location: index.php'); exit; } diff --git a/htdocs/cashdesk/class/Auth.class.php b/htdocs/cashdesk/class/Auth.class.php index 1ab7481582fa8..ffa4dbf195064 100644 --- a/htdocs/cashdesk/class/Auth.class.php +++ b/htdocs/cashdesk/class/Auth.class.php @@ -34,51 +34,46 @@ class Auth /** * Enter description here ... * - * @param unknown_type $DB + * @param DoliDB $DB Database handler + * @return void */ function Auth($DB) { - $this->db = $DB; $this->reponse(null); - } /** * Enter description here ... * - * @param unknown_type $aLogin + * @param string $aLogin Login + * @return void */ function login($aLogin) { - $this->login = $aLogin; - } /** * Enter description here ... * - * @param unknown_type $aPasswd + * @param string $aPasswd Password + * @return void */ function passwd($aPasswd) { - $this->passwd = $aPasswd; - - } /** * Enter description here ... * - * @param unknown_type $aReponse + * @param string $aReponse Response + * @return void */ function reponse($aReponse) { - $this->reponse = $aReponse; - } /** @@ -86,6 +81,7 @@ function reponse($aReponse) * * @param string $aLogin Login * @param string $aPasswd Password + * @return int 0 or 1 */ function verif($aLogin, $aPasswd) { diff --git a/htdocs/cashdesk/deconnexion.php b/htdocs/cashdesk/deconnexion.php index e4bdb710310af..20e058d9362b0 100644 --- a/htdocs/cashdesk/deconnexion.php +++ b/htdocs/cashdesk/deconnexion.php @@ -26,7 +26,7 @@ // This destroy tag that say "Point of Sale session is on". unset($_SESSION['uid']); -header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php'); +header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php'); exit; ?> \ No newline at end of file diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index d61c1cb6f84dd..5bd2324d17fe1 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -93,28 +93,27 @@ $tab_designations=$ret; } -$nbr_enreg = count ($tab_designations); - -if ( $nbr_enreg > 1 ) { - - if ( $nbr_enreg > $conf_taille_listes ) { +$nbr_enreg = count($tab_designations); +if ( $nbr_enreg > 1 ) +{ + if ( $nbr_enreg > $conf_taille_listes ) + { $top_liste_produits = '----- '.$conf_taille_listes.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----'; - - } else { - + } + else + { $top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----'; - } -} else if ( $nbr_enreg == 1 ) { - +} +else if ( $nbr_enreg == 1 ) +{ $top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----'; - -} else { - +} +else +{ $top_liste_produits = '----- '.$langs->transnoentitiesnoconv("NoProductFound"). ' -----'; - } @@ -152,10 +151,10 @@ // Reinitialisation du mode de paiement, en cas de retour aux achats apres validation -$obj_facturation->mode_reglement ('RESET'); -$obj_facturation->montant_encaisse ('RESET'); -$obj_facturation->montant_rendu ('RESET'); -$obj_facturation->paiement_le ('RESET'); +$obj_facturation->mode_reglement('RESET'); +$obj_facturation->montant_encaisse('RESET'); +$obj_facturation->montant_rendu('RESET'); +$obj_facturation->paiement_le('RESET'); // Affichage des templates diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 0642bdf9f20a0..775d9948e774b 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -41,7 +41,7 @@ header("Content-type: text/html; charset=".$conf->file->character_set_client); // Search from criteria -if ( dol_strlen ($_GET["code"]) >= 0 ) // If search criteria is on char length at least +if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at least { $sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx"; if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index d450e653d790c..f4b8398cea265 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -25,7 +25,7 @@ require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php'); /** end add Ditto */ -$obj_facturation = unserialize ($_SESSION['serObjFacturation']); +$obj_facturation = unserialize($_SESSION['serObjFacturation']); unset ($_SESSION['serObjFacturation']); @@ -156,9 +156,9 @@ } -$_SESSION['serObjFacturation'] = serialize ($obj_facturation); +$_SESSION['serObjFacturation'] = serialize($obj_facturation); -header ('Location: '.$redirection); +header('Location: '.$redirection); exit; ?> diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 0e8a6af92658e..46a8dcd1beaa3 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -34,7 +34,7 @@ // Test if user logged if ( $_SESSION['uid'] > 0 ) { - header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php'); + header('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php'); exit; } @@ -129,7 +129,7 @@ ?> - + diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 60734ef7b4865..104035ce6e37e 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -37,14 +37,14 @@ if (empty($username)) { $retour=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Login")); - header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); + header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } // Check third party id if (! ($thirdpartyid > 0)) { $retour=$langs->trans("ErrorFieldRequired",$langs->transnoentities("CashDeskThirdPartyForSell")); - header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); + header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } @@ -52,7 +52,7 @@ if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0)) { $retour=$langs->trans("CashDeskSetupStock"); - header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); + header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } @@ -60,7 +60,7 @@ { $langs->load("errors"); $retour=$langs->trans("ErrorModuleSetupNotComplete"); - header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); + header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } @@ -68,7 +68,7 @@ // Check password $auth = new Auth($db); -$retour = $auth->verif ($username, $password); +$retour = $auth->verif($username, $password); if ( $retour >= 0 ) { @@ -97,7 +97,7 @@ $_SESSION['CASHDESK_ID_WAREHOUSE'] = $warehouseid; //var_dump($_SESSION);exit; - header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&id=NOUV'); + header('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&id=NOUV'); exit; } else @@ -111,7 +111,7 @@ $langs->load("errors"); $langs->load("other"); $retour=$langs->trans("ErrorBadLoginPassword"); - header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); + header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } diff --git a/htdocs/cashdesk/liste_articles.php b/htdocs/cashdesk/liste_articles.php deleted file mode 100644 index 446c2d4c9b072..0000000000000 --- a/htdocs/cashdesk/liste_articles.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Copyright (C) 2008 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -require ('tpl/liste_articles.tpl.php'); - -$obj_facturation->prix_total_ht ($lst_total_ht); -$obj_facturation->prix_total_ttc ($lst_total_ttc); - -?> diff --git a/htdocs/cashdesk/validation.php b/htdocs/cashdesk/validation.php index 09e74571eeecb..c9bb21d8f0eff 100644 --- a/htdocs/cashdesk/validation.php +++ b/htdocs/cashdesk/validation.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2008 Jeremie Ollivier * * 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 @@ -15,7 +15,7 @@ * along with this program. If not, see . */ - // Affichage des templates - require ('tpl/validation1.tpl.php'); +// Affichage des templates +require ('tpl/validation1.tpl.php'); ?> diff --git a/htdocs/cashdesk/validation_ticket.php b/htdocs/cashdesk/validation_ticket.php index 4197e49ba131e..768458b8b16ad 100644 --- a/htdocs/cashdesk/validation_ticket.php +++ b/htdocs/cashdesk/validation_ticket.php @@ -19,14 +19,14 @@ require_once(DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'); require_once(DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php'); -$obj_facturation = unserialize ($_SESSION['serObjFacturation']); -unset ($_SESSION['serObjFacturation']); +$obj_facturation = unserialize($_SESSION['serObjFacturation']); +unset($_SESSION['serObjFacturation']); require ('tpl/ticket.tpl.php'); -$_SESSION['serObjFacturation'] = serialize ($obj_facturation); +$_SESSION['serObjFacturation'] = serialize($obj_facturation); ?> diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index 234876de05f1e..b69785f01a713 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -51,7 +51,7 @@ $obj_facturation->num_facture($num); - $obj_facturation->mode_reglement ($_POST['hdnChoix']); + $obj_facturation->mode_reglement($_POST['hdnChoix']); // Si paiement autre qu'en especes, montant encaisse = prix total $mode_reglement = $obj_facturation->mode_reglement(); @@ -65,7 +65,7 @@ $obj_facturation->montant_encaisse($montant); //Determination de la somme rendue - $total = $obj_facturation->prix_total_ttc (); + $total = $obj_facturation->prix_total_ttc(); $encaisse = $obj_facturation->montant_encaisse(); $obj_facturation->montant_rendu($encaisse - $total); @@ -283,7 +283,7 @@ -$_SESSION['serObjFacturation'] = serialize ($obj_facturation); +$_SESSION['serObjFacturation'] = serialize($obj_facturation); -header ('Location: '.$redirection); +header('Location: '.$redirection); ?>