fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7080] bkbooking: fix for out of season on booking +


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [7080] bkbooking: fix for out of season on booking + fix for time problem on booking at bergen kommune
Date: Tue, 08 Mar 2011 10:12:27 +0000

Revision: 7080
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7080
Author:   kjell
Date:     2011-03-08 10:12:25 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
bkbooking: fix for out of season on booking + fix for time problem on booking 
at bergen kommune

Modified Paths:
--------------
    trunk/booking/inc/class.uibooking.inc.php
    trunk/booking/setup/phpgw_no.lang
    trunk/bookingfrontend/inc/class.uibooking.inc.php
    trunk/bookingfrontend/inc/class.uibuilding.inc.php
    trunk/bookingfrontend/setup/phpgw_no.lang

Modified: trunk/booking/inc/class.uibooking.inc.php
===================================================================
--- trunk/booking/inc/class.uibooking.inc.php   2011-03-07 15:22:11 UTC (rev 
7079)
+++ trunk/booking/inc/class.uibooking.inc.php   2011-03-08 10:12:25 UTC (rev 
7080)
@@ -185,8 +185,9 @@
                        $allocation_id = phpgw::get_var('allocation_id', 'int', 
'GET');
                        $booking['building_id'] = phpgw::get_var('building_id', 
'int', 'GET');
                        $booking['resources'] = phpgw::get_var('resources', 
'int', 'GET');
-                       $booking['from_'] = phpgw::get_var('from_', 'str', 
'GET');
-                       $booking['to_'] = phpgw::get_var('to_', 'str', 'GET');
+            #The string replace is a workaround for a problem at Bergen 
Kommune 
+            $booking['from_'] = str_replace('%3A',':',phpgw::get_var('from_', 
'str', 'GET'));
+            $booking['to_'] = str_replace('%3A',':',phpgw::get_var('to_', 
'str', 'GET'));
                        $time_from = split(" ",phpgw::get_var('from_', 'str', 
'GET'));
                        $time_to =      split(" ",phpgw::get_var('to_', 'str', 
'GET'));
                        $step = phpgw::get_var('step', 'str', 'POST');
@@ -194,7 +195,7 @@
                        $invalid_dates = array();
                        $valid_dates = array();
 
-                       if($allocation_id)
+                       if(isset($allocation_id))
                        {
                                $allocation = 
$this->allocation_bo->read_single($allocation_id);
                                $season = 
$this->season_bo->read_single($allocation['season_id']);
@@ -205,25 +206,15 @@
                                array_set_default($booking, 'resources', 
array(get_var('resource', int, 'GET')));
                                $booking['organization_id'] = 
$allocation['organization_id'];
                                $booking['organization_name'] = 
$allocation['organization_name'];
-                       }
-
-            //start Debug code for testing problem on production server. to be 
removed ASAP!
-            if (phpgw::get_var('DEBUG', 'str', 'GET') == 'yes') {
-                echo "<pre>\n";
-                echo mb_detect_encoding(phpgw::get_var('from_', 'str', 'GET'), 
"auto");echo "\n";
-                print_r($allocation_id);echo "\n";
-                print_r($booking['from_']);echo "\n";
-                print_r($booking['to_']);echo "\n";
-                print_r($time_from);echo "\n";
-                print_r($time_to);echo "\n";
-                print_r($booking);echo "\n";
-                exit;
+                       } else {
+                               $season = 
$this->season_bo->read_single($_POST['season_id']);
             }
