[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4300 - phpcompta/trunk/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4300 - phpcompta/trunk/include |
Date: |
Thu, 3 Nov 2011 00:03:50 +0100 (CET) |
Author: danydb
Date: 2011-11-03 00:03:49 +0100 (Thu, 03 Nov 2011)
New Revision: 4300
Modified:
phpcompta/trunk/include/class_acc_ledger.php
phpcompta/trunk/include/compta_ods.inc.php
Log:
ODS : add a verify before screen to confirm
Modified: phpcompta/trunk/include/class_acc_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger.php 2011-11-02 21:46:21 UTC
(rev 4299)
+++ phpcompta/trunk/include/class_acc_ledger.php 2011-11-02 23:03:49 UTC
(rev 4300)
@@ -1209,7 +1209,8 @@
*/
function confirm($p_array,$p_readonly=false)
{
- $this->id=$p_array['p_jrn'];
+ if (! $p_readonly ) $this->verify($p_array);
+ $this->id=$p_array['p_jrn'];
if ( empty($p_array)) return 'Aucun résultat';
$anc=null;
extract($p_array);
Modified: phpcompta/trunk/include/compta_ods.inc.php
===================================================================
--- phpcompta/trunk/include/compta_ods.inc.php 2011-11-02 21:46:21 UTC (rev
4299)
+++ phpcompta/trunk/include/compta_ods.inc.php 2011-11-02 23:03:49 UTC (rev
4300)
@@ -64,7 +64,15 @@
}
elseif (isset($_POST['summary']))
{
- require_once 'operation_ods_confirm.inc.php';
+ try {
+ $ledger->verify($_POST);
+ require_once 'operation_ods_confirm.inc.php';
+ } catch (Exception $e)
+ {
+ echo alert($e->getMessage());
+ require('operation_ods_new.inc.php');
+
+ }
exit();
}
elseif (isset($_POST['save']))
@@ -95,152 +103,3 @@
}
exit();
-
-
-if ( $g_user->check_jrn($id) == 'X' )
-{
- alert(_("L'acces a ce journal est interdit, \n contactez votre
responsable"));
- exit();
-}
-
-//======================================================================
-// See the ledger listing
-if ($sa == 'l' && $id != -1)
-{
-// Check privilege
-
- if ( $g_user->check_jrn($id) == 'X')
- {
- NoAccess();
- exit -1;
- }
- show_qw_menu(1);
- echo '<div class="content">';
- $Ledger=new Acc_Ledger($cn,$id);
-
- $type=$Ledger->get_type();
- $href=basename($_SERVER['PHP_SELF']);
-
- echo '<form method="GET" action="'.$href.'">';
- echo HtmlInput::hidden("sa","l");
- echo HtmlInput::hidden("p_jrn",$id);
- echo HtmlInput::hidden("ac",$_REQUEST['sa']);
- echo dossier::hidden();
- echo $Ledger->search_form($type,0);
- echo HtmlInput::submit("qwlist",_("Recherche"));
- echo '</form>';
-
- $array=$_GET;
- list($sql,$where)=$Ledger->build_search_sql($array);
-
- $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 $bar;
- list($count,$html)= $Ledger->list_operation($sql,$offset,0);
- 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','ac'));
- if (isset($_GET['r_jrn'])) {
- foreach ($_GET['r_jrn'] as $k=>$v)
- $r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
- }
- echo '<form action="export.php" method="get">';
- echo $r;
- echo HtmlInput::hidden('act','CSV/histo');
- echo HtmlInput::submit('viewsearch','Export vers CSV');
-
- echo '</form>';
-
- echo '</div>';
- exit();
-}
-
-//======================================================================
-// User can write ?
-// Write into the ledger
-
-if ( $g_user->check_jrn($id) == 'X' )
-{
- alert(_("Vous ne pouvez pas accèder à ce journal, contactez votre
responsable"));
- exit -1;
-}
-
-if ( $g_user->check_jrn($id)=='W' )
-{
- if ( ($sa=='n' || isset($_POST['correct_it'])) && !
isset($_POST['summary']))
- {
- $array=$_POST;
- $default_periode=$g_user->get_periode();
- /* check if the ledger is closed */
-
- show_qw_menu();
- show_direct_form($cn,$ledger,$array);
- exit();
- }
-
-// reload with a predefined operation
-//
- if ( isset ($_GET['use_opd']))
- {
- $op=new Pre_op_advanced($cn);
- $p_post=null;
- if ( isset($_REQUEST['pre_def']) && $_REQUEST['pre_def'] != '')
- {
- $op->set_od_id($_REQUEST['pre_def']);
- //$op->p_jrn=$id;
-
- $p_post=$op->compute_array();
- }
- show_qw_menu();
- show_direct_form($cn,$ledger,$p_post);
-
- exit();
-
- }
-
- if ( isset($_POST['save_it' ]))
- {
- $array=$_POST;
-
- try
- {
- $ledger->save($array);
- $jr_id=$cn->get_value('select jr_id from jrn where
jr_internal=$1',array($ledger->internal));
-
- echo '<h2> Opération enregistrée Piece
'.h($ledger->pj).'</h2>';
- if ( strcmp($ledger->pj,$_POST['e_pj']) != 0 )
- {
- echo '<h3 class="notice">'._('Attention numéro pièce
existante, elle a du être adaptée').'</h3>';
- }
- printf ('<a class="detail" style="display:inline"
href="javascript:modifyOperation(%d,%d)">%s</a><hr>',
- $jr_id,dossier::id(),$ledger->internal);
-
- echo HtmlInput::button_anchor(_('Autre opération dans ce journal'),
- "?".dossier::get().
- '&show_form'.
- '&p_action=quick_writing&p_jrn='.
- $_REQUEST['p_jrn']);
-
- }
- catch (Exception $e)
- {
- alert ($e->getMessage());
- show_qw_menu();
- show_direct_form($cn,$ledger,$_POST);
- }
- exit();
- }
-} // if check_jrn=='W'
-else
-{
- show_qw_menu();
-}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4300 - phpcompta/trunk/include,
phpcompta-dev <=