fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11956] bkbooking: stavanger bugfix/clean up uievent


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [11956] bkbooking: stavanger bugfix/clean up uievent
Date: Thu, 08 May 2014 11:51:46 +0000

Revision: 11956
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11956
Author:   kjell
Date:     2014-05-08 11:51:46 +0000 (Thu, 08 May 2014)
Log Message:
-----------
bkbooking: stavanger bugfix/clean up uievent

Modified Paths:
--------------
    branches/stavangerkommune/booking/inc/class.uievent.inc.php
    branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php

Modified: branches/stavangerkommune/booking/inc/class.uievent.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.uievent.inc.php 2014-05-07 
13:49:06 UTC (rev 11955)
+++ branches/stavangerkommune/booking/inc/class.uievent.inc.php 2014-05-08 
11:51:46 UTC (rev 11956)
@@ -515,15 +515,34 @@
             $link = 
$external_site_address.'/bookingfrontend/?menuaction=bookingfrontend.uibuilding.schedule&id='.$event['building_id']."&date=".substr($event['from_'],0,-9);
                        $errors = array();
                        $customer = array();
-                       if ($event['customer_identifier_type'])
-                       {
-                               $customer['customer_identifier_type'] = 
$event['customer_identifier_type'];
-                               $customer['customer_ssn'] = 
$event['customer_ssn'];
-                               $customer['customer_organization_number'] = 
$event['customer_organization_number'];
-                               $customer['customer_internal'] = 
$event['customer_internal'];
-                       }
+
+            if ($event['customer_identifier_type'])
+            {
+                $customer['customer_identifier_type'] = 
$event['customer_identifier_type'];
+                $customer['customer_ssn'] = $event['customer_ssn'];
+                $customer['customer_organization_number'] = 
$event['customer_organization_number'];
+                $customer['customer_internal'] = $event['customer_internal'];
+                $orginfo = 
$this->bo->so->get_org($event['customer_organization_number']);
+                $customer['customer_organization_id'] = $orginfo['id'];
+                $customer['customer_organization_name'] = $orginfo['name'];
+            } else {
+                $customer['customer_organization_name'] = 
$event['customer_organization_name'];
+                $customer['customer_organization_id'] = 
$event['customer_organization_id'];
+                $organization = 
$this->organization_bo->read_single($event['customer_organization_id']);
+                $customer['customer_identifier_type'] = 'organization_number';
+                $customer['customer_ssn'] = $organization['customer_internal'];
+                $customer['customer_organization_number'] = 
$organization['organization_number'];
+                $customer['customer_internal'] = 
$organization['customer_internal'];
+            }
+
                        list($event, $errors) = 
$this->extract_and_validate($event);
 
+            if ($event['customer_organization_number']) {
+                $orginfo = 
$this->bo->so->get_org($event['customer_organization_number']);
+                $event['customer_organization_id'] = $orginfo['id'];
+                $event['customer_organization_name'] = $orginfo['name'];
+            }
+
                        if($_SERVER['REQUEST_METHOD'] == 'POST')
                        {
                                if (!$_POST['organization_name']) {

Modified: branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php 
2014-05-07 13:49:06 UTC (rev 11955)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php 
2014-05-08 11:51:46 UTC (rev 11956)
@@ -32,8 +32,6 @@
             $config    = CreateObject('phpgwapi.config','booking');
             $config->read();
 
-            $external_site_address = 
isset($config->config_data['external_site_address']) && 
$config->config_data['external_site_address'] ? 
$config->config_data['external_site_address'] : 
$GLOBALS['phpgw_info']['server']['webserver_url'];
-            $link = 
$external_site_address.'/bookingfrontend/?menuaction=bookingfrontend.uibuilding.schedule&id='.$event['building_id']."&date=".substr($event['from_'],0,-9);
             $errors = array();
             $customer = array();
 
@@ -54,7 +52,6 @@
                 $customer['customer_ssn'] = $organization['customer_internal'];
                 $customer['customer_organization_number'] = 
$organization['organization_number'];
                 $customer['customer_internal'] = 
$organization['customer_internal'];
-
             }
             $mailadresses = 
$this->building_users($event['building_id'],$event['organization_id']);
 
@@ -102,7 +99,6 @@
                     }
                     $message = '';
                     $this->bo->send_admin_notification(true, $event, $message, 
$orgdate);
-                    exit;
                     $this->bo->update($event);
                     $date = substr($event['from_'], 0, 10);
                     $this->redirect(array('menuaction' => 
'bookingfrontend.uibuilding.schedule', 'id'=> $event['building_id'], 'date' => 
$date));
@@ -168,7 +164,6 @@
                     
if($bouser->is_organization_admin($event['customer_organization_id'])) {
                         $this->bo->send_notification(false, $event, 
$mailadresses);
                         $this->bo->send_admin_notification(false, $event, 
$_POST['message']);
-                        exit;
                         if ($can_delete_events) {
                             $this->bo->so->delete_event($event['id']);
                         } else {




reply via email to

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