Task #1198 - Ajout heure pour nouvel événement

#1198 : add hour for event
This commit is contained in:
Dany De Bontridder 2015-11-05 11:14:45 +01:00
parent ebc99ce44d
commit 7cd92de439
4 changed files with 39 additions and 12 deletions

View file

@ -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";

View file

@ -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 {

View file

@ -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 */
)
);

View file

@ -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>
Type évenement
<?php echo _('Heure')." ". $hour->input()?>
</span>
<span>
<?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>