-            //end
+
                        if($_SERVER['REQUEST_METHOD'] == 'POST')
                        {
                                $today = getdate();
                                $booking = extract_values($_POST, 
$this->fields);
+                
                                if(strlen($_POST['from_']) < 6) 
                                {
                                        $date_from = array($time_from[0], 
$_POST['from_']);
@@ -256,7 +247,7 @@
 #                                              $errors['booking'] = lang('Can 
not create a booking in the past');
 #                                      }
 #                              } 
-                               if (!$allocation_id &&  $_POST['outseason'] == 
'on')
+                               if (!$booking['season_id'] &&  
$_POST['outseason'] == 'on')
                                {
                                        $errors['booking'] = lang('This booking 
is not connected to a season');
                                }       
@@ -338,22 +329,6 @@
                        {
                                $res_names[] = array('id' => $res['id'],'name' 
=> $res['name']);
                        }
-
-            //start Debug code for testing problem on production server. to be 
removed ASAP!
-            if (phpgw::get_var('DEBUG', 'str', 'GET') == 'end') {
-                echo "<pre>\n";
-                echo "encoding: ";echo 
mb_detect_encoding(phpgw::get_var('from_', 'str', 'GET'), "auto");echo "\n";
-                echo "encoding array: ";echo 
mb_detect_encoding($booking['from_'], "auto");echo "\n";
-                echo "allocation_id: ";print_r($allocation_id);echo "\n";
-                echo "booking from: ";print_r($booking['from_']);echo "\n";
-                echo "booking to: ";print_r($booking['to_']);echo "\n";
-                echo "time from: ";print_r($time_from);echo "\n";
-                echo "time to:";print_r($time_to);echo "\n";
-                echo "booking:\n";print_r($booking);echo "\n";
-                exit;
-            }
-            //end
-
                        if ($step < 2) 
                        {
                                self::render_template('booking_new', 
array('booking' => $booking, 

Modified: trunk/booking/setup/phpgw_no.lang
===================================================================
--- trunk/booking/setup/phpgw_no.lang   2011-03-07 15:22:11 UTC (rev 7079)
+++ trunk/booking/setup/phpgw_no.lang   2011-03-08 10:12:25 UTC (rev 7080)
@@ -439,7 +439,7 @@
 Event created, Overlaps with existing booking, Remember to send a notification 
booking no      Arrangement opprettet. Overlapper en eksisterende booking. Husk 
å sende varsel
 Print as PDF   booking no      Skriv ut som PDF
 Pending        booking no      UNDER BEHANDLING
-This booking is not connected to a season      booking no      Denne bookingen 
er ikke koblet mote en sesong
+This booking is not connected to a season      booking no      Denne bookingen 
er ikke koblet mot en sesong
 Message from Bergen county - AktivBy   booking no      Melding fra Bergen 
kommune - AktivBy
 Organization shortname booking no      Kortnavn
 Group shortname        booking no      Kortnavn

Modified: trunk/bookingfrontend/inc/class.uibooking.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.uibooking.inc.php   2011-03-07 15:22:11 UTC 
(rev 7079)
+++ trunk/bookingfrontend/inc/class.uibooking.inc.php   2011-03-08 10:12:25 UTC 
(rev 7080)
@@ -75,9 +75,9 @@
                        $booking = array();
                        $booking['building_id'] = phpgw::get_var('building_id', 
'int', 'GET');
                        $allocation_id = phpgw::get_var('allocation_id', 'int', 
'GET');
-                       $booking['from_'] = phpgw::get_var('from_', 'str', 
'GET');
-                       $booking['to_'] = phpgw::get_var('to_', 'str', 'GET');
-
+            #The string replace is a workaround for a problem at Bergen 
Kommune 
+            $booking['from_'] = str_replace('%3A',':',phpgw::get_var('from_', 
'str', 'GET'));
+            $booking['to_'] = str_replace('%3A',':',phpgw::get_var('to_', 
'str', 'GET'));
                        $time_from = split(" ",phpgw::get_var('from_', 'str', 
'GET'));
                        $time_to =      split(" ",phpgw::get_var('to_', 'str', 
'GET'));
 
@@ -95,21 +95,9 @@
                                $booking['building_id'] = $building['id'];
                                $booking['building_name'] = $building['name'];
                                array_set_default($booking, 'resources', 
array(get_var('resource', int, 'GET')));
-                       }
-            //start Debug code for testing problem on production server. to be 
removed ASAP!
-            if (phpgw::get_var('DEBUG', 'str', 'GET') == 'start') {
-                echo "<pre>\n";
-                echo "encoding get: ";echo 
mb_detect_encoding(phpgw::get_var('from_', 'str', 'GET'), "auto");echo "\n";
-                echo "encoding array: ";echo 
mb_detect_encoding($booking['from_'], "auto");echo "\n";
-                echo "allocation_id: ";print_r($allocation_id);echo "\n";
-                echo "booking from: ";print_r($booking['from_']);echo "\n";
-                echo "booking to: ";print_r($booking['to_']);echo "\n";
-                echo "time from: ";print_r($time_from);echo "\n";
-                echo "time to:";print_r($time_to);echo "\n";
-                echo "booking:\n";print_r($booking);echo "\n";
-                exit;
+                       } else {
+                               $season = 
$this->season_bo->read_single($_POST['season_id']);
             }
-            //end
                        if($_SERVER['REQUEST_METHOD'] == 'POST')
                        {
                                $today = getdate();
@@ -149,7 +137,7 @@
 #                                              $errors['booking'] = lang('Can 
not create a booking in the past');
 #                                      }
 #                              } 
-                               if (!$allocation_id &&  $_POST['outseason'] == 
'on')
+                               if (!$season_id &&  $_POST['outseason'] == 'on')
                                {
                                        $errors['booking'] = lang('This booking 
is not connected to a season');
                                }       
@@ -231,21 +219,6 @@
                        {
                                $res_names[] = array('id' => $res['id'],'name' 
=> $res['name']);
                        }
-            //start Debug code for testing problem on production server. to be 
removed ASAP!
-            if (phpgw::get_var('DEBUG', 'str', 'GET') == 'end') {
-                echo "<pre>\n";
-                echo "encoding: ";echo 
mb_detect_encoding(phpgw::get_var('from_', 'str', 'GET'), "auto");echo "\n";
-                echo "encoding array: ";echo 
mb_detect_encoding($booking['from_'], "auto");echo "\n";
-                echo "allocation_id: ";print_r($allocation_id);echo "\n";
-                echo "booking from: ";print_r($booking['from_']);echo "\n";
-                echo "booking to: ";print_r($booking['to_']);echo "\n";
-                echo "time from: ";print_r($time_from);echo "\n";
-                echo "time to:";print_r($time_to);echo "\n";
-                echo "booking:\n";print_r($booking);echo "\n";
-                exit;
-            }
-            //end
-
                        if ($step < 2) 
                        {
                                self::render_template('booking_new', 
array('booking' => $booking, 

Modified: trunk/bookingfrontend/inc/class.uibuilding.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.uibuilding.inc.php  2011-03-07 15:22:11 UTC 
(rev 7079)
+++ trunk/bookingfrontend/inc/class.uibuilding.inc.php  2011-03-08 10:12:25 UTC 
(rev 7080)
@@ -51,7 +51,6 @@
                        {
                                $building['homepage'] = 
'http://'.$building['homepage'];
                        }
-//                     echo "<pre>";print_r($building);exit;
                        self::render_template('building', array("building" => 
$building));
                }
                

Modified: trunk/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- trunk/bookingfrontend/setup/phpgw_no.lang   2011-03-07 15:22:11 UTC (rev 
7079)
+++ trunk/bookingfrontend/setup/phpgw_no.lang   2011-03-08 10:12:25 UTC (rev 
7080)
@@ -299,7 +299,7 @@
 The booking uses resources not in the containing allocation    bookingfrontend 
no      Bookingen bruker ressurser som ikke finnes i gitt tildeling
 CONFIRMED      bookingfrontend no      BEKREFTET
 Pending        bookingfrontend no      Under behandling
-This booking is not connected to a season      bookingfrontend no      Denne 
bookingen er ikke koblet mote en sesong
+This booking is not connected to a season      bookingfrontend no      Denne 
bookingen er ikke koblet mot en sesong
 The user has accepted the document under point 8.      bookingfrontend no      
Brukeren har akseptert dokumentene under punkt 8.
 Organization shortname bookingfrontend no      Kortnavn
 Group shortname        bookingfrontend no      Kortnavn




reply via email to

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