fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14406] fixing forms


From: Saul
Subject: [Fmsystem-commits] [14406] fixing forms
Date: Thu, 19 Nov 2015 00:25:13 +0000

Revision: 14406
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14406
Author:   psaul
Date:     2015-11-19 00:25:12 +0000 (Thu, 19 Nov 2015)
Log Message:
-----------
fixing forms

Modified Paths:
--------------
    branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
    branches/dev-syncromind/bookingfrontend/inc/class.uiallocation.inc.php
    branches/dev-syncromind/bookingfrontend/inc/class.uibooking.inc.php

Modified: branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uiapplication.inc.php     
2015-11-19 00:08:54 UTC (rev 14405)
+++ branches/dev-syncromind/booking/inc/class.uiapplication.inc.php     
2015-11-19 00:25:12 UTC (rev 14406)
@@ -880,9 +880,11 @@
                         $this->set_case_officer($application);
                        self::adddatetimepicker();
                        
+            $current_app = $GLOBALS['phpgw_info']['flags']['currentapp'] ? 
$GLOBALS['phpgw_info']['flags']['currentapp'] : 'booking';
+            
                        $application['resources_json'] = 
json_encode(array_map('intval', $application['resources']));
                        $application['accepted_documents_json'] = 
json_encode($application['accepted_documents']);
-                       $application['cancel_link'] = 
self::link(array('menuaction' => 'booking.uiapplication.index'));
+                       $application['cancel_link'] = 
self::link(array('menuaction' => $current_app.'.uiapplication.index'));
                        $activities = $this->activity_bo->fetch_activities();
                        $activities = $activities['results'];
                        $agegroups = 
$this->agegroup_bo->fetch_age_groups($top_level_activity);

Modified: branches/dev-syncromind/bookingfrontend/inc/class.uiallocation.inc.php
===================================================================
--- branches/dev-syncromind/bookingfrontend/inc/class.uiallocation.inc.php      
2015-11-19 00:08:54 UTC (rev 14405)
+++ branches/dev-syncromind/bookingfrontend/inc/class.uiallocation.inc.php      
2015-11-19 00:25:12 UTC (rev 14406)
@@ -285,14 +285,14 @@
                                $this->flash_form_errors($errors);
 //                             self::add_javascript('booking', 'booking', 
'allocation.js');
                 
-                $allocation['from_'] = pretty_timestamp($allocation['from_']);
-                $allocation['to_'] = pretty_timestamp($allocation['to_']);
-                
                                $allocation['resources_json'] = 
json_encode(array_map('intval', $allocation['resources']));
 #                              $allocation['cancel_link'] = 
self::link(array('menuaction' => 'bookingfrontend.uiallocation.show', 'id' => 
$allocation['id']));
                 $allocation['cancel_link'] = self::link(array('menuaction' => 
'bookingfrontend.uibuilding.schedule', 'id' => $allocation['building_id'], 
'date' => $allocation['from_']));
                                $allocation['application_link'] = 
self::link(array('menuaction' => 'bookingfrontend.uiapplication.show', 'id' => 
$allocation['application_id']));
                 
+                $allocation['from_'] = pretty_timestamp($allocation['from_']);
+                $allocation['to_'] = pretty_timestamp($allocation['to_']);
+                
                 $GLOBALS['phpgw']->jqcal->add_listener('field_repeat_until', 
'date');
        
                                if ($step < 2) 

Modified: branches/dev-syncromind/bookingfrontend/inc/class.uibooking.inc.php
===================================================================
--- branches/dev-syncromind/bookingfrontend/inc/class.uibooking.inc.php 
2015-11-19 00:08:54 UTC (rev 14405)
+++ branches/dev-syncromind/bookingfrontend/inc/class.uibooking.inc.php 
2015-11-19 00:25:12 UTC (rev 14406)
@@ -99,10 +99,10 @@
                        $booking['building_id'] = phpgw::get_var('building_id', 
'int');
                        $allocation_id = phpgw::get_var('allocation_id', 'int');
             #The string replace is a workaround for a problem at Bergen 
Kommune 
-            $booking['from_'] = str_replace('%3A',':',phpgw::get_var('from_', 
'string'));
-            $booking['to_'] = str_replace('%3A',':',phpgw::get_var('to_', 
'string'));
-                       $time_from = explode(" ",phpgw::get_var('from_', 
'string'));
-                       $time_to = explode(" ",phpgw::get_var('to_', 'string'));
+            $booking['from_'] = str_replace('%3A',':',phpgw::get_var('from_', 
'string', 'GET'));
+            $booking['to_'] = str_replace('%3A',':',phpgw::get_var('to_', 
'string', 'GET'));
+                       $time_from = explode(" ",phpgw::get_var('from_', 
'string', 'GET'));
+                       $time_to = explode(" ",phpgw::get_var('to_', 'string', 
'GET'));
 
                        $step = phpgw::get_var('step', 'string', 'REQUEST', 1);
                        $invalid_dates = array();
