fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6601] merge 6597:6600 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [6601] merge 6597:6600 from trunk
Date: Tue, 16 Nov 2010 13:02:24 +0000

Revision: 6601
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6601
Author:   sigurdne
Date:     2010-11-16 13:02:23 +0000 (Tue, 16 Nov 2010)
Log Message:
-----------
merge 6597:6600 from trunk

Modified Paths:
--------------
    branches/Version-1_0-branch/booking/inc/class.menu.inc.php
    branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php
    branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php
    branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php
    branches/Version-1_0-branch/booking/js/booking/schedule.js
    branches/Version-1_0-branch/booking/setup/phpgw_no.lang
    branches/Version-1_0-branch/booking/templates/base/allocation_new.xsl
    branches/Version-1_0-branch/booking/templates/base/application.xsl
    branches/Version-1_0-branch/booking/templates/base/booking_new.xsl
    branches/Version-1_0-branch/booking/templates/base/css/base.css

Added Paths:
-----------
    branches/Version-1_0-branch/booking/inc/class.bomassbooking.inc.php
    
branches/Version-1_0-branch/booking/inc/class.bopermission_massbooking.inc.php
    branches/Version-1_0-branch/booking/inc/class.somassbooking.inc.php
    
branches/Version-1_0-branch/booking/inc/class.sopermission_massbooking.inc.php
    branches/Version-1_0-branch/booking/inc/class.uimassbooking.inc.php
    
branches/Version-1_0-branch/booking/inc/class.uipermission_massbooking.inc.php
    branches/Version-1_0-branch/booking/templates/base/allocation_info.xsl
    branches/Version-1_0-branch/booking/templates/base/booking_info.xsl
    branches/Version-1_0-branch/booking/templates/base/booking_new_preview.xsl
    branches/Version-1_0-branch/booking/templates/base/massbooking_schedule.xsl

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600

Copied: branches/Version-1_0-branch/booking/inc/class.bomassbooking.inc.php 
(from rev 6600, trunk/booking/inc/class.bomassbooking.inc.php)
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.bomassbooking.inc.php         
                (rev 0)
+++ branches/Version-1_0-branch/booking/inc/class.bomassbooking.inc.php 
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,86 @@
+<?php
+       phpgw::import_class('booking.bocommon_authorized');
+       
+       class booking_bomassbooking extends booking_bocommon_authorized
+       {
+               function __construct()
+               {
+                       parent::__construct();
+                       $this->so = CreateObject('booking.somassbooking');
+               }
+               
+               protected function get_object_role_permissions(array 
$forObject, $defaultPermissions)
+               {
+                       return array_merge(
+                               array
+                               (
+                                       booking_sopermission::ROLE_MANAGER => 
array
+                                       (
+                                               'write' => true,
+                                       ),
+                                       booking_sopermission::ROLE_CASE_OFFICER 
=> array
+                                       (
+                                               'write' => 
array_fill_keys(array('name', 'homepage', 'description', 'email', 'phone', 
'street', 'zip_code', 'city', 'district'), true),
+                                       ),
+                                       'global' => array
+                                       (
+                                               
booking_sopermission::ROLE_MANAGER => array
+                                               (
+                                                       'read' => true,
+                                                       'write' => true,
+                                                       'create' => true,
+                                                       'delete' => true,
+                                               ),
+                                       )
+                               ),
+                               $defaultPermissions
+                       );
+               }
+               
+               protected function 
get_collection_role_permissions($defaultPermissions)
+               {
+                       return array_merge(
+                               array(
+                                       'global' => array
+                                       (
+                                               
booking_sopermission::ROLE_MANAGER => array
+                                               (
+                                                       'create' => true, 
#means that this role may create new objects of the present type
+                                                       'delete' => true,
+                                               ),
+                                       ),
+                               ),
+                               $defaultPermissions
+                       );
+               }
+
+               public function get_schedule($id, $module)
+               {
+                       $date = new DateTime(phpgw::get_var('date'));
+                       // Make sure $from is a monday
+                       if($date->format('w') != 1)
+                       {
+                               $date->modify('last monday');
+                       }
+                       $prev_date = clone $date;
+                       $next_date = clone $date;
+                       $prev_date->modify('-1 week');
+                       $next_date->modify('+1 week');
+                       $building = $this->read_single($id);
+
+                       $building['buildings_link'] = 
self::link(array('menuaction' => $module .'.index'));
+                       $building['building_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.show', 'id' => 
$building['id']));
+                       $building['date'] = $date->format('Y-m-d');
+                       $building['week'] = intval($date->format('W'));
+                       $building['year'] = intval($date->format('Y'));
+                       $building['prev_link'] = self::link(array('menuaction' 
=> $module .'.schedule', 'id' => $building['id'], 'date'=> 
$prev_date->format('Y-m-d')));
+                       $building['next_link'] = self::link(array('menuaction' 
=> $module .'.schedule', 'id' => $building['id'], 'date'=> 
$next_date->format('Y-m-d')));
+                       for($i = 0; $i < 7; $i++)
+                       {
+                               $building['days'][] = array('label' => 
sprintf('%s<br/>%s %s', lang($date->format('l')), lang($date->format('M')), 
$date->format('d')), 'key' => $date->format('D'));
+                               $date->modify('+1 day');
+                       }
+                       return $building;
+               }
+               
+       }

Copied: 
branches/Version-1_0-branch/booking/inc/class.bopermission_massbooking.inc.php 
(from rev 6600, trunk/booking/inc/class.bopermission_massbooking.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/booking/inc/class.bopermission_massbooking.inc.php  
                            (rev 0)
+++ 
branches/Version-1_0-branch/booking/inc/class.bopermission_massbooking.inc.php  
    2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,6 @@
+<?php
+       phpgw::import_class('booking.bopermission');
+       
+       class booking_bopermission_massbooking extends booking_bopermission
+       {
+       }

Modified: branches/Version-1_0-branch/booking/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.menu.inc.php  2010-11-16 
11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/inc/class.menu.inc.php  2010-11-16 
13:02:23 UTC (rev 6601)
@@ -57,6 +57,12 @@
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'booking.uievent.index') ),
                                                        'image' => 
array('property', 'project_request'),
                                                ),
+                                               'massbookings' => array
+                                               (
+                                                       'text'  => 
lang('Bookings and allocations'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'booking.uimassbooking.index') ),
+                                                       'image' => 
array('property', 'project_request'),
+                                               ),
                                        )
                                ),
                                'buildings' => array

Copied: branches/Version-1_0-branch/booking/inc/class.somassbooking.inc.php 
(from rev 6600, trunk/booking/inc/class.somassbooking.inc.php)
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.somassbooking.inc.php         
                (rev 0)
