diff --git a/html/js/scripts.js b/html/js/scripts.js index 02c4792c3..65192cddb 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -3002,4 +3002,44 @@ function pin (object_id) { ); $('pin_'+object_id).firstChild.innerHTML="≊"; } +} +/** + * Show only the rows into the table (p_table_id) with the attribute (p_attribute_name) and if this attribute + * has the value of (attribut_value) + * @param p_table_id table id + * @param p_attribute_name the name of the attribute + * @param p_attribute_value the value of the attribute we want to show + */ +function show_only_row(p_table_id,p_attribute_name,p_attribute_value) +{ + if ( ! $(p_table_id)) { + throw "Invalide table id" + } + var mTable=$(p_table_id) ; + var ncount=mTable.rows.length + for (var i = 0;i < ncount;i++) { + var mRow=mTable.rows[i]; + if (mRow.getAttribute(p_attribute_name) != undefined && mRow.getAttribute(p_attribute_name)!=p_attribute_value){ + mRow.hide(); + } else { + mRow.show(); + } + } +} +/** + * Show all the rows into the table (p_table_id) + * @param p_table_id table id + */ +function show_all_row(p_table_id) +{ + if ( ! $(p_table_id)) { + throw "Invalide table id" + } + var mTable=$(p_table_id) ; + var ncount=mTable.rows.length + for (var i = 0;i < ncount;i++) { + var mRow=mTable.rows[i]; + mRow.show(); + } + } \ No newline at end of file diff --git a/include/cfgledger.inc.php b/include/cfgledger.inc.php index 7002f6e22..d9fc2b372 100644 --- a/include/cfgledger.inc.php +++ b/include/cfgledger.inc.php @@ -159,6 +159,11 @@ switch ($sa) // Display list of ledgers ////////////////////////////////////////////////////////////////////////// if ( $show_menu == 1 ) { + echo HtmlInput::anchor_action(_("Tout"), 'show_all_row(\'cfgledger_table_id\')','ledger_all_bt','smallbutton '); + echo HtmlInput::anchor_action(_("Financier"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'FIN\')','ledger_fin_bt','smallbutton '); + echo HtmlInput::anchor_action(_("Achat"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'ACH\')','ledger_ach_bt','smallbutton '); + echo HtmlInput::anchor_action(_("OpĂ©rations Diverses"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'ODS\')','ledger_ods_bt','smallbutton '); + echo HtmlInput::anchor_action(_("Vente"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'VEN\')','ledger_ven_bt','smallbutton '); echo '