[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 54/219: NEW : ICard , you can hide or show th
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 54/219: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting |
Date: |
Mon, 18 Dec 2017 13:22:37 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 0e18bd15f2d51b90679996073094c8c194c36a52
Author: Dany De Bontridder <address@hidden>
Date: Sat Sep 16 11:48:42 2017 +0200
NEW : ICard , you can hide or show the accounting
in the search box with the functions ICard->hide_accounting
and ICard->show_accounting
---
html/js/card.js | 16 +++++++++++++++-
include/ajax/ajax_card.php | 3 ++-
include/lib/icard.class.php | 15 ++++++++++++++-
include/template/card_result.php | 9 ++++++++-
4 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/html/js/card.js b/html/js/card.js
index 8b4fa93..ddd44cb 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -64,6 +64,7 @@ function boxsearch_card(p_dossier)
* - inp input text to update with the quickcode
* - label field to update with the name
* - ctl the id to fill with the HTML answer (ending with _content)
+ * - acc 1 if accounting are visible
*/
function search_card(obj)
{
@@ -86,10 +87,17 @@ function search_card(obj)
jrn=-1;
}
}
+ var accvis=obj.accvis;
+ if ( accvis == undefined ) {
+ accvis=0;
+ } else {
+ accvis=obj.accvis;
+ }
var query=encodeJSON({'gDossier':gDossier,
'inp':inp,'label':label,'price':price,'tvaid':tvaid,
'ctl':'search_card','op2':'fs','jrn':jrn,
- 'typecard':typecard,'query':string_to_search,'op':'card'
+ 'typecard':typecard,'query':string_to_search,'op':'card',
+ 'accvis':accvis
});
if ( $('search_card') ) {
removeDiv('search_card');
@@ -259,6 +267,12 @@ function search_get_card(obj)
{
queryString+="&ctl="+obj.ctl;
}
+ if ( obj.elements['accvis'] )
+ {
+ queryString+="&accvis="+$F(accvis);
+ } else {
+ queryString+="&accvis=0";
+ }
$('asearch').innerHTML=loading();
var action=new Ajax.Request ( 'ajax_misc.php',
{
diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php
index 0685c92..59b51da 100644
--- a/include/ajax/ajax_card.php
+++ b/include/ajax/ajax_card.php
@@ -51,6 +51,7 @@
* - ctl (to return)
* - popup
* - ref if we want to refresh the window
+ * - acc is accounting is visible or not
*\see fiche fiche::Save constant.php
*/
if ( ! defined('ALLOWED')) die (_('Accès non autorisé'));
@@ -350,7 +351,7 @@ case 'fs':
$r.='</span>';
$r.=dossier::hidden().HtmlInput::hidden('op','fs');
$array=array();
- foreach (array('query','inp','jrn','label','typecard','price','tvaid') as
$i)
+ foreach
(array('accvis','query','inp','jrn','label','typecard','price','tvaid') as $i)
{
if (isset(${$i}) )
{
diff --git a/include/lib/icard.class.php b/include/lib/icard.class.php
index 6d76216..2b809c9 100644
--- a/include/lib/icard.class.php
+++ b/include/lib/icard.class.php
@@ -132,6 +132,19 @@ class ICard extends HtmlInput
$this->choice_create=1;
$this->autocomplete=1;
$this->style=' style="vertical-align:50%"';
+ $this->accvis=1; //!< account_visible =1 otherwise 0
+ }
+ /**
+ * @brief in the search box, the accounting will be hidden
+ */
+ function hide_accounting() {
+ $this->accvis=0;
+ }
+ /**
+ * @brief in the search box, the accounting will be shown it is the default
+ */
+ function show_accounting() {
+ $this->accvis=1;
}
/*!\brief set the javascript callback function
* by default it is update_value called BEFORE the querystring is send
@@ -297,7 +310,7 @@ class ICard extends HtmlInput
if ( $this->readOnly==true) return '';
if ( ! isset($this->id )) $this->id=$this->name;
$a="";
- foreach (array('typecard','jrn','label','price','tvaid') as $att)
+ foreach (array('typecard','jrn','label','price','tvaid','accvis') as
$att)
{
if (isset($this->$att) )
$a.="this.".$att."='".$this->$att."';";
diff --git a/include/template/card_result.php b/include/template/card_result.php
index 3bf77d4..6c38fad 100644
--- a/include/template/card_result.php
+++ b/include/template/card_result.php
@@ -9,14 +9,21 @@
<?php for ($i=0;$i<sizeof($array);$i++) : ?>
<?php $class=($i%2==0)?'odd':'even';?>
<tr class="<?php echo $class;?>">
-<td style="padding-right:55px">
+ <td style="padding-right:55px">
<a href="javascript:void(0)" class="detail" onclick="<?php echo
$array[$i]['javascript']?>">
<?php echo $array[$i]['quick_code']?>
</a>
</td>
+<?php
+//---------------------------------------------------------------------------
+// if accvis == 1 then show the accounting
+//---------------------------------------------------------------------------
+if ( $accvis == 1 ) :
+ ?>
<td>
<?php echo
HtmlInput::history_account($array[$i]['accounting'],$array[$i]['accounting']);
?>
</td>
+<?php endif;?>
<td>
<?php echo $array[$i]['name']?>
</td>
- [Noalyss-commit] [noalyss] 138/219: Javascript : small error, (continued)
- [Noalyss-commit] [noalyss] 138/219: Javascript : small error, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 100/219: CSS input field with focus 0001302: FICHES: mise en évidence champs NOM/POSTE/CODE, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 26/219: task #1438 Remplacement de HtmlInput par Http_Input, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 91/219: Esthetic : change button appearance, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 122/219: Anc ODS : check date is valid and comment not empty, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 199/219: Task #001381 : ergonomy after selecting a filter remove the box, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 187/219: fix bug with filter_card : encodeURI not needed, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 18/219: remove href=javascript:void(0) + HtmlInput::generate_id replaced by uniqid, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 90/219: Task #0001481: Encodage Vente, Achat, Fin ou OD 1. S'il n'y a qu'une seule catégorie de fiche , il n'est plus nécessaire d'afficher le choix (puisqu'il n'y en a qu'un) 2. Avoir pour chaque ligne un bouton ajout fiche, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 62/219: Analytic : change the name and description in Ajax, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 54/219: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 67/219: Icon : for Inplace Edit field, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 166/219: Space, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 19/219: Replace global $http by new httpInput() to make the test of scenario working, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 128/219: Esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 99/219: CSS : button border, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 108/219: task #0001272: Rendre possible l'appel de la calculatrice depuis le fin fond d'une page., Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 174/219: space, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 114/219: Change max article in STOCK INV, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 16/219: Update test with new architecture, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 173/219: Improve calc, Dany De Bontridder, 2017/12/18