From d30b171afec185bb26f7f80e8926e8529004f22a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 2 Nov 2011 23:05:03 +0000 Subject: [PATCH] 412 : code cleaning Remove user_action_gl.php (replace by history_action.inc.php) Callable from menu --- include/history_operation.inc.php | 12 +++- include/operation_adm.inc.php | 5 +- include/operation_client.inc.php | 5 +- include/operation_supplier.inc.php | 4 +- include/user_action_gl.php | 88 ------------------------------ 5 files changed, 20 insertions(+), 94 deletions(-) delete mode 100644 include/user_action_gl.php diff --git a/include/history_operation.inc.php b/include/history_operation.inc.php index 2b2747a84..0f0be0b3e 100644 --- a/include/history_operation.inc.php +++ b/include/history_operation.inc.php @@ -40,12 +40,16 @@ if ( isset ($_GET['ledger_type'])) { case 'ACH': $Ledger = new Acc_Ledger_Purchase($cn, 0); + $ask_pay=1; break; case 'ODS': + case 'ALL': $Ledger=new Acc_Ledger($cn,0); + $ask_pay=0; break; case 'VEN': $Ledger=new Acc_Ledger_Sold($cn,0); + $ask_pay=1; break; } @@ -98,11 +102,12 @@ $bar = jrn_navigation_bar($offset, $max_line, $step, $page); echo '
'; -echo HtmlInput::hidden("ledger_type", "ACH"); echo HtmlInput::hidden("ac", $_REQUEST['ac']); +echo HtmlInput::hidden('ledger_type',$_REQUEST['ledger_type']); echo dossier::hidden(); echo $bar; -list($count, $html) = $Ledger->list_operation($sql, $offset, 1); + +list($count, $html) = $Ledger->list_operation($sql, $offset, $ask_pay); echo $html; echo $bar; $r = HtmlInput::get_to_hidden(array('l', 'date_start', 'date_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier', 'ledger_type', 'p_action')); @@ -113,7 +118,8 @@ if (isset($_GET['r_jrn'])) } echo $r; -echo '

' . HtmlInput::submit('paid', _('Mise à jour paiement')) . IButton::select_checkbox('fpaida') . IButton::unselect_checkbox('fpaida') . '

'; +if ($ask_pay) + echo '

' . HtmlInput::submit('paid', _('Mise à jour paiement')) . IButton::select_checkbox('fpaida') . IButton::unselect_checkbox('fpaida') . '

'; echo '
'; /* diff --git a/include/operation_adm.inc.php b/include/operation_adm.inc.php index e41fa5fa3..45062541a 100644 --- a/include/operation_adm.inc.php +++ b/include/operation_adm.inc.php @@ -34,5 +34,8 @@ $f=new Fiche($cn,$_REQUEST['f_id']); $qcode=$f->get_quick_code(); $_GET['qcode']=$qcode; $_REQUEST['qcode']=$qcode; -require_once ('user_action_gl.php'); + +$var_array=compute_variable('ledger_type=ALL'); +put_global($var_array); +require_once ('history_operation.inc.php'); diff --git a/include/operation_client.inc.php b/include/operation_client.inc.php index e41fa5fa3..ea4c6f8b3 100644 --- a/include/operation_client.inc.php +++ b/include/operation_client.inc.php @@ -34,5 +34,8 @@ $f=new Fiche($cn,$_REQUEST['f_id']); $qcode=$f->get_quick_code(); $_GET['qcode']=$qcode; $_REQUEST['qcode']=$qcode; -require_once ('user_action_gl.php'); +$var_array=compute_variable('ledger_type=ALL'); +put_global($var_array); +require_once ('history_operation.inc.php'); + diff --git a/include/operation_supplier.inc.php b/include/operation_supplier.inc.php index e41fa5fa3..c21e2a2c4 100644 --- a/include/operation_supplier.inc.php +++ b/include/operation_supplier.inc.php @@ -34,5 +34,7 @@ $f=new Fiche($cn,$_REQUEST['f_id']); $qcode=$f->get_quick_code(); $_GET['qcode']=$qcode; $_REQUEST['qcode']=$qcode; -require_once ('user_action_gl.php'); +$var_array=compute_variable('ledger_type=ALL'); +put_global($var_array); +require_once ('history_operation.inc.php'); diff --git a/include/user_action_gl.php b/include/user_action_gl.php deleted file mode 100644 index 603e395c8..000000000 --- a/include/user_action_gl.php +++ /dev/null @@ -1,88 +0,0 @@ -'; - -$Ledger=new Acc_Ledger($cn,0); -if ( !isset($_REQUEST['p_jrn'])) -{ - $Ledger->id=-1; -} -else - $Ledger->id=$_REQUEST['p_jrn']; -/* - * @todo usefull ? - */ -$_GET['ledger_type']='ALL'; -echo $Ledger->display_search_form(); -echo '
'; -/* compute the sql stmt */ -list($sql,$where)=$Ledger->build_search_sql($_GET); - -$max_line=$cn->count_sql($sql); - -$step=$_SESSION['g_pagesize']; -$page=(isset($_GET['offset']))?$_GET['page']:1; -$offset=(isset($_GET['offset']))?$_GET['offset']:0; -$bar=jrn_navigation_bar($offset,$max_line,$step,$page); - - -echo HtmlInput::request_to_hidden(array('sa','sb','sc','f_id','ac')); - -echo dossier::hidden(); -echo $bar; -list($count,$html)= $Ledger->list_operation($sql,$offset); -echo $html; -echo $bar; - -/* - * Export to csv - */ -$r=HtmlInput::get_to_hidden(array('l','date_start','date_end','desc','amount_min','amount_max','qcode','accounting','unpaid','gDossier','ledger_type')); -if (isset($_GET['r_jrn'])) { - foreach ($_GET['r_jrn'] as $k=>$v) - $r.=HtmlInput::hidden('r_jrn['.$k.']',$v); -} -echo '
'; -echo $r; -echo HtmlInput::hidden('act','CSV/histo'); -echo HtmlInput::submit('viewsearch','Export vers CSV'); -echo HtmlInput::hidden('p_action','ALL'); -echo '
'; - - -?> - -