Author: danydb Date: 2013-12-08 14:39:54 +0100 (Sun, 08 Dec 2013) New Revision: 5586
Modified: phpcompta/trunk/ phpcompta/trunk/html/js/scripts.js phpcompta/trunk/include/ac_common.php phpcompta/trunk/include/balance.inc.php phpcompta/trunk/include/class_html_input.php phpcompta/trunk/include/export_balance_csv.php phpcompta/trunk/include/export_balance_pdf.php phpcompta/trunk/include/impress_rec.inc.php Log: Merged revisions 5584 via svnmerge from svn+ssh://[email protected]/svn/phpcompta/tags/rel670 ........ r5584 | danydb | 2013-12-08 14:29:06 +0100 (dim., 08 d?\195?\169c. 2013) | 5 lines bug #0000928 Fen?\195?\170tre Journaux dans fen?\195?\170tre recherche est clipp?\195?\169 Bug fixed for PRINTBAL and PRINTREC, fixed in export CSV and PDF Task #928 - Fen?\195?\170tre Journaux dans fen?\195?\170tre recherche est clipp?\195?\169 ........ Property changes on: phpcompta/trunk ___________________________________________________________________ Name: svnmerge-integrated - /phpcompta/tags/rel670:1-5539,5541-5582 + /phpcompta/tags/rel670:1-5539,5541-5585 Modified: phpcompta/trunk/html/js/scripts.js =================================================================== --- phpcompta/trunk/html/js/scripts.js 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/html/js/scripts.js 2013-12-08 13:39:54 UTC (rev 5586) @@ -815,6 +815,10 @@ var y=posY; if (json_obj.div != '')obj.cssclass=""; obj.style="top:"+y+obj.style; + if ( json_obj.class ) + { + obj.cssclass=json_obj.class; + } add_div(obj); Modified: phpcompta/trunk/include/ac_common.php =================================================================== --- phpcompta/trunk/include/ac_common.php 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/include/ac_common.php 2013-12-08 13:39:54 UTC (rev 5586) @@ -1094,4 +1094,16 @@ </div> <?php } +function get_array_column($p_array,$key) +{ + $array=array(); + for ($i=0;$i<count($p_array);$i++) + { + $r=$p_array[$i]; + if ( isset($r[$key])) { + $array[]=$r[$key]; + } + } + return $array; +} ?> Modified: phpcompta/trunk/include/balance.inc.php =================================================================== --- phpcompta/trunk/include/balance.inc.php 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/include/balance.inc.php 2013-12-08 13:39:54 UTC (rev 5586) @@ -91,7 +91,8 @@ echo 'Filtre '; $rad=new IRadio(); $array_ledger=$g_user->get_ledger('ALL',3); -$selected=(isset($_GET['r_jrn']))?$_GET['r_jrn']:null; +$array=get_array_column($array_ledger,'jrn_def_id'); +$selected=(isset($_GET['balr_jrn']))?$_GET['balr_jrn']:null; $select_cat=(isset($_GET['r_cat']))?$_GET['r_cat']:null; $array_cat=Acc_Ledger::array_cat(); @@ -101,7 +102,9 @@ echo '<li>'.$rad->input('p_filter',0).'Aucun filtre, tous les journaux'.'</li>'; if ( isset($_GET['p_filter']) && $_GET['p_filter']==1) $rad->selected='t'; else $rad->selected=false; -echo '<li>'.$rad->input('p_filter',1).'Filtré par journal'.HtmlInput::select_ledger($array_ledger,$selected).'</li>'; +echo '<li>'.$rad->input('p_filter',1).'Filtré par journal '; +echo HtmlInput::button_choice_ledger(array('div'=>'bal','type'=>'ALL','all_type'=>1)); +echo '</li>'; if ( isset($_GET['p_filter']) && $_GET['p_filter']==2) $rad->selected='t'; else $rad->selected=false; echo '<li>'.$rad->input('p_filter',2).'Filtré par catégorie'.HtmlInput::select_cat($array_cat).'</li>'; @@ -194,9 +197,9 @@ HtmlInput::hidden("from_periode",$_GET['from_periode']). HtmlInput::hidden("to_periode",$_GET['to_periode']); echo HtmlInput::hidden('p_filter',$_GET['p_filter']); - for ($e=0;$e<count($array_ledger);$e++) - if (isset($selected[$e])) - echo HtmlInput::hidden("r_jrn[$e]",$e); + for ($e=0;$e<count($selected);$e++) + if (isset($selected[$e]) && in_array ($selected[$e],$array)) + echo HtmlInput::hidden("r_jrn[$e]",$selected[$e]); for ($e=0;$e<count($array_cat);$e++) if (isset($select_cat[$e])) echo HtmlInput::hidden("r_cat[$e]",$e); @@ -215,9 +218,11 @@ HtmlInput::hidden("to_periode",$_GET['to_periode']); echo HtmlInput::get_to_hidden(array('ac')); echo HtmlInput::hidden('p_filter',$_GET['p_filter']); - if (isset($_GET ['r_jrn'])) - if (isset($selected[$e])) - echo HtmlInput::hidden("r_jrn[$e]",$e); + for ($e=0;$e<count($selected);$e++){ + if (isset($selected[$e]) && in_array ($selected[$e],$array)){ + echo HtmlInput::hidden("r_jrn[$e]",$selected[$e]); + } + } for ($e=0;$e<count($array_cat);$e++) if (isset($select_cat[$e])) echo HtmlInput::hidden("r_cat[$e]",$e); @@ -244,9 +249,9 @@ $bal=new Acc_Balance($cn); if ( $_GET['p_filter']==1) { - for ($e=0;$e<count($array_ledger);$e++) - if (isset($selected[$e])) - $bal->jrn[]=$array_ledger[$e]['jrn_def_id']; + for ($e=0;$e<count($selected);$e++) + if (isset($selected[$e]) && in_array ($selected[$e],$array)) + $bal->jrn[]=$selected[$e]; } if ( $_GET['p_filter'] == 0 ) { Modified: phpcompta/trunk/include/class_html_input.php =================================================================== --- phpcompta/trunk/include/class_html_input.php 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/include/class_html_input.php 2013-12-08 13:39:54 UTC (rev 5586) @@ -777,5 +777,47 @@ $button->javascript="calendar_zoom($obj)"; return $button->input(); } + /** + * + * @param type $p_array indice + * - div div name + * - type ALL, VEN, ACH or ODS + * - all_type 1 yes 0 no + * + */ + static function button_choice_ledger($p_array) + { + extract ($p_array); + $bledger_param = json_encode(array( + 'dossier' => $_REQUEST['gDossier'], + 'type' => $type, + 'all_type' => $all_type, + 'div' => $div, + 'class'=>'inner_box' + )); -} \ No newline at end of file + $bledger_param = str_replace('"', "'", $bledger_param); + $bledger = new ISmallButton('l'); + $bledger->label = "choix des journaux"; + $bledger->javascript = " show_ledger_choice($bledger_param)"; + $f_ledger = $bledger->input(); + $hid_jrn = ""; + if (isset($_REQUEST[$div . 'nb_jrn'])) + { + for ($i = 0; $i < $_REQUEST[$div . 'nb_jrn']; $i++) + { + if (isset($_REQUEST[$div . "r_jrn"][$i])) + $hid_jrn.=HtmlInput::hidden($div . 'r_jrn[' . $i . ']', $_REQUEST[$div . "r_jrn"][$i]); + } + $hid_jrn.=HtmlInput::hidden($div . 'nb_jrn', $_REQUEST[$div . 'nb_jrn']); + } else + { + $hid_jrn = HtmlInput::hidden($div . 'nb_jrn', 0); + } + echo $f_ledger; + echo '<span id="ledger_id' . $div . '">'; + echo $hid_jrn; + echo '</span>'; + } + +} Modified: phpcompta/trunk/include/export_balance_csv.php =================================================================== --- phpcompta/trunk/include/export_balance_csv.php 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/include/export_balance_csv.php 2013-12-08 13:39:54 UTC (rev 5586) @@ -49,10 +49,11 @@ { $selected=$_GET['r_jrn']; $array_ledger=$g_user->get_ledger('ALL',3); - for ($e=0;$e<count($array_ledger);$e++) + $array=get_array_column($array_ledger,'jrn_def_id'); + for ($e=0;$e<count($selected);$e++) { - if (isset ($selected[$e])) - $bal->jrn[]=$array_ledger[$e]['jrn_def_id']; + if (isset ($selected[$e]) && in_array ($selected[$e],$array) ) + $bal->jrn[]=$selected[$e]; } } break; Modified: phpcompta/trunk/include/export_balance_pdf.php =================================================================== --- phpcompta/trunk/include/export_balance_pdf.php 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/include/export_balance_pdf.php 2013-12-08 13:39:54 UTC (rev 5586) @@ -58,10 +58,11 @@ { $selected=$_GET['r_jrn']; $array_ledger=$g_user->get_ledger('ALL',3); - for ($e=0;$e<count($array_ledger);$e++) + $array=get_array_column($array_ledger,'jrn_def_id'); + for ($e=0;$e<count($selected);$e++) { - if (isset ($selected[$e])) - $bal->jrn[]=$array_ledger[$e]['jrn_def_id']; + if (isset ($selected[$e]) && in_array ($selected[$e],$array)) + $bal->jrn[]=$selected[$e]; } } break; Modified: phpcompta/trunk/include/impress_rec.inc.php =================================================================== --- phpcompta/trunk/include/impress_rec.inc.php 2013-12-08 13:39:29 UTC (rev 5585) +++ phpcompta/trunk/include/impress_rec.inc.php 2013-12-08 13:39:54 UTC (rev 5586) @@ -40,7 +40,8 @@ $r_jrn=(isset($_GET['r_jrn']))?$_GET['r_jrn']:''; echo '<form method="GET">'; echo dossier::hidden().HtmlInput::hidden('ac',$_GET['ac']).HtmlInput::hidden('type','rec'); -echo 'Filtre par journal :'.HtmlInput::select_ledger($aledger,$r_jrn ); +echo 'Filtre par journal'; +HtmlInput::button_choice_ledger(array('div'=>'','type'=>'ALL','all_type'=>1)); echo '<br/>'; /* * Limit by date, default current exercice --- PhpCompta est un logiciel de comptabilité libre en ligne (full web) Projet opensource http://www.phpcompta.eu _______________________________________________ Phpcompta est un logiciel libre de comptabilité en ligne (http://www.phpcompta.eu) Phpcompta-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/phpcompta-dev