+++ branches/Version-1_0-branch/booking/inc/class.somassbooking.inc.php 
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,26 @@
+<?php
+       phpgw::import_class('booking.socommon');
+       
+       class booking_somassbooking extends booking_socommon
+       {
+               function __construct()
+               {
+                       parent::__construct('bb_building', 
+                               array(
+                                       'id' => array('type' => 'int'),
+                                       'name' => array('type' => 'string', 
'query' => true, 'required' => true),
+                                       'homepage' => array('type' => 'string'),
+                                       'description' => array('type' => 
'string'),
+                                       'phone' => array('type' => 'string'),
+                                       'email' => array('type' => 'string'),
+                                       'location_code' =>array('type' => 
'string', 'required' => false),
+                                       'street'                => array('type' 
=> 'string', 'query' => true),
+                                       'zip_code'              => array('type' 
=> 'string'),
+                                       'district'              => array('type' 
=> 'string', 'query' => true),
+                                       'city'                  => array('type' 
=> 'string', 'query' => true),
+                                       'active' => array('type' => 'int')
+                               )
+                       );
+               }
+               
+       }

Copied: 
branches/Version-1_0-branch/booking/inc/class.sopermission_massbooking.inc.php 
(from rev 6600, trunk/booking/inc/class.sopermission_massbooking.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/booking/inc/class.sopermission_massbooking.inc.php  
                            (rev 0)
+++ 
branches/Version-1_0-branch/booking/inc/class.sopermission_massbooking.inc.php  
    2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,6 @@
+<?php
+       phpgw::import_class('booking.sopermission');
+       
+       class booking_sopermission_massbooking extends booking_sopermission
+       {
+       }

Modified: branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php  
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/inc/class.uiallocation.inc.php  
2010-11-16 13:02:23 UTC (rev 6601)
@@ -10,6 +10,7 @@
                        'add'                   =>      true,
                        'show'                  =>      true,
                        'edit'                  =>      true,
+                       'info'                  =>      true,
                        'toggle_show_inactive'  =>      true,
                );
 
@@ -20,6 +21,7 @@
                        $this->organization_bo    = 
CreateObject('booking.boorganization');
                        $this->building_bo    = 
CreateObject('booking.bobuilding');
                        $this->season_bo    = CreateObject('booking.boseason');
+                       $this->resource_bo = CreateObject('booking.boresource');
                        
self::set_active_menu('booking::applications::allocations');
                        $this->fields = array('resources', 'cost', 
'application_id',
                                                                  
'building_id', 'building_name', 
@@ -208,14 +210,27 @@
                                        }
                                }
                        }
+                       if(phpgw::get_var('resource', 'GET') == '')
+                       {                       
+                               array_set_default($allocation, 'resources', 
array());
+                               $weekday =  'monday';
+                       }
+                       else 
+                       {
+                               array_set_default($allocation, 'resources', 
array(get_var('resource', int, 'GET')));
+                               array_set_default($allocation, 'building_id', 
phpgw::get_var('building_id', 'GET'));
+                               array_set_default($allocation, 'building_name', 
phpgw::get_var('building_name', 'GET'));
+                               array_set_default($allocation, 'from_', 
phpgw::get_var('from_', 'GET'));
+                               array_set_default($allocation, 'to_', 
phpgw::get_var('to_', 'GET'));
+                               $weekday =  
strtolower(strftime("%A",strtotime($allocation['from_'][0])));
+                       }
 
                        $this->flash_form_errors($errors);
                        self::add_javascript('booking', 'booking', 
'allocation.js');
-                       array_set_default($allocation, 'resources', array());
                        $allocation['resources_json'] = 
json_encode(array_map('intval', $allocation['resources']));
                        $allocation['cancel_link'] = 
self::link(array('menuaction' => 'booking.uiallocation.index'));
                        array_set_default($allocation, 'cost', '0');
-
+               
                        if ($step < 2) 
                        {
                                if($_SERVER['REQUEST_METHOD'] == 'POST' && 
$errors) {                           
@@ -227,6 +242,7 @@
                                        'interval' => $_POST['field_interval'],
                                        'repeat_until' => 
$_POST['repeat_until'],
                                        'outseason' => $_POST['outseason'],
+                                       'weekday' => $weekday,
                                ));
                        } 
                        else if ($step == 2) 
@@ -319,4 +335,24 @@
                        $allocation['resource_ids'] = $resource_ids;
                        self::render_template('allocation', array('allocation' 
=> $allocation));
                }
+               public function info()
+               {
+                       $allocation = 
$this->bo->read_single(intval(phpgw::get_var('id', 'GET')));
+                       $resources = 
$this->resource_bo->so->read(array('filters'=>array('id'=>$allocation['resources']),
 'sort'=>'name'));
+                       $allocation['resources'] = $resources['results'];
+                       $res_names = array();
+                       foreach($allocation['resources'] as $res)
+                       {
+                               $res_names[] = $res['name'];
+                       }
+                       $allocation['resource'] = phpgw::get_var('resource', 
'GET');
+                       $allocation['resource_info'] = join(', ', $res_names);
+                       $allocation['building_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.show', 'id' => 
$allocation['resources'][0]['building_id']));
+                       $allocation['org_link'] = self::link(array('menuaction' 
=> 'booking.uiorganization.show', 'id' => $allocation['organization_id']));
+                       $allocation['add_link'] = self::link(array('menuaction' 
=> 'booking.uibooking.add', 'allocation_id'=>$allocation['id'], 
'from_'=>$allocation['from_'], 'to_'=>$allocation['to_'], 
'resource'=>$allocation['resource']));
+                       $allocation['when'] = 
pretty_timestamp($allocation['from_']).' - 
'.pretty_timestamp($allocation['to_']);
+                       self::render_template('allocation_info', 
array('allocation'=>$allocation));
+                       $GLOBALS['phpgw']->xslttpl->set_output('wml'); // Evil 
hack to disable page chrome
+               }
+
        }

Modified: branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php 
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/inc/class.uiapplication.inc.php 
2010-11-16 13:02:23 UTC (rev 6601)
@@ -385,7 +385,7 @@
                        }
                        array_set_default($application, 'building_id', 
phpgw::get_var('building_id', 'GET'));
 
