fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12071] bkbooking: stavanger bugfix event edit fronte


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [12071] bkbooking: stavanger bugfix event edit fronted
Date: Thu, 04 Sep 2014 09:29:33 +0000

Revision: 12071
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12071
Author:   kjell
Date:     2014-09-04 09:29:32 +0000 (Thu, 04 Sep 2014)
Log Message:
-----------
bkbooking:  stavanger bugfix event edit fronted

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

Modified: branches/stavangerkommune/booking/inc/class.boevent.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.boevent.inc.php 2014-09-03 
11:50:37 UTC (rev 12070)
+++ branches/stavangerkommune/booking/inc/class.boevent.inc.php 2014-09-04 
09:29:32 UTC (rev 12071)
@@ -182,19 +182,40 @@
         $mailadresses = $config->config_data['emails'];
         $mailadresses = explode("\n",$mailadresses);
 
-//        $link = 
$external_site_address.'/bookingfrontend/?menuaction=bookingfrontend.uiapplication.add&building_id=';
-//        $link .= 
$event['building_id'].'&building_name='.urlencode($event['building_name']).'&from_[]=';
-//        $link .= 
urlencode($event['from_']).'&to_[]='.urlencode($event['to_']).'&resource='.implode(",",$event['resources']);
         $link = 
$external_site_address.'/bookingfrontend/?menuaction=bookingfrontend.uibuilding.schedule&id=';
         $link .= $event['building_id'].'&date='.substr($event['from_'], 0, 10);
 
-        $body .= "<p>".$config->config_data['event_canceled_mail'];
+        if (!$type) {
+            $body .= $config->config_data['event_canceled_mail_subject'];
+            $body .= "<p>".$config->config_data['event_canceled_mail'];
+        } else {
+            $body .= $config->config_data['event_edited_mail_subject'];
+            $body .= "<p>".$config->config_data['event_edited_mail'];
+        }
+
+        if ($_POST['org_from'] < $event['from_'] && $_POST['org_to'] == 
$event['to_']) {
+            $event['from_'] = $_POST['org_from'];
+            $event['to_'] = $event['from_'];
+            $freetime = pretty_timestamp($event['from_']).' til 
'.pretty_timestamp($event['to_']);
+        }
+        elseif ($_POST['org_from'] == $event['from_'] && $_POST['org_to'] > 
$event['to_']) {
+            $event['from_'] = $event['to_'];
+            $event['to_'] = $_POST['org_to'];
+            $freetime = pretty_timestamp($event['from_']).' til 
'.pretty_timestamp($event['to_']);
+        }
+        elseif ($_POST['org_from'] < $event['from_'] && $_POST['org_to'] > 
$event['to_']) {
+            $freetime = pretty_timestamp($_POST['org_from']).' til 
'.pretty_timestamp($event['from_'])." og \n";
+            $freetime .= pretty_timestamp($event['to_']).' til 
'.pretty_timestamp($_POST['org_to']);
+        }
+
         $body .= '</p><p>'.$event['customer_organization_name'].' har 
avbestilt tid i '.$event['building_name'].':<br />';
-        $body .= implode(", 
",$this->so->get_resources(implode(",",$event['resources']))).' den 
'.pretty_timestamp($event['from_']);
-        $body .=' til '.pretty_timestamp($event['to_']);
-        $body .= ' - <a href="'.$link.'">'.lang('Apply for time').'</a></p>';
+        $body .= implode(", 
",$this->so->get_resources(implode(",",$event['resources']))).' den '.$freetime;
+        $body .= ' - <a href="'.$link.'">'.lang('Check calendar').'</a></p>';
         $body .= 
"<p>".$config->config_data['application_mail_signature']."</p>";
 
+
+
+        print_r($body);
         foreach ($mailadresses as $adr)
         {
             try

Modified: branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php 
2014-09-03 11:50:37 UTC (rev 12070)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php 
2014-09-04 09:29:32 UTC (rev 12071)
@@ -85,7 +85,6 @@
                 $event['to_'] = 
substr($_POST['org_to'],0,11).$_POST['to_'].":00";
                 array_set_default($_POST, 'resources', array());
 
-//                if ($event['from_'] < $_POST['org_from'] || $event['to_'] > 
$_POST['org_to']) {
                 if ($event['from_'] < $test['from_'] || $event['to_'] > 
$test['to_']) {
                     $errors['out_of_range'] = lang("You can't extend the 
event, for that contact administrator");
                 }
@@ -96,7 +95,9 @@
 
                 if(!$errors['event'] and !$errors['resource_number'] and 
!$errors['organization_number'] and !$errors['invoice_data']  && 
!$errors['contact_name'] && !$errors['out_of_range'])
                 {
-                    if ($event['from_'] > $orgdate['from'] || $event['to_'] < 
$orgdate['to']) {
+
+                    if ($event['from_'] > $test['from_'] || $event['to_'] < 
$test['to_']) {
+
                         $this->bo->send_notification(true, $event, 
$mailadresses, $orgdate);
                     }
                     $message = '';




reply via email to

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