[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 07/15: ICard Improve doc and test
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 07/15: ICard Improve doc and test |
Date: |
Fri, 5 Feb 2021 11:38:30 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit cd6ddfc78e5d18e18fea065f5b8a8c12cd562736
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue Feb 2 17:36:48 2021 +0100
ICard Improve doc and test
---
include/lib/icard.class.php | 49 +++++++++++++++++++++++++++++++++++++++++----
scenario/HtmlInput.test.php | 11 ++++++++++
2 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/include/lib/icard.class.php b/include/lib/icard.class.php
index f1dc236..e0c171d 100644
--- a/include/lib/icard.class.php
+++ b/include/lib/icard.class.php
@@ -120,7 +120,45 @@ require_once
NOALYSS_INCLUDE.'/lib/function_javascript.php';
class ICard extends HtmlInput
{
-
+ //!< $fct ,by default it is update_value called BEFORE the querystring is
send
+ var $fct;
+
+ //!< $dblclick action if double click
+ var $dblclick;
+
+ //!< $callback ,
+ var $callback;
+
+ //!< $choice
+ var $choice;
+
+ //!< $indicator, text displaid when searching
+ var $indicator;
+
+ //!< $choice_create 1 , display a (+) button , default 1
+ var $choice_create;
+
+ //!< $autocomplete : 1 enable - 0 disable
+ var $autocomplete;
+
+ //!< $style supplemental CSS
+ var $style=' ';
+
+ //!< $accvis account_visible =1 otherwise 0, default 1
+ var $accvis;
+
+ //!< $limit Max of row show
+ var $limit;
+
+ //!< $amount_from_type : accountancy , sell or purchase price
+ var $amount_from_type;
+
+ //!< $typecard : type of card
+ var $typecard;
+
+ //!< $autocomplete_file , ajax file used for autocompletion (see
Ajax.Autocompleter)
+ private $autocomplete_file;
+
function __construct($name="", $value="", $p_id="")
{
parent::__construct($name, $value);
@@ -137,6 +175,8 @@ class ICard extends HtmlInput
$this->accvis=1; //!< account_visible =1 otherwise 0
$this->limit=12; //!< Max of row show
$this->amount_from_type=''; //!< in the follow up ,when a card is
selected you take Prix Vente or Prix Achat
+ $this->typecard='all';
+ $this->autocomplete_file="fid_card.php";
}
/**
@@ -155,7 +195,8 @@ class ICard extends HtmlInput
}
- /**\brief set the javascript callback function
+ /**
+ * \brief set the javascript callback function
* by default it is update_value called BEFORE the querystring is send
*
* \param $p_name callback function name
@@ -256,12 +297,12 @@ class ICard extends HtmlInput
$query=http_build_query([
'gDossier'=>Dossier::id(),'e'=>$this->typecard,'limit'=>$this->limit]);
- $javascript=sprintf('try { new
Ajax.Autocompleter("%s","%s","fid_card.php?%s",'.
+ $javascript=sprintf('try { new
Ajax.Autocompleter("%s","%s","%s?%s",'.
'{paramName:"FID",minChars:1,indicator:%s, '.
'callback:%s, '.
'limit:%s,'.
' afterUpdateElement:%s});} catch (e){alert(e.message);};',
- $this->id, $this->choice, $query, $this->indicator,
+ $this->id, $this->choice, $this->autocomplete_file,$query,
$this->indicator,
$this->callback, $this->limit, $this->fct);
$javascript=create_script($javascript.$this->dblclick);
diff --git a/scenario/HtmlInput.test.php b/scenario/HtmlInput.test.php
index 7abbd12..54675cb 100644
--- a/scenario/HtmlInput.test.php
+++ b/scenario/HtmlInput.test.php
@@ -135,9 +135,12 @@ $http=new HttpInput();
$file=new IFILE("file_to_upload");
$file->id="file_to_upload";
echo "fichier ",$file->input();
+
echo HtmlInput::submit("file","Upload");
?>
+ <p>Vérifier le changement de taille fichier dans la console JS</p>
</form>
+
<script>
function check_size()
{
@@ -159,6 +162,14 @@ $http=new HttpInput();
}
});
</script>
+<h2>ICArd</h2>
+<h3>Aucun param suppl.</h3>
+<?php
+ $icard=new ICard("test");
+ echo $icard->input();
+ echo $icard->search();
+?>
+
<div id="debug_box"></div>
\ No newline at end of file
- [Noalyss-commit] [noalyss] branch master updated (ce0a8f8 -> 79ecb68), Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 01/15: Fix #0001277: <<header>> ne supporte pas caractères avec accent., Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 03/15: Cosmetic, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 02/15: SQL upgrade, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 06/15: Fix: bug in gettext function, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 05/15: New 0001893: Date remplacement auto des séparateurs, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 09/15: Set Version 8.1 + logo + bug SQL script 151, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 12/15: Compatibility PHP7.0, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 04/15: New : 0001890: Avertissement si la document à télécharger est trop gros, on ne peut soumettre le fichier, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 07/15: ICard Improve doc and test,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 08/15: New : Task #1894: Gestion : ajout un champs paramétrable pour videoconf, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 11/15: Fix : Menu problem when 2 duplicate menus, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 14/15: cosmetic : position inner_box on larger screen, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 10/15: Place of recover_link, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 15/15: We split Database in DatabaseCore and Database, Dany De Bontridder, 2021/02/05
- [Noalyss-commit] [noalyss] 13/15: Bug = if double click on a card returns nothing, Dany De Bontridder, 2021/02/05