-                       array_set_default($application, 'building_name', 
mb_detect_encoding(phpgw::get_var('building_name', 'GET')));
+                       array_set_default($application, 'building_name', 
phpgw::get_var('building_name', 'GET'));
                        
                        if (strstr($application['building_name'],"%")){
                                $search = array('%C3%85', '%C3%A5', '%C3%98', 
'%C3%B8', '%C3%86', '%C3%A6');

Modified: branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php     
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/inc/class.uibooking.inc.php     
2010-11-16 13:02:23 UTC (rev 6601)
@@ -10,6 +10,7 @@
                        'add'                   =>      true,
                        'show'                  =>      true,
                        'edit'                  =>      true,
+                       'info'                  =>      true,
                        'building_schedule' =>  true,
                        'resource_schedule' =>  true,
                        'toggle_show_inactive'  =>      true,
@@ -26,6 +27,9 @@
                        $this->agegroup_bo = CreateObject('booking.boagegroup');
                        $this->audience_bo = CreateObject('booking.boaudience');
                        $this->building_bo = CreateObject('booking.bobuilding');
+                       $this->resource_bo = CreateObject('booking.boresource');
+                       $this->season_bo = CreateObject('booking.boseason');
+                       $this->allocation_bo = 
CreateObject('booking.boallocation');
                        $this->group_bo    = CreateObject('booking.bogroup');
                        
self::set_active_menu('booking::applications::bookings');
                        $this->fields = array('allocation_id', 'activity_id', 
'resources',
@@ -128,6 +132,12 @@
                        return $this->yui_results($bookings);
                }
 
+               private function item_link(&$item, $key)
+               {
+                       if(in_array($item['type'], array('allocation', 
'booking', 'event')))
+                               $item['info_url'] = 
$this->link(array('menuaction' => 'booking.ui'.$item['type'].'.info', 'id' => 
$item['id']));
+               }
+
                public function building_schedule()
                {
                    $date = new DateTime(phpgw::get_var('date'));
@@ -136,6 +146,7 @@
                        {
                                $booking['resource_link'] = 
$this->link(array('menuaction' => 'booking.uiresource.schedule', 'id' => 
$booking['resource_id']));
                                $booking['link'] = 
$this->link(array('menuaction' => 'booking.uibooking.show', 'id' => 
$booking['id']));
+                               array_walk($booking, array($this, 'item_link'));
                        }
                        $data = array
                        (
@@ -154,6 +165,7 @@
                        foreach($bookings['results'] as &$booking)
                        {
                                $booking['link'] = 
$this->link(array('menuaction' => 'booking.uibooking.show', 'id' => 
$booking['id']));
+                               array_walk($booking, array($this, 'item_link'));
                        }
                        $data = array
                        (
@@ -168,40 +180,188 @@
                public function add()
                {
                        $errors = array();
+                       $booking = array();
+                       $booking['building_id'] = phpgw::get_var('building_id', 
'int', 'GET');
+                       $allocation_id = phpgw::get_var('allocation_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');
+                       $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');
+                       if (! isset($step)) $step = 1;
+                       $invalid_dates = array();
+                       $valid_dates = array();
+
+                       if($allocation_id)
+                       {
+                               $allocation = 
$this->allocation_bo->read_single($allocation_id);
+                               $season = 
$this->season_bo->read_single($allocation['season_id']);
+                               $building = 
$this->building_bo->read_single($season['building_id']);
+                               $booking['season_id'] = $season['id'];
+                               $booking['building_id'] = $building['id'];
+                               $booking['building_name'] = $building['name'];
+                               array_set_default($booking, 'resources', 
array(get_var('resource', int, 'GET')));
+                               $booking['organization_id'] = 
$allocation['organization_id'];
+                               $booking['organization_name'] = 
$allocation['organization_name'];
+               }
                        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_']);
+                                       $booking['from_'] = join(" 
",$date_from);
+                                       $_POST['from_'] = join(" ",$date_from);
+                                       $date_to = array($time_to[0], 
$_POST['to_']);
+                                       $booking['to_'] = join(" ",$date_to); 
+                                       $_POST['to_'] = join(" ",$date_to);
+                               }                               
+                               $booking['building_name'] = $building['name'];
+                               $booking['building_id'] = $building['id'];
                                $booking['active'] = '1';
+                               $booking['cost'] = 0;
                                $booking['completed'] = '0';
+                               $booking['reminder'] = '1';
+                               $booking['secret'] = $this->generate_secret();
                                array_set_default($booking, 'audience', 
array());
                                array_set_default($booking, 'agegroups', 
array());
                                array_set_default($_POST, 'resources', array());
                                $this->agegroup_bo->extract_form_data($booking);
-                               $booking['secret'] = $this->generate_secret();
 
                                $errors = $this->bo->validate($booking);
-                               if(!$errors)
+
+
+                               if (strtotime($_POST['from_']) < $today[0])
                                {
-                                       try {
-                                               $receipt = 
$this->bo->add($booking);
-                                               
$this->redirect(array('menuaction' => 'booking.uibooking.show', 
'id'=>$receipt['id'], 'secret'=>$booking['secret']));
-                                       } catch (booking_unauthorized_exception 
$e) {
-                                               $errors['global'] = lang('Could 
not add object due to insufficient permissions');
+                                       if($_POST['recurring'] == 'on' || 
$_POST['outseason'] == 'on')
+                                       {                                       
+                                               $errors['booking'] = lang('Can 
not repeat from a date in the past');
                                        }
+                                       else
+                                       {
+                                               $errors['booking'] = lang('Can 
not create a booking in the past');
+                                       }
+                               } 
+                               if (!$allocation_id &&  $_POST['outseason'] == 
'on')
+                               {
+                                       $errors['booking'] = lang('This booking 
is not connected to a season');
+                               }       
+
+                               if (!$errors)
+                               {
+                                       $step++;
                                }
+
+                               if (!$errors && $_POST['recurring'] != 'on' && 
$_POST['outseason'] != 'on' )
+                               {
+                                       $receipt = $this->bo->add($booking);
+                                       $this->redirect(array('menuaction' => 
'booking.uimassbooking.schedule', 'id'=>$booking['building_id']));
+                               }
+                               else if ( ($_POST['recurring'] == 'on' || 
$_POST['outseason'] == 'on')  && !$errors && $step > 1)
+                               {
+                                       if ($_POST['recurring'] == 'on') {
+                                               $repeat_until = 
strtotime($_POST['repeat_until'])+60*60*24; 
+                                       } 
+                                       else
+                                       {
+                                               $repeat_until = 
strtotime($season['to_'])+60*60*24; 
+                                               $_POST['repeat_until'] = 
$season['to_'];
+                                       } 
+
+                                       $max_dato = strtotime($_POST['to_']); 
// highest date from input
+                                       $interval = 
$_POST['field_interval']*60*60*24*7; // weeks in seconds
+                                       $i = 0;
+                                       // calculating valid and invalid dates 
from the first booking's to-date to the repeat_until date is reached
+                                       // the form from step 1 should validate 
and if we encounter any errors they are caused by double bookings.
+                                       while (($max_dato+($interval*$i)) <= 
$repeat_until)
+                                       {
+                                               $fromdate = date('Y-m-d H:i', 
strtotime($_POST['from_']) + ($interval*$i));
+                                               $todate = date('Y-m-d H:i', 
strtotime($_POST['to_']) + ($interval*$i));
+                                               $booking['from_'] = $fromdate;
+                                               $booking['to_'] = $todate;
+                                               $err = 
$this->bo->validate($booking);
+                                               if ($err) 
+                                               {
+                                                       
$invalid_dates[$i]['from_'] = $fromdate;
+                                                       
$invalid_dates[$i]['to_'] = $todate;
+                                               } 
+                                               else 
+                                               {
+                                                       
$valid_dates[$i]['from_'] = $fromdate;
+                                                       $valid_dates[$i]['to_'] 
= $todate;
+                                                       if ($step == 3)
+                                                       {
+                                                               
$booking['secret'] = $this->generate_secret();
+                                                               $receipt = 
$this->bo->add($booking);
+                                                       }
+                                               }
+                                               $i++;
+                                       }
+                                       if ($step == 3) 
+                                       {
+                                               
$this->redirect(array('menuaction' => 'booking.uimassbooking.schedule', 
'id'=>$booking['building_id']));
+                                       }
+                               }
                        }
+
                        $this->flash_form_errors($errors);
                        self::add_javascript('booking', 'booking', 
'booking.js');
                        array_set_default($booking, 'resources', array());
                        $booking['resources_json'] = 
json_encode(array_map('intval', $booking['resources']));
-                       $booking['cancel_link'] = self::link(array('menuaction' 
=> 'booking.uibooking.index'));
+                       $booking['cancel_link'] = self::link(array('menuaction' 
=> 'booking.uimassbooking.index'));
                        $agegroups = $this->agegroup_bo->fetch_age_groups();
                        $agegroups = $agegroups['results'];
                        $audience = $this->audience_bo->fetch_target_audience();
                        $audience = $audience['results'];
                        $activities = $this->activity_bo->fetch_activities();
                        $activities = $activities['results'];
-                       self::render_template('booking_new', array('booking' => 
$booking, 'activities' => $activities, 'agegroups' => $agegroups, 'audience' => 
$audience));
+                       $groups = 
$this->group_bo->so->read(array('filters'=>array('organization_id'=>$allocation['organization_id'],
 'active'=>1)));
+                       $groups = $groups['results'];
+
+                       $resouces_full = 
$this->resource_bo->so->read(array('filters'=>array('id'=>$booking['resources']),
 'sort'=>'name'));
+                       $res_names = array();
+                       foreach($resouces_full['results'] as $res)
+                       {
+                               $res_names[] = array('id' => $res['id'],'name' 
=> $res['name']);
+                       }
+
+                       if ($step < 2) 
+                       {
+                               self::render_template('booking_new', 
array('booking' => $booking, 
+                                       'activities' => $activities, 
+                                       'agegroups' => $agegroups, 
+                                       'audience' => $audience, 
+                                       'groups' => $groups, 
+                                       'step' => $step, 
+                                       'interval' => $_POST['field_interval'],
+                                       'repeat_until' => 
$_POST['repeat_until'],
+                                       'recurring' => $_POST['recurring'],
+                                       'outseason' => $_POST['outseason'],
+                                       'date_from' => $time_from[0],
+                                       'date_to' => $time_to[0],
+                                       'res_names' => $res_names)
+                               );
+                       } 
+                       else if ($step == 2) 
+                       {
+                               self::render_template('booking_new_preview', 
array('booking' => $booking, 
+                                       'activities' => $activities,
+                                       'agegroups' => $agegroups,
+                                       'audience' => $audience,
+                                       'step' => $step,
+                                       'recurring' => $_POST['recurring'],
+                                       'outseason' => $_POST['outseason'],
+                                       'interval' => $_POST['field_interval'],
+                                       'repeat_until' => 
$_POST['repeat_until'],
+                                       'from_date' => $_POST['from_'],
+                                       'to_date' => $_POST['to_'],
+                                       'valid_dates' => $valid_dates,
+                                       'invalid_dates' => $invalid_dates,
+                                       'groups' => $groups)
+                               );
+                       }
                }
 
                private function send_mailnotification_to_group($group, 
$subject, $body)
@@ -288,4 +448,28 @@
                        $booking['resource_ids'] = $resource_ids;
                        self::render_template('booking', array('booking' => 
$booking));
                }
+
+               public function info()
+               {
+                       $booking = 
$this->bo->read_single(intval(phpgw::get_var('id', 'GET')));
+                       $booking['group'] = 
$this->group_bo->read_single($booking['group_id']);
+                       $resources = 
$this->resource_bo->so->read(array('filters'=>array('id'=>$booking['resources']),
 'sort'=>'name'));
+                       $booking['resources'] = $resources['results'];
+                       $res_names = array();
+                       foreach($booking['resources'] as $res)
+                       {
+                               $res_names[] = $res['name'];
+                       }
+                       $booking['resource_info'] = join(', ', $res_names);
+                       $booking['building_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.show', 'id' => 
$booking['resources'][0]['building_id']));
+                       $booking['org_link'] = self::link(array('menuaction' => 
'booking.uiorganization.show', 'id' => $booking['group']['organization_id']));
+                       $booking['group_link'] = self::link(array('menuaction' 
=> 'booking.uigroup.show', 'id' => $booking['group']['id']));
+                       
+                       $booking['edit_link'] = self::link(array('menuaction' 
=> 'booking.uibooking.edit', 'id' => $booking['id']));
+                               
+                       $booking['when'] = 
pretty_timestamp($booking['from_']).' - '.pretty_timestamp($booking['to_']);
+                       self::render_template('booking_info', 
array('booking'=>$booking));
+                       $GLOBALS['phpgw']->xslttpl->set_output('wml'); // Evil 
hack to disable page chrome
+               }
+
        }

Copied: branches/Version-1_0-branch/booking/inc/class.uimassbooking.inc.php 
(from rev 6600, trunk/booking/inc/class.uimassbooking.inc.php)
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uimassbooking.inc.php         
                (rev 0)
+++ branches/Version-1_0-branch/booking/inc/class.uimassbooking.inc.php 
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,137 @@
+<?php
+       phpgw::import_class('booking.uicommon');
+       phpgw::import_class('booking.uidocument_building');
+       phpgw::import_class('booking.uipermission_building');
+
+       class booking_uimassbooking extends booking_uicommon
+       {       
+               public $public_functions = array
+               (
+                       'index'                 =>      true,
+                       'active'                =>      true,
+                       'add'                   =>      true,
+                       'show'                  =>      true,
+                       'edit'                  =>      true,
+                       'schedule'              =>      true,
+                       'properties'    =>      true,
+                       'toggle_show_inactive'  =>      true,
+                       'find_buildings_used_by' => true,
+               );
+
+               public function __construct()
+               {
+                       parent::__construct();
+                       
+                       self::process_booking_unauthorized_exceptions();
+                       
+                       $this->bo = CreateObject('booking.bomassbooking');
+                       
self::set_active_menu('booking::applications::massboooking');
+                       $this->fields = array('name', 'homepage', 
'description', 'email', 'street', 'zip_code', 'city', 'district', 'phone', 
'active', 'location_code');
+               }
+                               
+               public function index()
+               {       
+                       if(phpgw::get_var('phpgw_return_as') == 'json') {
+                               return $this->index_json();
+                       }
+                       self::add_javascript('booking', 'booking', 
'datatable.js');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('paginator');
+                       $data = array(
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array(
+                                                               'type' => 
'text', 
+                                                               'name' => 
'query'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'submit',
+                                                               'name' => 
'search',
+                                                               'value' => 
lang('Search')
+                                                       ),
+                                                       array(
+                                                               'type' => 
'link',
+                                                               'value' => 
$_SESSION['showall'] ? lang('Show only active') : lang('Show all'),
+                                                               'href' => 
self::link(array('menuaction' => $this->url_prefix.'.toggle_show_inactive'))
+                                                       ),
+                                               )
+                                       ),
+                               ),
+                               'datatable' => array(
+                                       'source' => 
self::link(array('menuaction' => 'booking.uimassbooking.index', 
'phpgw_return_as' => 'json')),
+                                       'field' => array(
+                                               array(
+                                                       'key' => 'name',
+                                                       'label' => 
lang('Building'),
+                                                       'formatter' => 
'YAHOO.booking.formatLink'
+                                               ),
+                                               array(
+                                                       'key' => 'street',
+                                                       'label' => 
lang('Street'),
+                                               ),
+                                               array(
+                                                       'key' => 'zip_code',
+                                                       'label' => lang('Zip 
code'),
+                                               ),
+                                               array(
+                                                       'key' => 'city',
+                                                       'label' => lang('Postal 
City'),
+                                               ),
+                                               array(
+                                                       'key' => 'district',
+                                                       'label' => 
lang('District'),
+                                               ),
+                                               array(
+                                                       'key' => 'link',
+                                                       'hidden' => true
+                                               )
+                                       )
+                               )
+                       );
+
+                       self::render_template('datatable', $data);
+               }
+
+               public function index_json()
+               {
+                       
+                       $buildings = $this->bo->read();
+                       foreach($buildings['results'] as &$building)
+                       {
+                               $building['link'] = 
$this->link(array('menuaction' => 'booking.uimassbooking.schedule', 'id' => 
$building['id']));
+                               $building['active'] = $building['active'] ? 
lang('Active') : lang('Inactive');
+                       }
+                       return $this->yui_results($buildings);
+               }
+
+               private function item_link(&$item, $key)
+               {
+                       if(in_array($item['type'], array('allocation', 
'booking', 'event')))
+                               $item['info_url'] = 
$this->link(array('menuaction' => 'booking.ui'.$item['type'].'.info', 'id' => 
$item['id']));
+               }
+
+               public function schedule()
+               {
+                       $backend = phpgw::get_var('backend', 'GET');
+                       $building = 
$this->bo->get_schedule(phpgw::get_var('id', 'GET'), "booking.uimassbooking");
+                       $building['application_link'] = self::link(array(
+                               'menuaction' => 'booking.uiallocation.add', 
+                               'building_id' => $building['id'], 
+                               'building_name' => $building['name'],
+                       ));
+                       $building['datasource_url'] = self::link(array(
+                               'menuaction' => 
'booking.uibooking.building_schedule', 
+                               'building_id' => $building['id'], 
+                               'phpgw_return_as' => 'json',
+                       ));
+                       if ($backend == 'true')
+                       {
+                               $building['date'] = phpgw::get_var('date', 
'GET');
+                       }
+                       self::add_javascript('booking', 'booking', 
'schedule.js');
+                       self::render_template('massbooking_schedule', 
array('building' => $building, 'backend' => $backend));
+               }
+
+
+       }

Copied: 
branches/Version-1_0-branch/booking/inc/class.uipermission_massbooking.inc.php 
(from rev 6600, trunk/booking/inc/class.uipermission_massbooking.inc.php)
===================================================================
--- 
branches/Version-1_0-branch/booking/inc/class.uipermission_massbooking.inc.php  
                            (rev 0)
+++ 
branches/Version-1_0-branch/booking/inc/class.uipermission_massbooking.inc.php  
    2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,19 @@
+<?php
+       phpgw::import_class('booking.uipermission');
+
+       class booking_uipermission_massbooking extends booking_uipermission
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+                       
self::set_active_menu('booking::applications::massbooking::permissions');
+               }
+               
+               protected function get_parent_pathway(array $forDocumentData)
+               {
+                       return array( 
+                               array('text' => 'objects_plural_name',  'href' 
=> 'objects_plural_href'), 
+                               array('text' => 'object_singular_name', 'href' 
=> 'object_singular_name'),
+                       );
+               }
+       }

Modified: branches/Version-1_0-branch/booking/js/booking/schedule.js
===================================================================
--- branches/Version-1_0-branch/booking/js/booking/schedule.js  2010-11-16 
11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/js/booking/schedule.js  2010-11-16 
13:02:23 UTC (rev 6601)
@@ -54,7 +54,7 @@
 };
 
 YAHOO.booking.showBookingInfo = function(booking,elCell) {
-       var overlay = new YAHOO.widget.Overlay("overlay-info", { 
fixedcenter:true, visible:true, width:"400px" } );
+       var overlay = new YAHOO.widget.Overlay("overlay-info", { 
fixedcenter:true, visible:true, width:"400px" } );     
        var callback = {
                success : function(o) {
                        overlay.setBody(o.responseText);

Modified: branches/Version-1_0-branch/booking/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/booking/setup/phpgw_no.lang     2010-11-16 
11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/setup/phpgw_no.lang     2010-11-16 
13:02:23 UTC (rev 6601)
@@ -471,4 +471,9 @@
 Out season     booking no      Ut sesong
 Allocations colliding with existing allocations or bookings (%1)       booking 
no      Tildelinger ikke kan lages
 Allocations that can be created        booking no      Tildelinger som kan 
lages
-There is set a cost, but no invoice data is filled inn booking no      Det er 
satt en pris, men ingen fakturainformasjon er gitt 
+There is set a cost, but no invoice data is filled inn booking no      Det er 
satt en pris, men ingen fakturainformasjon er gitt
+Create new booking     booking no      Lag ny booking
+Recurring booking      booking no      Gjenta booking
+Repeat until   booking no      Gjenta til
+Bookings that can be created   booking no      Bookinger som kan lages
+Bookings and allocations       booking no      Bookinger og tildelinger

Copied: branches/Version-1_0-branch/booking/templates/base/allocation_info.xsl 
(from rev 6600, trunk/booking/templates/base/allocation_info.xsl)
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/allocation_info.xsl      
                        (rev 0)
+++ branches/Version-1_0-branch/booking/templates/base/allocation_info.xsl      
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,22 @@
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+       <div class="close"><a onclick="YAHOO.booking.closeOverlay(); return 
false" href=""><xsl:value-of select="php:function('lang', 'Close')"/></a></div>
+       <h3><xsl:value-of select="php:function('lang', 'Allocation')"/> 
#<xsl:value-of select="allocation/id"/></h3>
+       <dl>
+               <dt><xsl:value-of select="php:function('lang', 'Where')"/></dt>
+               <dd>
+                       <a href="{allocation/building_link}"><xsl:value-of 
select="allocation/resources[position()=1]/building_name"/></a>
+                       (<xsl:value-of select="allocation/resource_info"/>)
+               </dd>
+               <dt><xsl:value-of select="php:function('lang', 'When')"/></dt>
+               <dd><xsl:value-of select="allocation/when"/></dd>
+               <dt><xsl:value-of select="php:function('lang', 'Who')"/></dt>
+               <dd>
+                       <a href="{allocation/org_link}"><xsl:value-of 
select="allocation/organization_name"/></a>
+               </dd>
+       </dl>
+       <xsl:if test="allocation/add_link">
+               <div class="actions">
+                       <button 
onclick="location.href='{allocation/add_link}'"><xsl:value-of 
select="php:function('lang', 'Create new booking')"/></button>
+               </div>
+       </xsl:if>
+</xsl:template>

Modified: branches/Version-1_0-branch/booking/templates/base/allocation_new.xsl
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/allocation_new.xsl       
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/templates/base/allocation_new.xsl       
2010-11-16 13:02:23 UTC (rev 6601)
@@ -48,37 +48,37 @@
                                                <xsl:value-of 
select="php:function('lang', 'Monday')" />        
                                        </option>
                                        <option value="tuesday">
-                                               <xsl:if 
test="../allocation/weekday = 'tuesday'">
+                                               <xsl:if test="weekday = 
'tuesday'">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of 
select="php:function('lang', 'Tuesday')" />
                                        </option>
                                        <option value="wednesday">
-                                               <xsl:if 
test="../allocation/weekday = 'wednesday'">
+                                               <xsl:if test="weekday = 
'wednesday'">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of 
select="php:function('lang', 'Wednesday')" />
                                        </option>
                                        <option value="thursday">
-                                               <xsl:if 
test="../allocation/weekday = 'thursday'">
+                                               <xsl:if test="weekday = 
'thursday'">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of 
select="php:function('lang', 'Thursday')" />
                                        </option>
                                        <option value="friday">
-                                               <xsl:if 
test="../allocation/weekday = 'friday'">
+                                               <xsl:if test="weekday = 
'friday'">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of 
select="php:function('lang', 'Friday')" />
                                        </option>
                                        <option value="saturday">
-                                               <xsl:if 
test="../allocation/weekday = 'saturday'">
+                                               <xsl:if test="weekday = 
'saturday'">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of 
select="php:function('lang', 'Saturday')" />
                                        </option>
                                        <option value="sunday">
-                                               <xsl:if 
test="../allocation/weekday = 'sunday'">
+                                               <xsl:if test="weekday = 
'sunday'">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
                                                <xsl:value-of 
select="php:function('lang', 'Sunday')" />

Modified: branches/Version-1_0-branch/booking/templates/base/application.xsl
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/application.xsl  
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/templates/base/application.xsl  
2010-11-16 13:02:23 UTC (rev 6601)
@@ -60,18 +60,36 @@
                                </div>
                        </xsl:if>
                                        
-        <dl class="proplist-col">
-            <dt><xsl:value-of select="php:function('lang', 'Status')" /></dt>
-            <dd><xsl:value-of select="php:function('lang', 
string(application/status))"/></dd>
+               <xsl:if test="not(frontend)">
+               <dl class="proplist-col">
+                   <dt><xsl:value-of select="php:function('lang', 'Status')" 
/></dt>
+                   <dd><xsl:value-of select="php:function('lang', 
string(application/status))"/></dd>
+               </dl>
+               <dl class="proplist-col">
+                   <dt><xsl:value-of select="php:function('lang', 'Created')" 
/></dt>
+                   <dd><xsl:value-of select="php:function('pretty_timestamp', 
application/created)"/></dd>
+               </dl>
+               <dl class="proplist-col">
+                   <dt><xsl:value-of select="php:function('lang', 'Modified')" 
/></dt>
+                   <dd><xsl:value-of select="php:function('pretty_timestamp', 
application/modified)"/></dd>
+               </dl>
+               </xsl:if>
+               <xsl:if test="frontend">
+                       <dl class="proplist">
+                       <span style="font-size: 110%; font-weight: bold;">Din 
søknad har status <xsl:value-of select="php:function('lang', 
string(application/status))"/></span><span class="text">, opprettet 
<xsl:value-of select="php:function('pretty_timestamp', application/created)"/>, 
sist endret <xsl:value-of select="php:function('pretty_timestamp', 
application/modified)"/></span>
+                       <span class="text"><br />Melding fra saksbehandler 
ligger under historikk, deretter vises kopi av din søknad.<br /> Skal du gi en 
melding til saksbehandler skriver du denne inn i feltet under "Legg til en 
kommentar"</span> 
+                       </dl>
+               </xsl:if>
+
+        <dl class="proplist">
+            <dt class="heading"><xsl:value-of select="php:function('lang', 
'Add a comment')" /></dt>
+                       <dd>
+                               <form method="POST">
+                                       <textarea name="comment" style="width: 
60%; height: 7em"></textarea><br/>
+                                   <input type="submit" 
value="{php:function('lang', 'Add comment')}" />
+                               </form>
+                       </dd>
         </dl>
