[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14180]
From: |
Saul |
Subject: |
[Fmsystem-commits] [14180] |
Date: |
Fri, 16 Oct 2015 00:04:07 +0000 |
Revision: 14180
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14180
Author: psaul
Date: 2015-10-16 00:04:06 +0000 (Fri, 16 Oct 2015)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind/booking/inc/class.uiallocation.inc.php
branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
branches/dev-syncromind/booking/inc/class.uicommon.inc.php
Modified: branches/dev-syncromind/booking/inc/class.uiallocation.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uiallocation.inc.php
2015-10-16 00:02:57 UTC (rev 14179)
+++ branches/dev-syncromind/booking/inc/class.uiallocation.inc.php
2015-10-16 00:04:06 UTC (rev 14180)
@@ -369,11 +369,23 @@
}
else
{
+ $dateTimeFrom = phpgw::get_var('from_', 'GET');
+ $dateTimeTo = phpgw::get_var('to_', 'GET');
+ $dateTimeFromE = explode(" ", $dateTimeFrom[0]);
+ $dateTimeToE = explode(" ", $dateTimeTo[0]);
+ if (phpgw::get_var('from_', 'GET') < 14) {
+ $timeFrom[] = phpgw::get_var('from_',
'GET');
+ $timeTo[] = phpgw::get_var('to_',
'GET');
+ }else {
+ $timeFrom[] = $dateTimeFromE[1];
+ $timeTo[] = $dateTimeToE[1];
+ }
+
array_set_default($allocation, 'resources',
array(get_var('resource', int, 'GET')));
array_set_default($allocation, 'building_id',
phpgw::get_var('building_id', 'GET'));
array_set_default($allocation, 'building_name',
phpgw::get_var('building_name', 'GET'));
- array_set_default($allocation, 'from_',
phpgw::get_var('from_', 'GET'));
- array_set_default($allocation, 'to_',
phpgw::get_var('to_', 'GET'));
+ array_set_default($allocation, 'from_',
$timeFrom);
+ array_set_default($allocation, 'to_', $timeTo);
$weekday = phpgw::get_var('weekday', 'GET');
}
@@ -453,7 +465,7 @@
public function edit()
{
-
+
$id = intval(phpgw::get_var('id', 'GET'));
$allocation = $this->bo->read_single($id);
$allocation['building'] =
$this->building_bo->so->read_single($allocation['building_id']);
@@ -465,11 +477,16 @@
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
+ $_POST['from_'] = date("Y-m-d H:i:s",
strtotime(str_replace("/", "-", $_POST['from_'])));
+ $_POST['to_'] = date("Y-m-d H:i:s",
strtotime(str_replace("/", "-", $_POST['to_'])));
array_set_default($_POST, 'resources', array());
$allocation = array_merge($allocation,
extract_values($_POST, $this->fields));
$organization =
$this->organization_bo->read_single(intval(phpgw::get_var('organization_id',
'POST')));
+
+
+
$errors = $this->bo->validate($allocation);
- if(!$errors)
+ if($errors)
{
try {
$receipt =
$this->bo->update($allocation);
@@ -481,13 +498,16 @@
}
}
}
+
+ $allocation['from_'] = date($this->dateFormat." H:i",
strtotime($allocation['from_']));
+ $allocation['to_'] = date($this->dateFormat." H:i",
strtotime($allocation['to_']));
+
$this->flash_form_errors($errors);
self::add_javascript('booking', 'booking',
'allocation.js');
$allocation['resources_json'] =
json_encode(array_map('intval', $allocation['resources']));
$allocation['cancel_link'] =
self::link(array('menuaction' => 'booking.uiallocation.show', 'id' =>
$allocation['id']));
$allocation['application_link'] =
self::link(array('menuaction' => 'booking.uiapplication.show', 'id' =>
$allocation['application_id']));
$allocation['tabs'] =
phpgwapi_jquery::tabview_generate($tabs, $active_tab);
-
$GLOBALS['phpgw']->jqcal->add_listener('field_from',
'datetime');
$GLOBALS['phpgw']->jqcal->add_listener('field_to',
'datetime');
Modified: branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
2015-10-16 00:02:57 UTC (rev 14179)
+++ branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
2015-10-16 00:04:06 UTC (rev 14180)
@@ -657,11 +657,11 @@
$application = $this->extract_form_data();
foreach ($_POST['from_'] as &$from) {
- $timestamp = strtotime($from);
+ $timestamp =
strtotime(str_replace("/","-",$from));
$from = date("Y-m-d H:i:s",$timestamp);
}
foreach ($_POST['to_'] as &$to) {
- $timestamp = strtotime($to);
+ $timestamp =
strtotime(str_replace("/","-",$to));
$to = date("Y-m-d H:i:s",$timestamp);
}
@@ -731,7 +731,11 @@
if(phpgw::get_var('from_', 'GET'))
{
- $default_dates = array_map(array(self,
'_combine_dates'), phpgw::get_var('from_', 'GET'), phpgw::get_var('to_',
'GET'));
+ foreach (phpgw::get_var('from_', 'GET') as $k =>
$v) {
+ $_GET['from_'][$k] = date($this->dateFormat."
H:i", strtotime($_GET['from_'][$k]));
+ $_GET['to_'][$k] = date($this->dateFormat."
H:i", strtotime($_GET['to_'][$k]));
+ }
+ $default_dates = array_map(array(self,
'_combine_dates'), phpgw::get_var('from_', '', 'GET'), phpgw::get_var('to_',
'', 'GET'));
}
else
{
@@ -826,12 +830,11 @@
$errors = $this->validate($application);
foreach ($_POST['from_'] as &$from) {
- $timestamp = strtotime($from);
+ $timestamp =
strtotime(str_replace("/","-",$from));
$from = date("Y-m-d H:i:s",$timestamp);
}
-
foreach ($_POST['to_'] as &$to) {
- $timestamp = strtotime($to);
+ $timestamp =
strtotime(str_replace("/","-",$to));
$to = date("Y-m-d H:i:s",$timestamp);
}
@@ -845,6 +848,18 @@
$this->redirect(array('menuaction' =>
$this->url_prefix . '.show', 'id'=>$application['id']));
}
}
+
+ foreach ($application['dates'] as &$date) {
+ $date['from_'] = date($this->dateFormat." H:i",
strtotime($date['from_']));
+ $date['to_'] = date($this->dateFormat." H:i",
strtotime($date['to_']));
+ }
+// foreach ($application['dates']['to_'] as &$to) {
+// $to = date($this->dateFormat." H:i",
strtotime($to));
+// }
+
+// $application['from_'] = date($this->dateFormat."
H:i", strtotime($application['from_']));
+// $application['to_'] = date($this->dateFormat." H:i",
strtotime($application['to_']));
+
$this->flash_form_errors($errors);
$this->set_case_officer($application);
self::add_javascript('booking', 'booking',
'application.js');
Modified: branches/dev-syncromind/booking/inc/class.uicommon.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uicommon.inc.php 2015-10-16
00:02:57 UTC (rev 14179)
+++ branches/dev-syncromind/booking/inc/class.uicommon.inc.php 2015-10-16
00:04:06 UTC (rev 14180)
@@ -747,6 +747,25 @@
$js =<<<JS
$(function() {
+
+ $.each($('.newaddedpicker'), function(i, v){
+ var id = v.id;
+ v.classList.remove('newaddedpicker');
+ $( "#"+id ).{$type}picker({
+ dateFormat: '{$dateformat}',
+ showWeek: true,
+ changeMonth: true,
+ changeYear: true,
+ showOn: "button",
+ showButtonPanel:true,
+ buttonImage: "{$img_cal}",
+ buttonText: "{$lang_select_date}",
+ buttonImageOnly: true,
+ altField: "#alt_"+id,
+ altFormat: "yy-mm-dd",
+ altFieldTimeOnly: false
+ });
+ });
$('#add-date-link').click(function(){
var add = $(this);
@@ -758,69 +777,31 @@
'<a class="close-btn btnclose"
href="javascript:void(0);">-</a>'+
'<div
class="pure-control-group">'+
'<label
for="start_date_'+this.counter+'"><h4>{$lang_from}</h4></label>'+
- '<input
id="alt_start_date_'+this.counter+'" name="from_[]" type="hidden">'+
+ '<input
class="new_datepicker time pure-input-2-3" name="from_[]"
id="start_date_'+this.counter+'" type="text">'+
'</input>'+
- '<input
class="new_datepicker time pure-input-2-3" id="start_date_'+this.counter+'"
type="text">'+
- '</input>'+
'</div>'+
'<div
class="pure-control-group">'+
- '<label
for="end_date_'+this.counter+'"><h4>{$lang_to}</h4></label>'+
- '<input
id="alt_end_date_'+this.counter+'" name="to_[]" type="hidden">'+
+ '<label
for="end_date_'+this.counter+'" ><h4>{$lang_to}</h4></label>'+
+ '<input
class="new_datepicker time pure-input-2-3" name="to_[]"
id="end_date_'+this.counter+'" type="text">'+
'</input>'+
- '<input
class="new_datepicker time pure-input-2-3" id="end_date_'+this.counter+'"
type="text">'+
- '</input>'+
'</div>'
- '</div>';
+ '</div>';
-
-
add.parent().parent().children('#dates-container').append(html);
-
-
$('#start_date_'+this.counter).{$_type}picker({
- dateFormat: '{$dateformat}',
- showWeek: true,
- changeMonth: true,
- changeYear: true,
- showOn: "button",
- showButtonPanel:true,
- buttonImage: "{$img_cal}",
- buttonText: "{$lang_select_date}",
- buttonImageOnly: true,
- altField:
"#alt_start_date_"+this.counter,
- altFormat: "yy-mm-dd",
- altFieldTimeOnly: false
- });
-
-
$('#end_date_'+this.counter).{$_type}picker({
- dateFormat: '{$dateformat}',
- showWeek: true,
- changeMonth: true,
- changeYear: true,
- showOn: "button",
- showButtonPanel:true,
- buttonImage: "{$img_cal}",
- buttonText: "{$lang_select_date}",
- buttonImageOnly: true,
- altField:
"#alt_end_date_"+this.counter,
- altFormat: "yy-mm-dd",
- altFieldTimeOnly: false
- });
-
-// $( ".time" ).{$_type}picker({
-// dateFormat: '{$dateformat}',
-// showWeek: true,
-// changeMonth: true,
-// changeYear: true,
-// showOn: "button",
-// showButtonPanel:true,
-// buttonImage:
"{$img_cal}",
-// buttonText:
"{$lang_select_date}",
-// buttonImageOnly: true
-// });
- this.counter++;
+ $( ".new_datepicker" ).{$_type}picker({
+ dateFormat: '{$dateformat}',
+ showWeek: true,
+ changeMonth: true,
+ changeYear: true,
+ showOn: "button",
+ showButtonPanel:true,
+ buttonImage: "{$img_cal}",
+ buttonText:
"{$lang_select_date}",
+ buttonImageOnly: true
+ });
+ this.counter++;
});
-
});
$(document).on("click",".btnclose",function(){
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14180],
Saul <=