[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5178 - in phpcompta/tags/rel650: html include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5178 - in phpcompta/tags/rel650: html include |
Date: |
Wed, 13 Feb 2013 18:05:33 +0100 (CET) |
Author: danydb
Date: 2013-02-13 18:05:32 +0100 (Wed, 13 Feb 2013)
New Revision: 5178
Modified:
phpcompta/tags/rel650/html/ajax_misc.php
phpcompta/tags/rel650/include/lettering.account.inc.php
phpcompta/tags/rel650/include/lettering.card.inc.php
Log:
0000788: Lettrage : date invalide, bloque
Modified: phpcompta/tags/rel650/html/ajax_misc.php
===================================================================
--- phpcompta/tags/rel650/html/ajax_misc.php 2013-02-06 18:53:39 UTC (rev
5177)
+++ phpcompta/tags/rel650/html/ajax_misc.php 2013-02-13 17:05:32 UTC (rev
5178)
@@ -323,14 +323,33 @@
$line.=td($max->input());
$r.=tr($line);
+ $date_error="";
// start date
$start = new IDate('search_start');
$start->value = (isset($search_start)) ? $search_start :
$first_per->first_day();
+ /* check if date are valid */
+ if (isset($search_start) && isDate($search_start) == null)
+ {
+ ob_start();
+ alert(_('Date malformée'));
+ $date_error = ob_get_contents();
+ ob_end_clean();
+ $search_start=$first_per->first_day();
+ }
$line = td('Date Debut') . td($start->input());
// end date
$end = new IDate('search_end');
+ /* check if date are valid */
+ if (isset($search_end) && isDate($search_end) == null)
+ {
+ ob_start();
+ alert(_('Date malformée'));
+ $date_error = ob_get_contents();
+ ob_end_clean();
+ $search_end=$last_per->last_day();
+ }
$end->value = (isset($search_end)) ? $search_end :
$last_per->last_day();
$line.=td('Date Fin') . td($end->input());
$r.=tr($line);
@@ -396,28 +415,8 @@
$form.=HtmlInput::hidden('sb', $_REQUEST['sb']);
if (isset($_REQUEST['f_id']))
$form.=HtmlInput::hidden('f_id', $_REQUEST['f_id']);
- /* check if date are valid */
- if ((isset($search_end) && isDate($search_end) == null) ||
- (isset($search_start) && isDate($search_start)
== null))
- {
- ob_start();
- alert(_('Date malformée, désolé'));
- $html = ob_get_contents();
- ob_end_clean();
- $html = escape_xml($html);
- header('Content-type: text/xml; charset=UTF-8');
- echo <<<EOF
-<?xml version="1.0" encoding="UTF-8"?>
-<data>
-<code>detail</code>
-<value>$html</value>
-</data>
-EOF;
- exit();
- }
-
// display a list of operation from the other side + box button
if ($ot == 'account')
{
@@ -458,7 +457,9 @@
$form.=HtmlInput::submit('record', _('Sauver')) . $ret->input();
$form.='</FORM>';
$form.='</div>';
+
$html = $r . $form;
+ $html.=$date_error;
// echo $html;exit;
$html = escape_xml($html);
Modified: phpcompta/tags/rel650/include/lettering.account.inc.php
===================================================================
--- phpcompta/tags/rel650/include/lettering.account.inc.php 2013-02-06
18:53:39 UTC (rev 5177)
+++ phpcompta/tags/rel650/include/lettering.account.inc.php 2013-02-13
17:05:32 UTC (rev 5178)
@@ -54,12 +54,25 @@
list($first_per,$last_per)=$periode->get_limit($exercice);
$start=new IDate('start');
+if ( isset ($_GET['start']) && isDate($_GET['start']) == null )
+{
+ echo alert(_('Date malformée, désolé'));
+ $_GET['start']=$first_per->first_day();
+
+}
$start->value=(isset($_GET['start']))?$_GET['start']:$first_per->first_day();
+
$r=td(_('Date début'));
$r.=td($start->input());
echo tr($r);
$end=new IDate('end');
+if ( isset($_GET['end']) && isDate($_GET['end']) == null )
+{
+ echo alert(_('Date malformée, désolé'));
+ $_GET['end']=$last_per->last_day();
+
+}
$end->value=(isset($_GET['end']))?$_GET['end']:$last_per->last_day();
$r=td(_('Date fin'));
$r.=td($end->input());
Modified: phpcompta/tags/rel650/include/lettering.card.inc.php
===================================================================
--- phpcompta/tags/rel650/include/lettering.card.inc.php 2013-02-06
18:53:39 UTC (rev 5177)
+++ phpcompta/tags/rel650/include/lettering.card.inc.php 2013-02-13
17:05:32 UTC (rev 5178)
@@ -57,13 +57,28 @@
list($first_per,$last_per)=$periode->get_limit($exercice);
$start=new IDate('start');
+if ( isset ($_GET['start']) && isDate($_GET['start']) == null )
+{
+ echo alert(_('Date malformée, désolé'));
+ $_GET['start']=$first_per->first_day();
+
+}
$start->value=(isset($_GET['start']))?$_GET['start']:$first_per->first_day();
+
+
$r=td(_('Date début'));
$r.=td($start->input());
echo tr($r);
$end=new IDate('end');
+if ( isset($_GET['end']) && isDate($_GET['end']) == null )
+{
+ echo alert(_('Date malformée, désolé'));
+ $_GET['end']=$last_per->last_day();
+
+}
$end->value=(isset($_GET['end']))?$_GET['end']:$last_per->last_day();
+
$r=td(_('Date fin'));
$r.=td($end->input());
echo tr($r);
@@ -101,12 +116,8 @@
// Show the result
//--------------------------------------------------------------------------------
echo '<div id="list">';
-if ( isDate($_GET['start']) == null || isDate($_GET['end']) == null )
-{
- echo alert(_('Date malformée, désolé'));
- exit();
-}
+
$letter=new Lettering_Card($cn);
$quick_code=strtoupper(trim($_GET['acc']));
$letter->set_parameter('quick_code',$quick_code);
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5178 - in phpcompta/tags/rel650: html include,
phpcompta-dev <=