-        <dl class="proplist-col">
-            <dt><xsl:value-of select="php:function('lang', 'Created')" /></dt>
-            <dd><xsl:value-of select="php:function('pretty_timestamp', 
application/created)"/></dd>
-        </dl>
-        <dl class="proplist-col">
-            <dt><xsl:value-of select="php:function('lang', 'Modified')" /></dt>
-            <dd><xsl:value-of select="php:function('pretty_timestamp', 
application/modified)"/></dd>
-        </dl>
 
                <dl class="proplist">
             <dt class="heading">1. <xsl:value-of select="php:function('lang', 
'History and comments (%1)', count(application/comments/author))" /></dt>
@@ -220,17 +238,6 @@
                        </dl>
                </xsl:if>
 
-        <dl class="proplist">
-            <dt class="heading"><xsl:value-of select="php:function('lang', 
'Add a comment')" /></dt>
-                       <dd>
-                               <form method="POST">
-                                       <textarea name="comment" style="width: 
60%; height: 7em"></textarea><br/>
-                                   <input type="submit" 
value="{php:function('lang', 'Add comment')}" />
-                               </form>
-                       </dd>
-        </dl>
-
-
                <xsl:if test="application/edit_link">
                        <dl class="proplist">
                                <dt class="heading"><xsl:value-of 
