From 46d1a735b09ab7ea71d26d1e7d7de11462c673de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Sep 2009 21:10:09 +0000 Subject: [PATCH] Fix: Use the numbering module of Dolibarr. --- htdocs/cashdesk/facturation.php | 8 +-- htdocs/cashdesk/facturation_dhtml.php | 56 ++++++++++--------- htdocs/cashdesk/facturation_verif.php | 12 ++-- htdocs/cashdesk/index.php | 8 +-- htdocs/cashdesk/index_verif.php | 4 +- htdocs/cashdesk/langs/en_US/cashdesk.lang | 6 +- htdocs/cashdesk/langs/fr_FR/cashdesk.lang | 6 +- htdocs/cashdesk/style.css | 2 +- .../cashdesk/templates/facturation1.tpl.php | 9 ++- .../cashdesk/templates/liste_articles.tpl.php | 4 +- htdocs/cashdesk/templates/menu.tpl.php | 5 +- htdocs/cashdesk/validation_verif.php | 51 +++++------------ 12 files changed, 82 insertions(+), 89 deletions(-) diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 266ae5671e8..97879ea9535 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -69,21 +69,21 @@ if ( $nbr_enreg > 1 ) { if ( $nbr_enreg > $conf_taille_listes ) { - $top_liste_produits = '----- '.$conf_taille_listes.' produits affiches sur un total de '.$nbr_enreg.' -----'; + $top_liste_produits = '----- '.$conf_taille_listes.' '.$langs->transnoentitiesnoconv("Products").' '.$langs->trans("on").' '.$nbr_enreg.' -----'; } else { - $top_liste_produits = '----- '.$nbr_enreg.' produits affiches sur un total de '.$nbr_enreg.' -----'; + $top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("Products").' '.$langs->trans("on").' '.$nbr_enreg.' -----'; } } else if ( $nbr_enreg == 1 ) { - $top_liste_produits = '----- 1 article trouve -----'; + $top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----'; } else { - $top_liste_produits = '----- Aucun article trouve -----'; + $top_liste_produits = '----- '.$langs->transnoentitiesnoconv("NoProductFound"). ' -----'; } diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 23cc57ad12f..b791f7bf1c4 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008 Laurent Destailleur + * Copyright (C) 2008-2009 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 @@ -16,13 +16,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - include('../master.inc.php'); - require ('include/environnement.php'); - // Verification - if ( strlen ($_GET["code"]) > 1 ) { +include('../master.inc.php'); +require ('include/environnement.php'); - $res = $sql->query ( +$langs->load("@cashdesk"); + +// Verification +if ( strlen ($_GET["code"]) > 1 ) { + + $res = $sql->query ( "SELECT ".MAIN_DB_PREFIX."product.rowid, ref, label, tva_tx FROM ".MAIN_DB_PREFIX."product LEFT JOIN ".MAIN_DB_PREFIX."product_stock ON ".MAIN_DB_PREFIX."product.rowid = ".MAIN_DB_PREFIX."product_stock.fk_product @@ -33,45 +36,44 @@ OR label LIKE '%".$_GET['code']."%' ORDER BY label"); - if ( $nbr = $sql->num_rows($res) ) { + if ( $nbr = $sql->num_rows($res) ) { - $resultat = '
    '; + $resultat = '
      '; - $ret=array(); $i=0; - while ( $tab = $sql->fetch_array($res) ) + $ret=array(); $i=0; + while ( $tab = $sql->fetch_array($res) ) + { + foreach ( $tab as $cle => $valeur ) { - foreach ( $tab as $cle => $valeur ) - { - $ret[$i][$cle] = $valeur; - } - $i++; + $ret[$i][$cle] = $valeur; } - $tab=$ret; + $i++; + } + $tab=$ret; - for ( $i = 0; $i < count ($tab); $i++ ) { + for ( $i = 0; $i < count ($tab); $i++ ) { - $resultat .= ' + $resultat .= '
    • '.htmlentities($tab[$i]['ref'].' - '.$tab[$i]['label']).'
    • '; - } + } - $resultat .= '
    '; + $resultat .= '
'; - echo $resultat; + echo $resultat; - } else { - - echo (' + } else { + echo ('
    -
  • '.htmlentities ('Aucun r�sultat').'
  • +
  • '.$langs->trans("NoResults").'
'); - } - } + +} ?> \ No newline at end of file diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index b9ae226dd99..3dc23e8a2ac 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -80,7 +80,7 @@ switch ( $_GET['action'] ) { } - $redirection = 'affIndex.php?menu=facturation&filtre='.$filtre; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&filtre='.$filtre; } else { @@ -88,11 +88,11 @@ switch ( $_GET['action'] ) { if ( $_POST['hdnSource'] == 'REF' ) { - $redirection = 'affIndex.php?menu=facturation&filtre='.$_POST['txtRef']; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&filtre='.$_POST['txtRef']; } else { - $redirection = 'affIndex.php?menu=facturation'; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation'; } @@ -100,7 +100,7 @@ switch ( $_GET['action'] ) { } else { - $redirection = 'affIndex.php?menu=facturation'; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation'; } @@ -112,13 +112,13 @@ switch ( $_GET['action'] ) { $obj_facturation->remise_percent($_POST['txtRemise']); $obj_facturation->ajoutArticle(); - $redirection = 'affIndex.php?menu=facturation'; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation'; break; case 'suppr_article': $obj_facturation->supprArticle($_GET['suppr_id']); - $redirection = 'affIndex.php?menu=facturation'; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation'; break; } diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index bfa1960f6e7..04e10c0c7d8 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -34,7 +34,7 @@ include('../master.inc.php'); if ( $_SESSION['uid'] > 0 ) { - header ('Location: affIndex.php'); + header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php'); exit; } @@ -44,7 +44,7 @@ if ( $_SESSION['uid'] > 0 ) -Caisse : identification +Point of Sale login @@ -76,11 +76,11 @@ if ( $_SESSION['uid'] > 0 ) - + - + diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index ce2dbadc36c..fbd44eeccdc 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -52,11 +52,11 @@ if ( $retour >= 0 ) { $_SESSION['nom'] = $tab['name']; $_SESSION['prenom'] = $tab['firstname']; - header ('Location: affIndex.php?menu=facturation&id=NOUV'); + header ('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation&id=NOUV'); } else { - header ('Location: index.php?err='.$retour.'&user='.$username); + header ('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.$retour.'&user='.$username); } diff --git a/htdocs/cashdesk/langs/en_US/cashdesk.lang b/htdocs/cashdesk/langs/en_US/cashdesk.lang index d38c006f421..8db51a89004 100644 --- a/htdocs/cashdesk/langs/en_US/cashdesk.lang +++ b/htdocs/cashdesk/langs/en_US/cashdesk.lang @@ -12,4 +12,8 @@ BackOffice=Back office AddThisArticle=Add this article RestartSelling=Go back on sell SellFinished=Sell finished -PrintTicket=Print ticket \ No newline at end of file +PrintTicket=Print ticket +NoResults=No results +NoProductFound=No article found +ProductFound=product found +ProductsFound=products found \ No newline at end of file diff --git a/htdocs/cashdesk/langs/fr_FR/cashdesk.lang b/htdocs/cashdesk/langs/fr_FR/cashdesk.lang index 89fcd77083a..9ac3edb2cc6 100644 --- a/htdocs/cashdesk/langs/fr_FR/cashdesk.lang +++ b/htdocs/cashdesk/langs/fr_FR/cashdesk.lang @@ -12,4 +12,8 @@ BackOffice=Back office AddThisArticle=Ajouter cet article RestartSelling=Reprendre la vente SellFinished=Vente terminée -PrintTicket=Imprimer ticket \ No newline at end of file +PrintTicket=Imprimer ticket +NoResults=Aucun résultat +NoProductFound=Aucun article trouvé +ProductFound=produit trouvé +ProductsFound=produits trouvés \ No newline at end of file diff --git a/htdocs/cashdesk/style.css b/htdocs/cashdesk/style.css index bd6ed86abc1..b8cb0590216 100644 --- a/htdocs/cashdesk/style.css +++ b/htdocs/cashdesk/style.css @@ -310,7 +310,7 @@ p.titre { } .texte_ref { - width: 100px; + width: 80px; } .texte1,.texte1_off { diff --git a/htdocs/cashdesk/templates/facturation1.tpl.php b/htdocs/cashdesk/templates/facturation1.tpl.php index 3dfd017a7ef..c5e87bc3c0f 100644 --- a/htdocs/cashdesk/templates/facturation1.tpl.php +++ b/htdocs/cashdesk/templates/facturation1.tpl.php @@ -1,6 +1,7 @@ load("main"); $langs->load("bills"); +$langs->load("@cashdesk"); ?> - + diff --git a/htdocs/cashdesk/templates/liste_articles.tpl.php b/htdocs/cashdesk/templates/liste_articles.tpl.php index e6f54eab523..7734b171154 100644 --- a/htdocs/cashdesk/templates/liste_articles.tpl.php +++ b/htdocs/cashdesk/templates/liste_articles.tpl.php @@ -1,7 +1,7 @@ load("main"); $langs->load("bills"); -$langs->load("cashdesk"); +$langs->load("@cashdesk"); ?>
Nom d'utilisateurtrans("Login"); ?>
Mot de passetrans("Password"); ?>
+ +