Fix: Pb in price level management

This commit is contained in:
Laurent Destailleur 2009-03-28 19:11:38 +00:00
parent 53cf18e3e8
commit e9aae286cd
2 changed files with 50 additions and 45 deletions

View File

@ -18,16 +18,16 @@
*/ */
/** /**
\file htdocs/lib/agenda.lib.php * \file htdocs/lib/agenda.lib.php
\brief Ensemble de fonctions de base de dolibarr sous forme d'include * \brief Ensemble de fonctions de base de dolibarr sous forme d'include
\version $Id$ * \version $Id$
*/ */
/** /**
\brief Show actions to do array * \brief Show actions to do array
\param max Max nb of records * \param max Max nb of records
*/ */
function show_array_actions_to_do($max=5) function show_array_actions_to_do($max=5)
{ {
global $langs, $conf, $user, $db, $bc, $socid; global $langs, $conf, $user, $db, $bc, $socid;

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2007 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
@ -16,8 +16,12 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/ * 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') 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 * \brief Recupere la valeur d'un champ, effectue un traitement Ajax et affiche le resultat
\param htmlname nom et id du champ * \param htmlname nom et id du champ
\param keysearch nom et id complementaire du champ de collecte * \param keysearch nom et id complementaire du champ de collecte
\param url chemin du fichier de reponse : /chemin/fichier.php * \param url chemin du fichier de reponse : /chemin/fichier.php
\param option champ supplementaire de recherche dans les parametres * \param option champ supplementaire de recherche dans les parametres
\param indicator Nom de l'image gif sans l'extension * \param indicator Nom de l'image gif sans l'extension
\return script script complet * \return script script complet
*/ */
function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working')
{ {
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="">'; $script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="">';
@ -54,6 +58,7 @@ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working')
} }
};'; };';
$script.='Ajax.Responders.register(myIndicator'.$htmlname.');'; $script.='Ajax.Responders.register(myIndicator'.$htmlname.');';
//print 'param='.$keysearch.'="+$F("'.$keysearch.$htmlname.'")+"&htmlname='.$htmlname.$option; exit;
$script.='new Form.Element.Observer($("'.$keysearch.$htmlname.'"), 1, $script.='new Form.Element.Observer($("'.$keysearch.$htmlname.'"), 1,
function(){ function(){
var myAjax = new Ajax.Updater( { var myAjax = new Ajax.Updater( {
@ -70,15 +75,15 @@ function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working')
} }
/** /**
\brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat * \brief Get value of a field, do Ajax process and show result
\param htmlname nom et id du champ * \param htmlname nom et id du champ
\param keysearch nom et id complémentaire du champ de collecte * \param keysearch nom et id complementaire du champ de collecte
\param id ID du champ a modifier * \param id ID du champ a modifier
\param url chemin du fichier de réponse : /chemin/fichier.php * \param url chemin du fichier de reponse : /chemin/fichier.php
\param option champ supplémentaire de recherche dans les paramétres * \param option champ supplementaire de recherche dans les parametres
\param indicator Nom de l'image gif sans l'extension * \param indicator Nom de l'image gif sans l'extension
\return script script complet * \return script script complet
*/ */
function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator='working') function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator='working')
{ {
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="">'; $script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="">';
@ -112,12 +117,12 @@ function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator=
} }
/** /**
\brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat * \brief Get vlaue of field, do Ajax process and return result
\param htmlname nom et id du champ * \param htmlname nom et id du champ
\param url chemin du fichier de réponse : /chemin/fichier.php * \param url chemin du fichier de reponse : /chemin/fichier.php
\param indicator nom de l'image gif sans l'extension * \param indicator nom de l'image gif sans l'extension
\return script script complet * \return script script complet
*/ */
function ajax_autocompleter($selected='',$htmlname,$url,$indicator='working') function ajax_autocompleter($selected='',$htmlname,$url,$indicator='working')
{ {
if ($indicator) $script.= ajax_indicator($htmlname,$indicator); if ($indicator) $script.= ajax_indicator($htmlname,$indicator);