noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 11/11: Task #1198 - Ajout heure pour nouvel


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 11/11: Task #1198 - Ajout heure pour nouvel événement #1198 : add hour for event
Date: Thu, 05 Nov 2015 10:21:12 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 7cd92de439778a89120fb11b138c70244989222e
Author: Dany De Bontridder <address@hidden>
Date:   Thu Nov 5 11:14:45 2015 +0100

    Task #1198 - Ajout heure pour nouvel événement
    #1198 : add hour for event
---
 html/js/gestion.js                        |   13 ++++++++++++-
 include/ajax/ajax_gestion.php             |    2 ++
 include/class/class_follow_up.php         |    7 ++++---
 include/template/action_display_short.php |   29 +++++++++++++++++++++--------
 4 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/html/js/gestion.js b/html/js/gestion.js
index 2d43ef6..5fba5b9 100644
--- a/html/js/gestion.js
+++ b/html/js/gestion.js
@@ -363,6 +363,7 @@ function action_save_short()
          
$('action_add_frm')['date_event_action_short'].parentNode.className="";
          $('action_add_frm')['title_event'].parentNode.className="";
          $('action_add_frm')['type_event'].parentNode.className="";
+         $('action_add_frm')['hour_event'].parentNode.className="";
 
         if ( $('action_add_frm')['date_event_action_short'].value.trim() == 
'') {
             
$('action_add_frm')['date_event_action_short'].parentNode.className="notice";
@@ -373,7 +374,17 @@ function action_save_short()
             $('action_add_frm')['title_event'].parentNode.className="notice";
             return false;
         }
-
+        var str_hour=new String($('action_add_frm')['hour_event'].value);
+        str_hour=str_hour.trim();
+        
+        if ( str_hour.search(/^[0-9]{2}:[0-9]{2}$/) == -1 &&
+             str_hour.search(/^[0-9]{2}.[0-9]{2}$/) == -1)
+        {
+            $('action_add_frm')['hour_event'].parentNode.className="notice";
+            alert_box('HH:MM  or HH.MM');
+            return false;
+        }
+        
         if ( 
$('action_add_frm')['type_event'].options[$('action_add_frm')['type_event'].selectedIndex].value
 == -1 )
         {
             $('action_add_frm')['type_event'].parentNode.className="notice";
diff --git a/include/ajax/ajax_gestion.php b/include/ajax/ajax_gestion.php
index f9de14c..f9a9a32 100644
--- a/include/ajax/ajax_gestion.php
+++ b/include/ajax/ajax_gestion.php
@@ -58,6 +58,7 @@ if ($op=='action_save')
     $title=HtmlInput::default_value_get("title_event", NULL);
     $summary=HtmlInput::default_value_get("summary", "");
     $type_event=HtmlInput::default_value_get('type_event', -1);
+    $hour_event=HtmlInput::default_value_get('hour_event', null);
     /*
      * Check if data are valid
      */
@@ -107,6 +108,7 @@ if ($op=='action_save')
     $gestion->ag_comment=h($summary);
     $gestion->ag_timestamp=$date_event;
     $gestion->ag_remind_date=$date_event;
+    $gestion->ag_hour=$hour_event;
     $content=_('Sauvé');
     $status='OK';
     try {
diff --git a/include/class/class_follow_up.php 
b/include/class/class_follow_up.php
index 68fa5f5..d81ecda 100644
--- a/include/class/class_follow_up.php
+++ b/include/class/class_follow_up.php
@@ -1811,11 +1811,11 @@ class Follow_Up
         $sql="insert into action_gestion".
                     "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, "
                 . "ag_dest, ".
-                    "  ag_priority,ag_owner,ag_state,ag_remind_date) ".
+                    "  ag_priority,ag_owner,ag_state,ag_remind_date,ag_hour) ".
                     " values "
                 . "($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,"
                 . "$7,"
-                . "$8,$9,$10,to_date($11,'DD.MM.YYYY'))";
+                . "$8,$9,$10,to_date($11,'DD.MM.YYYY'),$12)";
         
         $this->db->exec_sql($sql, array(
             $this->ag_id, /* 1 */
@@ -1828,7 +1828,8 @@ class Follow_Up
             $this->ag_priority, /* 8 */
             $_SESSION['g_user'], /* 9 */
             $this->ag_state, /* 10 */
-            $this->ag_remind_date /* 11 */
+            $this->ag_remind_date, /* 11 */
+            $this->ag_hour /* 12 */
            )
         );
 
diff --git a/include/template/action_display_short.php 
b/include/template/action_display_short.php
index c99cf6f..080f8f7 100644
--- a/include/template/action_display_short.php
+++ b/include/template/action_display_short.php
@@ -75,31 +75,44 @@ $dest->set_dblclick("fill_ipopcard(this);");
 $dest->set_attribute('ipopup', 'ipopcard');
 $dest->style=' style="vertical-align:0%"';
 
+// Hours
+$hour=new IText('hour_event');
+$hour->size=5;
+
 echo HtmlInput::title_box(_('Nouvel événement'), 'action_add_div');
 ?>
 <span class="notice" style="float:right" id="action_add_frm_info"></span>
 <form method="get" id="action_add_frm" onsubmit="action_save_short(<?php echo 
Dossier::id()?>);return false">
-<p>
     <span>
-    Date<?php echo $date->input()?>
+    <?php echo _('Date')." ". $date->input()?>
+    </span>
+    <span>
+    <?php echo _('Heure')." ". $hour->input()?>
     </span>
     <span>
-    Type évenement
+    <?php echo _('Type évenement')?>
 <?php echo $type->input();?>
     </span>
-    Priorité
+    <p></p>
+    <span>
+<?php echo _('Destinataire')?>    <?php echo $dest->input();?>
+    </span>
+    <span>
+    <?php echo _('Priorité')?>
 <?php echo $priority->input()?>
-    groupe
+    </span>
+    <span>
+    <?php echo _('groupe')?>
 <?php echo $profile->input()?>
-</p>
-Destinataire    <?php echo $dest->input();?>
+
+    </span>
 <p>
     <span>
         <?php echo _('Sujet')?>
         <?php echo $title->input()?>
     </span>
 </p>
-    <?php echo "Description"?>
+    <?php echo _("Description")?>
 <p>
     <?php echo $summary->input()?>
 </p>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]