From e9aae286cd2cbb3d90ce0e0fe6e5234674514d97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Mar 2009 19:11:38 +0000 Subject: [PATCH] Fix: Pb in price level management --- htdocs/lib/agenda.lib.php | 26 +++++++-------- htdocs/lib/ajax.lib.php | 69 +++++++++++++++++++++------------------ 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/htdocs/lib/agenda.lib.php b/htdocs/lib/agenda.lib.php index 169a8771d6c..22a29c27db8 100644 --- a/htdocs/lib/agenda.lib.php +++ b/htdocs/lib/agenda.lib.php @@ -18,20 +18,20 @@ */ /** - \file htdocs/lib/agenda.lib.php - \brief Ensemble de fonctions de base de dolibarr sous forme d'include - \version $Id$ -*/ + * \file htdocs/lib/agenda.lib.php + * \brief Ensemble de fonctions de base de dolibarr sous forme d'include + * \version $Id$ + */ /** - \brief Show actions to do array - \param max Max nb of records -*/ + * \brief Show actions to do array + * \param max Max nb of records + */ function show_array_actions_to_do($max=5) { global $langs, $conf, $user, $db, $bc, $socid; - + include_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php'); include_once(DOL_DOCUMENT_ROOT.'/client.class.php'); @@ -93,13 +93,13 @@ function show_array_actions_to_do($max=5) if ($obj->percent > 0 && $obj->percent < 100 && $obj->dp2 && date("U",$obj->dp2) < time()) $late=1; if ($obj->percent > 0 && $obj->percent < 100 && ! $obj->dp2 && $obj->dp && date("U",$obj->dp) < time()) $late=1; if ($late) print img_warning($langs->trans("Late")); - print ""; + print ""; // Statut print "".$staticaction->LibStatut($obj->percent,3)."\n"; print "\n"; - + $i++; } print "
"; @@ -120,7 +120,7 @@ function show_array_actions_to_do($max=5) function show_array_last_actions_done($max=5) { global $langs, $conf, $user, $db, $bc, $socid; - + $sql = "SELECT a.id, a.percent, ".$db->pdate("a.datep")." as da, ".$db->pdate("a.datep2")." as da2, a.fk_user_author, a.label,"; $sql.= " c.code, c.libelle,"; $sql.= " s.rowid, s.nom as sname, s.client"; @@ -160,7 +160,7 @@ function show_array_last_actions_done($max=5) $var=!$var; print ""; - + $staticaction->code=$obj->code; $staticaction->libelle=$obj->libelle; $staticaction->id=$obj->id; @@ -175,7 +175,7 @@ function show_array_last_actions_done($max=5) // Date print ''.dol_print_date($obj->da2,'day'); - print ""; + print ""; // Statut print "".$staticaction->LibStatut($obj->percent,3)."\n"; diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php index c0325908d2a..a14cd1a2275 100644 --- a/htdocs/lib/ajax.lib.php +++ b/htdocs/lib/ajax.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007 Regis Houssin +/* Copyright (C) 2007-2009 Laurent Destailleur + * Copyright (C) 2007 Regis Houssin * * 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,8 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * or see http://www.gnu.org/ - * - * $Id$ + */ + +/** + * \file htdocs/lib/agenda.lib.php + * \brief Page called by Ajax request for produts + * \version $Id$ */ function ajax_indicator($htmlname,$indicator='working') @@ -27,14 +31,14 @@ function ajax_indicator($htmlname,$indicator='working') } /** - \brief Recupere la valeur d'un champ, effectue un traitement Ajax et affiche le resultat - \param htmlname nom et id du champ - \param keysearch nom et id complementaire du champ de collecte - \param url chemin du fichier de reponse : /chemin/fichier.php - \param option champ supplementaire de recherche dans les parametres - \param indicator Nom de l'image gif sans l'extension - \return script script complet -*/ + * \brief Recupere la valeur d'un champ, effectue un traitement Ajax et affiche le resultat + * \param htmlname nom et id du champ + * \param keysearch nom et id complementaire du champ de collecte + * \param url chemin du fichier de reponse : /chemin/fichier.php + * \param option champ supplementaire de recherche dans les parametres + * \param indicator Nom de l'image gif sans l'extension + * \return script script complet + */ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') { $script = ''; @@ -46,7 +50,7 @@ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') Element.show(\'indicator'.$htmlname.'\'); } }, - + onComplete: function() { if(Ajax.activeRequestCount == 0){ Element.hide(\'indicator'.$htmlname.'\'); @@ -54,6 +58,7 @@ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') } };'; $script.='Ajax.Responders.register(myIndicator'.$htmlname.');'; + //print 'param='.$keysearch.'="+$F("'.$keysearch.$htmlname.'")+"&htmlname='.$htmlname.$option; exit; $script.='new Form.Element.Observer($("'.$keysearch.$htmlname.'"), 1, function(){ var myAjax = new Ajax.Updater( { @@ -65,20 +70,20 @@ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') });'; $script.=''; $script.='
'; - + return $script; } /** - \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat - \param htmlname nom et id du champ - \param keysearch nom et id complémentaire du champ de collecte - \param id ID du champ a modifier - \param url chemin du fichier de réponse : /chemin/fichier.php - \param option champ supplémentaire de recherche dans les paramétres - \param indicator Nom de l'image gif sans l'extension - \return script script complet -*/ + * \brief Get value of a field, do Ajax process and show result + * \param htmlname nom et id du champ + * \param keysearch nom et id complementaire du champ de collecte + * \param id ID du champ a modifier + * \param url chemin du fichier de reponse : /chemin/fichier.php + * \param option champ supplementaire de recherche dans les parametres + * \param indicator Nom de l'image gif sans l'extension + * \return script script complet + */ function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator='working') { $script = ''; @@ -90,7 +95,7 @@ function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator= Element.show(\'indicator'.$htmlname.'\'); } }, - + onComplete: function() { if(Ajax.activeRequestCount == 0){ Element.hide(\'indicator'.$htmlname.'\'); @@ -107,17 +112,17 @@ function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator= var myAjax = new Ajax.Updater(elementHTML,url,o_options); });'; $script.=''; - + return $script; } /** - \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat - \param htmlname nom et id du champ - \param url chemin du fichier de réponse : /chemin/fichier.php - \param indicator nom de l'image gif sans l'extension - \return script script complet -*/ + * \brief Get vlaue of field, do Ajax process and return result + * \param htmlname nom et id du champ + * \param url chemin du fichier de reponse : /chemin/fichier.php + * \param indicator nom de l'image gif sans l'extension + * \return script script complet + */ function ajax_autocompleter($selected='',$htmlname,$url,$indicator='working') { if ($indicator) $script.= ajax_indicator($htmlname,$indicator); @@ -132,7 +137,7 @@ function ajax_autocompleter($selected='',$htmlname,$url,$indicator='working') afterUpdateElement: ac_return });'; $script.= ''; - + return $script; }