fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11520] bkbooking: stavanger bugfix calendar


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [11520] bkbooking: stavanger bugfix calendar
Date: Tue, 10 Dec 2013 07:41:32 +0000

Revision: 11520
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11520
Author:   kjell
Date:     2013-12-10 07:41:26 +0000 (Tue, 10 Dec 2013)
Log Message:
-----------
bkbooking: stavanger bugfix calendar

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

Modified: branches/stavangerkommune/booking/inc/class.bobooking.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.bobooking.inc.php       
2013-12-09 13:30:24 UTC (rev 11519)
+++ branches/stavangerkommune/booking/inc/class.bobooking.inc.php       
2013-12-10 07:41:26 UTC (rev 11520)
@@ -666,11 +666,11 @@
             $new_bookings = array();
                        foreach($bookings as $b)
                        {
-                file_put_contents("/tmp/test.log", "\n", FILE_APPEND);
                                $keep = true;
                                foreach($events as &$e)
                                {
 
+                    file_put_contents("/tmp/test.log", $b['id']." 2. 
eid:".$e['id']." date:".substr($e['from_'],0,10)." 
etime:".substr($e['from_'],11,19)."-".substr($e['to_'],11,19)." 
btime:".substr($b['from_'],11,19)."-".substr($b['to_'],11,19)."\n", 
FILE_APPEND);
                                        if((($b['from_'] >= $e['from_'] && 
$b['from_'] < $e['to_']) ||
                                           ($b['to_'] > $e['from_'] && 
$b['to_'] <= $e['to_']) || 
                                           ($b['from_'] <= $e['from_'] && 
$b['to_'] >= $e['to_'])) && (array_intersect($b['resources'], $e['resources']) 
!= array()))
@@ -689,20 +689,18 @@
                         }
                         elseif (($ef >= $bf) && ($et > $bt))
                         {
-                            $nbrem = false;
-                            foreach ($new_bookings as $key => &$nb)
+
+                            foreach ($new_bookings as $key => $nb)
                             {
                                 $bid = $b['id'];
                                 if ($nb['id'] == $bid && $nb['from_'] == $ef) {
                                     unset($new_bookings[$key]);
-                                    $nbrem = true;
+                                    $b['from_'] = $bf;
+                                    $b['to_'] = $ef;
+                                    $new_bookings[] = $b;
                                 }
+
                             }
-                            if (!$nbrem) {
-                                $b['from_'] = $bf;
-                                $b['to_'] = $ef;
-                                $new_bookings[] = $b;
-                            }
                         }
                         elseif (($ef <= $bf) && ($et < $bt))
                         {




reply via email to

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