select="php:function('lang', 'Actions')" /></dt>

Copied: branches/Version-1_0-branch/booking/templates/base/booking_info.xsl 
(from rev 6600, trunk/booking/templates/base/booking_info.xsl)
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/booking_info.xsl         
                (rev 0)
+++ branches/Version-1_0-branch/booking/templates/base/booking_info.xsl 
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,25 @@
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+       <div class="close"><a onclick="YAHOO.booking.closeOverlay(); return 
false" href=""><xsl:value-of select="php:function('lang', 'Close')"/></a></div>
+       <h3><xsl:value-of select="php:function('lang', 'Booking')"/> 
#<xsl:value-of select="booking/id"/></h3>
+       <dl>
+               <dt><xsl:value-of select="php:function('lang', 
'Activity')"/></dt>
+               <dd><xsl:value-of select="booking/activity_name"/></dd>
+               <dt><xsl:value-of select="php:function('lang', 'Where')"/></dt>
+               <dd>
+                       <a href="{booking/building_link}"><xsl:value-of 
select="booking/resources[position()=1]/building_name"/></a>
+                       (<xsl:value-of select="booking/resource_info"/>)
+               </dd>
+               <dt><xsl:value-of select="php:function('lang', 'When')"/></dt>
+               <dd><xsl:value-of select="booking/when"/></dd>
+               <dt><xsl:value-of select="php:function('lang', 'Who')"/></dt>
+               <dd>
+                       <a href="{booking/org_link}"><xsl:value-of 
select="booking/group/organization_name"/></a>:
+                       <a href="{booking/group_link}"><xsl:value-of 
select="booking/group/name"/></a>
+               </dd>
+       </dl>
+       <xsl:if test="booking/edit_link">
+               <div class="actions">
+                       <button 
onclick="location.href='{booking/edit_link}'"><xsl:value-of 
select="php:function('lang', 'Edit booking')"/></button>
+               </div>
+       </xsl:if>
+</xsl:template>

