[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/02: NEW : ICard , you can hide or show the
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/02: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting |
Date: |
Wed, 20 Dec 2017 04:42:54 -0500 (EST) |
sparkyx pushed a commit to annotated tag rel6919.8
in repository noalyss.
commit 38b0e7f61d6addcbd01a83993bb495d9c7869763
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/class_icard.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 547bd20..c8e7083 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 22b9a7b..ca6c887 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/class_icard.php b/include/lib/class_icard.php
index 437f150..42a99c0 100644
--- a/include/lib/class_icard.php
+++ b/include/lib/class_icard.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>