[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/18: NEW : ICard , you can hide or show the
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/18: NEW : ICard , you can hide or show the accounting in the search box with the functions ICard->hide_accounting and ICard->show_accounting |
Date: |
Sun, 22 Apr 2018 09:30:28 -0400 (EDT) |
sparkyx pushed a commit to annotated tag rel6919-syn-180310
in repository noalyss.
commit 416268d4f00edbaf8e731052173f1b9fcff80ef3
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 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 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>
- [Noalyss-commit] [noalyss] annotated tag rel6919-syn-180310 created (now 23c7fc5), Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 04/18: fix bug with filter_card : encodeURI not needed, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 02/18: Fix problem with invalid unicode sequence, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 07/18: Accounting : error message if accounting is too large, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 06/18: Accounting : error message if accounting is too large, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 01/18: 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] 08/18: set version 6919.7, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 03/18: Protect queryString with encodeURI, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 09/18: Task #0001507: Click sur détail opérations apparaît trop haut Use the function window.pageYOffset instead of window.scrollY, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 16/18: sorttable.js : alternate properly the color of the table rows, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 11/18: Calc : set 4 decimals, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 13/18: Merge from rel6919.7 Merge branch 'dev-6919.2' of ns3:/srv/git/noalyss into dev-6919.2, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 17/18: sorttable.js : Add an icon if the column is already sorted, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 05/18: Set version 6919.6, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 12/18: Upgrade the branch with the stable release 6919.7 Merge tag 'rel6919.7' into dev-6919.2, Dany De Bontridder, 2018/04/22
- [Noalyss-commit] [noalyss] 15/18: Merge tag 'rel6919.8' into dev-6919.2, Dany De Bontridder, 2018/04/22