Modified: branches/Version-1_0-branch/booking/templates/base/booking_new.xsl
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/booking_new.xsl  
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/templates/base/booking_new.xsl  
2010-11-16 13:02:23 UTC (rev 6601)
@@ -81,6 +81,64 @@
             </dd>
                                <dt><label for="field_cost"><xsl:value-of 
select="php:function('lang', 'Cost')" /></label></dt>
             <dd><input id="field_cost" name="cost" type="text" 
value="{booking/cost}"/></dd>
+
+                       <dt><label for="field_repeat_until"><xsl:value-of 
select="php:function('lang', 'Recurring booking')" /></label></dt>
+                       <dd>
+                               <label>
+                                       <input type="checkbox" name="outseason" 
id="outseason">
+                                               <xsl:if test="outseason='on'">
+                                                       <xsl:attribute 
name="checked">checked</xsl:attribute>
+                                               </xsl:if>
+                                       </input>
+                                       <xsl:value-of 
select="php:function('lang', 'Out season')" />
+                               </label>
+                       </dd>
+                       <dd>
+                               <label>
+                                       <input type="checkbox" name="recurring" 
id="recurring">
+                                               <xsl:if test="recurring='on'">
+                                                       <xsl:attribute 
name="checked">checked</xsl:attribute>
+                                               </xsl:if>
+                                       </input>
+                                       <xsl:value-of 
select="php:function('lang', 'Repeat until')" />
+                               </label>
+                       </dd>
+                       <dd class="date-picker">
+                               <input id="field_repeat_until" 
name="repeat_until" type="text">
+                                       <xsl:attribute 
name="value"><xsl:value-of select="repeat_until"/></xsl:attribute>
+                               </input>
+                       </dd>
+                       <dt><xsl:value-of select="php:function('lang', 
'Interval')" /></dt>
+                       <dd>
+                               <xsl:value-of select="../field_interval" />
+                               <select id="field_interval" 
name="field_interval">
+                                       <option value="1">
+                                               <xsl:if test="interval=1">
+                                                       <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                               </xsl:if>
+                                               <xsl:value-of 
select="php:function('lang', '1 week')" />
+                                       </option>
+                                       <option value="2">
+                                               <xsl:if test="interval=2">
+                                                       <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                               </xsl:if>
+                                               <xsl:value-of 
select="php:function('lang', '2 weeks')" />
+                                       </option>
+                                       <option value="3">
+                                               <xsl:if test="interval=3">
+                                                       <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                               </xsl:if>
+                                               <xsl:value-of 
select="php:function('lang', '3 weeks')" />
+                                       </option>
+                                       <option value="4">
+                                               <xsl:if test="interval=4">
+                                                       <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                               </xsl:if>
+                                               <xsl:value-of 
select="php:function('lang', '4 weeks')" />
+                                       </option>
+                               </select>
+                       </dd>
+
         </dl>
                <dl class="form-col">
                        <dt><label for="field_from"><xsl:value-of 
