[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12069] bkbooking: stavanger bugfix
From: |
Kjell Arne Espedal |
Subject: |
[Fmsystem-commits] [12069] bkbooking: stavanger bugfix |
Date: |
Wed, 03 Sep 2014 11:37:24 +0000 |
Revision: 12069
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12069
Author: kjell
Date: 2014-09-03 11:37:21 +0000 (Wed, 03 Sep 2014)
Log Message:
-----------
bkbooking: stavanger bugfix
Modified Paths:
--------------
branches/stavangerkommune/booking/inc/class.soallocation.inc.php
branches/stavangerkommune/booking/inc/class.uiallocation.inc.php
branches/stavangerkommune/bookingfrontend/inc/class.uibooking.inc.php
branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php
branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang
Modified: branches/stavangerkommune/booking/inc/class.soallocation.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.soallocation.inc.php
2014-09-01 06:14:45 UTC (rev 12068)
+++ branches/stavangerkommune/booking/inc/class.soallocation.inc.php
2014-09-03 11:37:21 UTC (rev 12069)
@@ -240,7 +240,6 @@
$resources = implode(",", $allocation['resources']);
$sql = "SELECT id FROM bb_allocation ba2 JOIN
bb_allocation_resource bar2 ON (ba2.id = bar2.allocation_id) WHERE ba2.from_ =
($from) AND ba2.to_ = ($to) AND ba2.organization_id = ($org_id) AND
ba2.season_id = ($season_id) AND bar2.resource_id IN ($resources)";
-// $sql = "SELECT id FROM bb_allocation ba2 WHERE ba2.from_ =
($from) AND ba2.to_ = ($to) AND ba2.organization_id = ($org_id) AND
ba2.season_id = ($season_id) AND EXISTS ( SELECT 1 FROM bb_allocation
a,bb_allocation_resource b WHERE a.id = b.allocation_id AND b.resource_id IN
($resources))";
$this->db->limit_query($sql, 0,__LINE__, __FILE__,1);
if(!$this->db->next_record())
Modified: branches/stavangerkommune/booking/inc/class.uiallocation.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.uiallocation.inc.php
2014-09-01 06:14:45 UTC (rev 12068)
+++ branches/stavangerkommune/booking/inc/class.uiallocation.inc.php
2014-09-03 11:37:21 UTC (rev 12069)
@@ -479,8 +479,8 @@
$allocation['from_'] =
$fromdate;
$allocation['to_'] = $todate;
- $id = $this->bo->so->get_allocation_id($allocation);
- if ($id)
+ $id = $this->bo->so->get_allocation_id($allocation);
+ if ($id)
{
$err =
$this->bo->so->check_for_booking($id);
}
Modified: branches/stavangerkommune/bookingfrontend/inc/class.uibooking.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uibooking.inc.php
2014-09-01 06:14:45 UTC (rev 12068)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uibooking.inc.php
2014-09-03 11:37:21 UTC (rev 12069)
@@ -330,7 +330,7 @@
$booking = $this->bo->read_single($id);
$booking['building'] =
$this->building_bo->so->read_single($booking['building_id']);
$booking['building_name'] =
$booking['building']['name'];
- $allocation =
$this->allocation_bo->read_single($booking['allocation_id']);
+ $group =
$this->group_bo->read_single($booking['group_id']);
$errors = array();
$update_count = 0;
$today = getdate();
@@ -507,9 +507,15 @@
$step++;
$season =
$this->season_bo->read_single($booking['season_id']);
-
- $where_clauses[] = sprintf("bb_booking.from_ >=
'%s 00:00:00'", date('Y-m-d'));
- //$params['filters']['where'] = $where_clauses;
+
+ $where_clauses[] = sprintf("EXTRACT(DOW FROM bb_booking.from_)
in (%s)",date('w', strtotime($booking['from_'])));
+ $where_clauses[] = sprintf("EXTRACT(HOUR FROM
bb_booking.from_) = %s",date('H', strtotime($booking['from_'])));
+ $where_clauses[] = sprintf("EXTRACT(MINUTE FROM
bb_booking.from_) = %s",date('i', strtotime($booking['from_'])));
+ $where_clauses[] = sprintf("EXTRACT(HOUR FROM bb_booking.to_)
= %s",date('H', strtotime($booking['to_'])));
+ $where_clauses[] = sprintf("EXTRACT(MINUTE FROM
bb_booking.to_) = %s",date('i', strtotime($booking['to_'])));
+ $where_clauses[] = sprintf("bb_booking.from_ >= '%s
00:00:00'", date('Y-m-d'));
+ $params['sort'] = 'from_';
+ $params['filters']['where'] = $where_clauses;
$params['filters']['season_id'] =
$booking['season_id'];
$params['filters']['group_id'] =
$booking['group_id'];
$booking = $this->bo->so->read($params);
Modified: branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php
2014-09-01 06:14:45 UTC (rev 12068)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uievent.inc.php
2014-09-03 11:37:21 UTC (rev 12069)
@@ -62,7 +62,7 @@
$currres = $event['resources'];
- list($event, $errors) = $this->extract_and_validate($event);
+// list($event, $errors) = $this->extract_and_validate($event);
if ($event['customer_organization_number']) {
$orginfo =
$this->bo->so->get_org($event['customer_organization_number']);
@@ -80,11 +80,13 @@
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
+ $test = $this->bo->read_single($event['id']);
$event['from_'] =
substr($_POST['org_from'],0,11).$_POST['from_'].":00";
$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_'] < $_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");
}
Modified: branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang
2014-09-01 06:14:45 UTC (rev 12068)
+++ branches/stavangerkommune/bookingfrontend/setup/phpgw_no.lang
2014-09-03 11:37:21 UTC (rev 12069)
@@ -373,4 +373,6 @@
Edit Events bookingfrontend no Rediger arrangement
Delete Event bookingfrontend no Slett arrangement
Check calendar bookingfrontend no Sjekk kalender
-You can't cancel event that has started, for help contacts site admin
bookingfrontend no Du kan ikke slette arrangement som er over.
\ No newline at end of file
+You can't cancel event that has started, for help contacts site admin
bookingfrontend no Du kan ikke slette arrangement som er over.
+You can't extend the event, for that contact administrator bookingfrontend
no Du kan ikke øke lengden på arrangementet, for det må du kontakte
administrator
+You can't change resources to the event, for that contact administrator
bookingfrontend no Du kan ikke forandre på ressurser, ofr det må du
kontakte administrator
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12069] bkbooking: stavanger bugfix,
Kjell Arne Espedal <=