@@ -116,14 +116,13 @@
                                $booking['season_id'] = $season['id'];
                                $booking['building_id'] = $building['id'];
                                $booking['building_name'] = $building['name'];
+                $booking['allocation_id'] = $allocation_id;
                                array_set_default($booking, 'resources', array( 
phpgw::get_var('resource')));
                        } else {
                                $season = 
$this->season_bo->read_single($_POST['season_id']);
             }
                        if($_SERVER['REQUEST_METHOD'] == 'POST')
                        {
-                $_POST['from_'] = ($_POST['from_']) ? date("Y-m-d H:i:s", 
phpgwapi_datetime::date_to_timestamp($_POST['from_'])) : "";
-                $_POST['to_'] = ($_POST['to_']) ? date("Y-m-d H:i:s", 
phpgwapi_datetime::date_to_timestamp($_POST['to_'])) : "";
                 $_POST['repeat_until'] = ($_POST['repeat_until']) ? 
date("Y-m-d", phpgwapi_datetime::date_to_timestamp($_POST['repeat_until'])) : 
"";
                 
                                $today = getdate();
@@ -232,9 +231,6 @@
                        self::add_javascript('bookingfrontend', 
'bookingfrontend', 'booking.js');
                        array_set_default($booking, 'resources', array());
 
-            $booking['from_'] = pretty_timestamp($booking['from_']);
-            $booking['to_'] = pretty_timestamp($booking['to_']);
-
             if(!$activity_id)
                        {
                                $activity_id = phpgw::get_var('activity_id', 
'int', 'REQUEST', -1);
@@ -261,10 +257,13 @@
                                $res_names[] = array('id' => $res['id'],'name' 
=> $res['name']);
                        }
             
-            $GLOBALS['phpgw']->jqcal->add_listener('field_from', 'datetime');
-            $GLOBALS['phpgw']->jqcal->add_listener('field_to', 'datetime');
+            $GLOBALS['phpgw']->jqcal->add_listener('field_from', 'time');
+            $GLOBALS['phpgw']->jqcal->add_listener('field_to', 'time');
             $GLOBALS['phpgw']->jqcal->add_listener('field_repeat_until', 
'date');
             
+            $booking['from_'] = pretty_timestamp($booking['from_']);
+            $booking['to_'] = pretty_timestamp($booking['to_']);
+            
             phpgwapi_jquery::formvalidator_generate(array('location', 'date', 
'security', 'file'), 'booking_form');
             
                        if ($step < 2) 
@@ -295,8 +294,8 @@
                                        'outseason' => $_POST['outseason'],
                                        'interval' => $_POST['field_interval'],
                                        'repeat_until' => 
pretty_timestamp($_POST['repeat_until']),
-                                       'from_date' => 
pretty_timestamp($_POST['from_']),
-                                       'to_date' => 
pretty_timestamp($_POST['to_']),
+                                       'from_date' => $_POST['from_'],
+                                       'to_date' => $_POST['to_'],
                                        'valid_dates' => $valid_dates,
                                        'invalid_dates' => $invalid_dates,
                                        'groups' => $groups)
@@ -480,15 +479,6 @@
                 $booking['organization_id'] = $group['organization_id'];
                        }
 
-            $booking['from_'] = pretty_timestamp($booking['from_']);
-            $booking['to_'] = pretty_timestamp($booking['to_']);
-            
-            foreach($bookings['results'] as &$b)
-                       {
-                               $b['from_'] = pretty_timestamp($b['from_']);
-                               $b['to_'] = pretty_timestamp($b['to_']);
-                       }
-
             $activity_path = 
$this->activity_bo->get_path($booking['activity_id']);
             $top_level_activity = $activity_path ? $activity_path[0]['id'] : 
-1;
             
@@ -509,6 +499,15 @@
             
             $GLOBALS['phpgw']->jqcal->add_listener('field_repeat_until', 
'date');
             
+            $booking['from_'] = pretty_timestamp($booking['from_']);
+            $booking['to_'] = pretty_timestamp($booking['to_']);
+            
+            foreach($bookings['results'] as &$b)
+                       {
+                               $b['from_'] = pretty_timestamp($b['from_']);
+                               $b['to_'] = pretty_timestamp($b['to_']);
+                       }
+            
             phpgwapi_jquery::formvalidator_generate(array('location', 'date', 
'security', 'file'), 'booking_form');
             
                        if ($step < 2) 




reply via email to

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