select="php:function('lang', 'Target audience')" /></label></dt>

Copied: 
branches/Version-1_0-branch/booking/templates/base/booking_new_preview.xsl 
(from rev 6600, trunk/booking/templates/base/booking_new_preview.xsl)
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/booking_new_preview.xsl  
                        (rev 0)
+++ branches/Version-1_0-branch/booking/templates/base/booking_new_preview.xsl  
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,86 @@
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+    <div id="content">
+
+       <dl class="form">
+       <dt class="heading"><xsl:value-of select="php:function('lang', 'New 
Booking')"/></dt>
+       </dl>
+    <xsl:call-template name="msgbox"/>
+       <xsl:call-template name="yui_booking_i18n"/>
+
+       <!-- <xsl:call-template name="xmlsource"/> -->
+
+           <form action="" method="POST">
+                       <input type="hidden" name="season_id" 
value="{booking/season_id}"/>
+                       <input type="hidden" name="field_building_id" 
value="{booking/building_id}"/>
+                       <input type="hidden" name="allocation_id" 
value="{booking/allocation_id}"/>
+                       <input type="hidden" name="step" value="{step}" />
+                       <input type="hidden" name="from_" value="{from_date}" />
+                       <input type="hidden" name="to_" value="{to_date}" />
+                       <input type="hidden" name="repeat_until" 
value="{repeat_until}" />
+                       <input type="hidden" name="field_interval" 
value="{interval}" />
+                       <input type="hidden" name="recurring" 
value="{recurring}" />
+                       <input type="hidden" name="outseason" 
value="{outseason}" />
+                       <input type="hidden" name="activity_id" 
value="{booking/activity_id}" />
+                       <input type="hidden" name="group_id" 
value="{booking/group_id}" />
+                       <xsl:for-each select="booking/audience">
+                               <input type="hidden" name="audience[]" 
value="{.}" />
+                       </xsl:for-each>
+                       <xsl:for-each select="booking/resources">
+                               <input type="hidden" name="resources[]" 
value="{.}" />
+                       </xsl:for-each>
+                       <xsl:for-each select="booking/agegroups">
+                               <xsl:variable name="id"><xsl:value-of 
select="id"/></xsl:variable>
+                               <input type="hidden">
+                                       <xsl:attribute 
name="name">male[<xsl:value-of select="agegroup_id"/>]</xsl:attribute>
+                                       <xsl:attribute 
name="value"><xsl:value-of select="male"/></xsl:attribute>
+                               </input>
+                               <input type="hidden">
+                                       <xsl:attribute 
name="name">female[<xsl:value-of select="agegroup_id"/>]</xsl:attribute>
+                                       <xsl:attribute 
name="value"><xsl:value-of select="female"/></xsl:attribute>
+                               </input>
+                       </xsl:for-each>
+
+
+                       <h4><xsl:value-of select="php:function('lang', 
'Bookings that can be created')" /></h4>
+                       <div class="allocation-list">
+                               <xsl:for-each select="valid_dates">
+                                       <li>
+                                               <xsl:value-of select="from_"/> 
- <xsl:value-of select="to_"/>
+                                       </li>
+                               </xsl:for-each>
+                       </div>
+
+                       <h4><xsl:value-of select="php:function('lang', 
'Allocations colliding with existing bookings or allocations (%1)', 
count(result/invalid[from_]))" /></h4>
+                       <div class="allocation-list">
+                               <xsl:for-each select="invalid_dates">
+                                       <li>
+                                               <xsl:value-of select="from_"/> 
- <xsl:value-of select="to_"/>
+                                       </li>
+                               </xsl:for-each>
+                       </div>
+               <div class="form-buttons">
+                   <input type="submit" name="create">
+                               <xsl:attribute name="value"><xsl:value-of 
select="php:function('lang', 'Create')" /></xsl:attribute>
+                               </input>
+                   <a class="cancel">
+                       <xsl:attribute name="href"><xsl:value-of 
select="season/wtemplate_link"/></xsl:attribute>
+                       <xsl:value-of select="php:function('lang', 'Cancel')" />
+                   </a>
+               </div>
+               </form>
+
+    </div>
+    <script type="text/javascript">
+        YAHOO.booking.season_id = '<xsl:value-of select="booking/season_id"/>';
+        YAHOO.booking.group_id = '<xsl:value-of select="booking/group_id"/>';
+        YAHOO.booking.initialSelection = <xsl:value-of 
select="booking/resources_json"/>;
+               var lang = <xsl:value-of select="php:function('js_lang', 
'Resource Type')"/>;
+    </script>
+</xsl:template>
+<xsl:template name="xmlsource">
+  NODE <xsl:value-of select="name()"/>
+  ATTR { <xsl:for-each select="attribute::*"><xsl:value-of 
select="name()"/>=<xsl:value-of select="."/> </xsl:for-each> }
+  CHILDREN: { <xsl:for-each select="*"><xsl:call-template 
name="xmlsource"/></xsl:for-each> }
+  TEXT <xsl:value-of select="text()"/>
+  <br/>
+</xsl:template>

Modified: branches/Version-1_0-branch/booking/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/css/base.css     
2010-11-16 11:54:43 UTC (rev 6600)
+++ branches/Version-1_0-branch/booking/templates/base/css/base.css     
2010-11-16 13:02:23 UTC (rev 6601)
@@ -287,3 +287,11 @@
     background-position: 100% 0%;
 }
 
+#overlay-info { text-align: left; padding: 1em; }
+#overlay-info h3 { margin: 0 0 .9em 0; }
+#overlay-info dt { font-style: italic; font-weight: bolder; font-size: 90%;}
+#overlay-info dd { padding-left: 2em; }
+#overlay-info .close { float: right; }
+#overlay-info .actions { margin-top: 1em;}
+
+

Copied: 
branches/Version-1_0-branch/booking/templates/base/massbooking_schedule.xsl 
(from rev 6600, trunk/booking/templates/base/massbooking_schedule.xsl)
===================================================================
--- branches/Version-1_0-branch/booking/templates/base/massbooking_schedule.xsl 
                        (rev 0)
+++ branches/Version-1_0-branch/booking/templates/base/massbooking_schedule.xsl 
2010-11-16 13:02:23 UTC (rev 6601)
@@ -0,0 +1,56 @@
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+       <xsl:call-template name="yui_booking_i18n"/>
+       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
+       <input id="yui-history-field" type="hidden"/>
+       
+    <div id="content">
+        <ul class="pathway">
+            <li>
+                <a>
+                    <xsl:attribute name="href"><xsl:value-of 
select="building/buildings_link"/></xsl:attribute>
+                    <xsl:value-of select="php:function('lang', 'Buildings')"/>
+                </a>
+            </li>
+            <li>
+                <a>
+                    <xsl:attribute name="href"><xsl:value-of 
select="building/building_link"/></xsl:attribute>
+                    <xsl:value-of select="building/name"/>
+                </a>
+            </li>
+            <li><xsl:value-of select="php:function('lang', 'Schedule')"/></li>
+        </ul>
+
+        <xsl:call-template name="msgbox"/>
+               <ul id="week-selector">
+                       <li><a href="#" onclick="YAHOO.booking.prevWeek(); 
return false"><xsl:value-of select="php:function('lang', 'Previous 
week')"/></a></li>
+                       <li id="cal_container"/>
+                       <li><a href="#" onclick="YAHOO.booking.nextWeek(); 
return false"><xsl:value-of select="php:function('lang', 'Next 
week')"/></a></li>
+               </ul>
+
+        <div id="schedule_container"/>
+    </div>
+
+<script type="text/javascript">
+YAHOO.util.Event.addListener(window, "load", function() {
+       YAHOO.booking.setupWeekPicker('cal_container');
+       YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
+       YAHOO.booking.newApplicationUrl = '<xsl:value-of 
select="building/application_link"/>';
+
+    var handleHistoryNavigation = function (state) {
+               YAHOO.booking.date = parseISO8601(state);
+               YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.frontendScheduleColorFormatter, true);
+    };
+    var initialRequest = YAHOO.util.History.getBookmarkedState("date") || 
'<xsl:value-of select="building/date"/>';
+    YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
+    YAHOO.util.History.onReady(function() {
+               var state = YAHOO.util.History.getBookmarkedState("date") || 
initialRequest;
+               if(state)
+                       handleHistoryNavigation(state);
+    });
+       YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");       
+});
+<xsl:if test="backend = 'true'">
+       YAHOO.util.Dom.setStyle(('header'), 'display', 'none');
+</xsl:if>
+</script>
+</xsl:template>




reply via email to

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