fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14662] more on booking


From: Sigurd Nes
Subject: [Fmsystem-commits] [14662] more on booking
Date: Tue, 19 Jan 2016 14:35:30 +0000

Revision: 14662
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14662
Author:   sigurdne
Date:     2016-01-19 14:35:29 +0000 (Tue, 19 Jan 2016)
Log Message:
-----------
more on booking

Modified Paths:
--------------
    branches/dev-syncromind/activitycalendar/setup/setup.inc.php
    branches/dev-syncromind/activitycalendarfrontend/setup/setup.inc.php
    branches/dev-syncromind/booking/inc/class.sobuilding.inc.php
    branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
    branches/dev-syncromind/booking/inc/class.uibuilding.inc.php
    branches/dev-syncromind/booking/setup/setup.inc.php
    branches/dev-syncromind/booking/setup/tables_current.inc.php
    branches/dev-syncromind/booking/setup/tables_update.inc.php
    branches/dev-syncromind/booking/templates/base/building.xsl
    branches/dev-syncromind/booking/templates/base/building_form.xsl
    branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js
    branches/dev-syncromind/bookingfrontend/setup/setup.inc.php
    branches/dev-syncromind/bookingfrontend/templates/base/search.xsl
    branches/dev-syncromind/bookingfrontend/templates/base/search_details.xsl

Modified: branches/dev-syncromind/activitycalendar/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind/activitycalendar/setup/setup.inc.php        
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/activitycalendar/setup/setup.inc.php        
2016-01-19 14:35:29 UTC (rev 14662)
@@ -30,7 +30,7 @@
 
        $setup_info['activitycalendar']['depends'][] = array(
                'appname' => 'booking',
-               'versions' => 
array('0.2.20','0.2.21','0.2.22','0.2.23','0.2.24','0.2.25')
+               'versions' => 
array('0.2.20','0.2.21','0.2.22','0.2.23','0.2.24','0.2.25','0.2.26')
        );
 
        $setup_info['activitycalendar']['depends'][] = array(

Modified: branches/dev-syncromind/activitycalendarfrontend/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind/activitycalendarfrontend/setup/setup.inc.php        
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/activitycalendarfrontend/setup/setup.inc.php        
2016-01-19 14:35:29 UTC (rev 14662)
@@ -22,7 +22,7 @@
 
 $setup_info['activitycalendarfrontend']['depends'][] = array(
     'appname' => 'booking',
-       'versions' => 
array('0.2.20','0.2.21','0.2.22','0.2.23','0.2.24','0.2.25')
+       'versions' => 
array('0.2.20','0.2.21','0.2.22','0.2.23','0.2.24','0.2.25','0.2.26')
 );
 
 $setup_info['activitycalendarfrontend']['depends'][] = array(

Modified: branches/dev-syncromind/booking/inc/class.sobuilding.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.sobuilding.inc.php        
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/inc/class.sobuilding.inc.php        
2016-01-19 14:35:29 UTC (rev 14662)
@@ -25,6 +25,7 @@
                                'deactivate_sendmessage' => array('type' => 
'int'),
                                'extra_kalendar'                 => 
array('type' => 'int'),
                                'location_code'                  => 
array('type' => 'string', 'required' => false),
+                               'activity_id'                   => array('type' 
=> 'int', 'required' => false),
                                'part_of_town_id'                => 
array('type'                 => 'string',
                                        'required'       => false,
                                        'join'           => array(
@@ -37,7 +38,14 @@
                                'zip_code'                               => 
array('type' => 'string'),
                                'district'                               => 
array('type' => 'string', 'query' => true),
                                'city'                                   => 
array('type' => 'string', 'query' => true),
-                               'active'                                 => 
array('type' => 'int')
+                               'active'                                 => 
array('type' => 'int'),
+                               'activity_name'          => array('type'        
 => 'string', 'query'    => true,
+                                       'join'   => array(
+                                               'table'  => 'bb_activity',
+                                               'fkey'   => 'activity_id',
+                                               'key'    => 'id',
+                                               'column' => 'name'
+                                       ))
                        )
                        );
                }

Modified: branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uiapplication.inc.php     
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/inc/class.uiapplication.inc.php     
2016-01-19 14:35:29 UTC (rev 14662)
@@ -815,6 +815,12 @@
 
                                array_set_default($application, 'resources', 
$resources);
                        }
+                       if(!$activity_id)
+                       {
+                               $_building = 
$this->building_bo->so->read_single(phpgw::get_var('building_id', 'int'));
+                               $activity_id     = $_building['activity_id'];
+                       }
+
                        array_set_default($application, 'building_id', 
phpgw::get_var('building_id', 'int'));
 
                        array_set_default($application, 'building_name', 
phpgw::get_var('building_name', 'string'));

Modified: branches/dev-syncromind/booking/inc/class.uibuilding.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uibuilding.inc.php        
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/inc/class.uibuilding.inc.php        
2016-01-19 14:35:29 UTC (rev 14662)
@@ -31,6 +31,7 @@
 
                        $this->bo                        = 
CreateObject('booking.bobuilding');
                        $this->bo_booking        = 
CreateObject('booking.bobooking');
+                       $this->activity_bo       = 
CreateObject('booking.boactivity');
                        self::set_active_menu('booking::buildings');
                        $this->fields            = array
                                (
@@ -56,6 +57,7 @@
                                'deactivate_sendmessage' => 'int',
                                'extra_kalendar'                 => 'string',
                                'calendar_text'                  => 'string',
+                               'activity_id'            => 'int',
                        );
                        $this->module            = "booking";
                }
@@ -103,6 +105,7 @@
                        }
 
                        $data = array(
+                               'datatable_name' => lang('building'),
                                'form'           => array(
                                        'toolbar' => array(
                                                'item' => array(
@@ -124,6 +127,10 @@
                                                        'formatter'      => 
'JqueryPortico.formatLink'
                                                ),
                                                array(
+                                                       'key'    => 
'activity_name',
+                                                       'label'  => 
lang('Activity')
+                                               ),
+                                               array(
                                                        'key'    => 'street',
                                                        'label'  => 
lang('Street'),
                                                ),
@@ -199,6 +206,7 @@
                        $this->flash_form_errors($errors);
                        $building['buildings_link']      = 
self::link(array('menuaction' => 'booking.uibuilding.index'));
                        $building['cancel_link']         = 
self::link(array('menuaction' => 'booking.uibuilding.index'));
+                       $activity_data                   = 
$this->activity_bo->get_top_level();
 
                        phpgwapi_jquery::load_widget('autocomplete');
                        phpgwapi_jquery::init_ckeditor('field_description');
@@ -211,7 +219,7 @@
                        $building['validator']   = 
phpgwapi_jquery::formvalidator_generate(array('location',
                                'date', 'security', 'file'));
 
-                       self::render_template_xsl('building_form', 
array('building' => $building, 'new_form' => true));
+                       self::render_template_xsl('building_form', 
array('building' => $building, 'activitydata' => $activity_data, 'new_form' => 
true));
                }
 
                public function edit()
@@ -247,6 +255,12 @@
                                        $this->redirect(array('menuaction' => 
'booking.uibuilding.show', 'id' => $receipt['id']));
                                }
                        }
+                       $activity_data                   = 
$this->activity_bo->get_top_level();
+                       foreach($activity_data as $acKey => $acValue)
+                       {
+                               $activity_data[$acKey]['activity_id'] = 
$building['activity_id'];
+                       }
+
                        $this->flash_form_errors($errors);
 
                        phpgwapi_jquery::load_widget('autocomplete');
@@ -260,7 +274,7 @@
                        $building['validator']   = 
phpgwapi_jquery::formvalidator_generate(array('location',
                                'date', 'security', 'file'));
 
-                       self::render_template_xsl('building_form', 
array('building' => $building));
+                       self::render_template_xsl('building_form', 
array('building' => $building, 'activitydata' => $activity_data));
                }
 
                public function show()

Modified: branches/dev-syncromind/booking/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind/booking/setup/setup.inc.php 2016-01-18 14:29:13 UTC 
(rev 14661)
+++ branches/dev-syncromind/booking/setup/setup.inc.php 2016-01-19 14:35:29 UTC 
(rev 14662)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['booking']['name'] = 'booking';
-       $setup_info['booking']['version'] = '0.2.25';
+       $setup_info['booking']['version'] = '0.2.26';
        $setup_info['booking']['app_order'] = 9;
        $setup_info['booking']['enable'] = 1;
        $setup_info['booking']['app_group'] = 'office';

Modified: branches/dev-syncromind/booking/setup/tables_current.inc.php
===================================================================
--- branches/dev-syncromind/booking/setup/tables_current.inc.php        
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/setup/tables_current.inc.php        
2016-01-19 14:35:29 UTC (rev 14662)
@@ -19,6 +19,7 @@
                        'fd' => array(
                                'id' => array('type' => 'auto', 'nullable' => 
false),
                                'active' => array('type' => 'int', 'nullable' 
=> False,'precision' => '4', 'default' => 1),
+                               'activity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'deactivate_calendar' => array('type' => 'int', 
'nullable' => False,'precision' => '4', 'default' => 0),
                                'deactivate_application' => array('type' => 
'int', 'nullable' => False,'precision' => '4', 'default' => 0),
                                'deactivate_sendmessage' => array('type' => 
'int', 'nullable' => False,'precision' => '4', 'default' => 0),

Modified: branches/dev-syncromind/booking/setup/tables_update.inc.php
===================================================================
--- branches/dev-syncromind/booking/setup/tables_update.inc.php 2016-01-18 
14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/setup/tables_update.inc.php 2016-01-19 
14:35:29 UTC (rev 14662)
@@ -3387,3 +3387,63 @@
                }
        }
 
+       $test[] = '0.2.25';
+       /**
+        * Update booking version from 0.2.25 to 0.2.26
+        *
+        */
+       function booking_upgrade0_2_25()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('bb_building','activity_id', 
array('type' => 'int', 'precision' => 4,'nullable' => true));
+               $soactivity = createObject('booking.soactivity');
+
+               $sql = "SELECT id FROM bb_activity WHERE parent_id = 0 OR 
parent_id IS NULL ORDER BY id";
+
+               $GLOBALS['phpgw_setup']->oProc->query($sql, __LINE__, __FILE__);
+               $top_levels = array();
+
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $top_levels[] = $GLOBALS['phpgw_setup']->oProc->f('id');
+               }
+
+               $activities = 
array_merge(array($top_levels[0]),$soactivity->get_children($top_levels[0]));
+
+               if($activities)
+               {
+                       $sql = "SELECT building_id FROM bb_resource WHERE 
activity_id IN (" . implode(',', $activities) . ')';
+                       
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+                       $buildings = array();
+                       while ($GLOBALS['phpgw_setup']->oProc->next_record())
+                       {
+                               $buildings[] = 
$GLOBALS['phpgw_setup']->oProc->f('building_id');
+                       }
+
+                       if($buildings)
+                       {
+                               $sql = "UPDATE bb_building SET activity_id = 1 
WHERE id IN (" . implode(',', $buildings) . ')';
+                               
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+                               if(isset($top_levels[1]))
+                               {
+                                       $sql = "UPDATE bb_building SET 
activity_id = {$top_levels[1]} WHERE activity_id IS NULL";
+                                       
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
+                               }
+
+                               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('bb_building','activity_id',array(
+                                               'type' => 'int',
+                                               'precision' => 4,
+                                               'nullable' => false
+                                       )
+                               );
+
+                       }
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['booking']['currentver'] = 
'0.2.26';
+                       return $GLOBALS['setup_info']['booking']['currentver'];
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind/booking/templates/base/building.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/building.xsl 2016-01-18 
14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/templates/base/building.xsl 2016-01-19 
14:35:29 UTC (rev 14662)
@@ -15,6 +15,14 @@
                                </div>
                                <div class="pure-control-group">
                                        <label>
+                                               <xsl:value-of 
select="php:function('lang', 'Activity')" />
+                                       </label>
+                                       <span>
+                                               <xsl:value-of 
select="building/activity_name"/>
+                                       </span>
+                               </div>
+                               <div class="pure-control-group">
+                                       <label>
                                                <xsl:value-of 
select="php:function('lang', 'Street')" />
                                        </label>
                                        <xsl:value-of select="building/street"/>

Modified: branches/dev-syncromind/booking/templates/base/building_form.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/building_form.xsl    
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/booking/templates/base/building_form.xsl    
2016-01-19 14:35:29 UTC (rev 14662)
@@ -19,6 +19,24 @@
                                        </input>
                                </div>
                                <div class="pure-control-group">
+                                       <label>
+                                               <xsl:value-of 
select="php:function('lang', 'Activity')" />
+                                       </label>
+                                       <select id="field_activity_id" 
name="activity_id">
+                                               <option value="">
+                                                       <xsl:value-of 
select="php:function('lang', 'select')" />
+                                               </option>
+                                               <xsl:for-each 
select="activitydata">
+                                                       <option value="{id}">
+                                                               <xsl:if 
test="activity_id=id">
+                                                                       
<xsl:attribute name="selected">selected</xsl:attribute>
+                                                               </xsl:if>
+                                                               <xsl:value-of 
select="name" />
+                                                       </option>
+                                               </xsl:for-each>
+                                       </select>
+                               </div>
+                               <div class="pure-control-group">
                                        <label for="field_phone">
                                                <xsl:value-of 
select="php:function('lang', 'Telephone')" />
                                        </label>

Modified: branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js
===================================================================
--- branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js        
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js        
2016-01-19 14:35:29 UTC (rev 14662)
@@ -199,8 +199,9 @@
                                {
                                        $("#loading").dialog('close');
 //                         $('#loading').html("<p>Result Complete...</p>");
-                                       $("#no_result").html('');
+                                       $("#no_result").hide();
                                        $("#result").html(data);
+                                       
$("#total_records_top").html($("#total_records").html());
                                }
                        }
                });

Modified: branches/dev-syncromind/bookingfrontend/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind/bookingfrontend/setup/setup.inc.php 2016-01-18 
14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/bookingfrontend/setup/setup.inc.php 2016-01-19 
14:35:29 UTC (rev 14662)
@@ -21,7 +21,7 @@
 
        $setup_info['bookingfrontend']['depends'][] = array(
                'appname' => 'booking',
-               'versions' => 
array('0.2.20','0.2.21','0.2.22','0.2.23','0.2.24','0.2.25')
+               'versions' => 
array('0.2.20','0.2.21','0.2.22','0.2.23','0.2.24','0.2.25','0.2.26')
        );
 
        $setup_info['bookingfrontend']['depends'][] = array(

Modified: branches/dev-syncromind/bookingfrontend/templates/base/search.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/search.xsl   
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/bookingfrontend/templates/base/search.xsl   
2016-01-19 14:35:29 UTC (rev 14662)
@@ -16,150 +16,153 @@
                        <!--input type="hidden" id="activity_top_level" 
name="activity_top_level" value="{activity_top_level}" /-->
                </form>
                <div class="pure-g">
-                       <div class="pure-u-1 pure-u-lg-1-3">
-                               <div class="heading">
-                                       <xsl:value-of 
select="php:function('lang', 'type')" />
-                               </div>
-                               <ul id="search_type">
-                                       <li>
-                                               <label>
-                                                       <input type="checkbox" 
name="search_type[]" value="building" checked="checked="/>
-                                                       <xsl:value-of 
select="php:function('lang', 'building')" />
-                                               </label>
-                                       </li>
-                                       <li>
-                                               <label>
-                                                       <input type="checkbox" 
name="search_type[]" value="resource" checked="checked="/>
-                                                       <xsl:value-of 
select="php:function('lang', 'resource')" />
-                                               </label>
-                                       </li>
-                                       <!--li>
-                                               <label>
-                                                       <input type="checkbox" 
name="search_type[]" value="organization"/>
-                                                       <xsl:value-of 
select="php:function('lang', 'organization')" />
-                                               </label>
-                                       </li>
-                                       <li>
-                                               <label>
-                                                       <input type="checkbox" 
name="search_type[]" value="event"/>
-                                                       <xsl:value-of 
select="php:function('lang', 'event')" />
-                                               </label>
-                                       </li-->
-                               </ul>
-                       </div>
-                       <div class="pure-u-1 pure-u-lg-1-3">
-                               <div class="heading">
-                                       <xsl:value-of 
select="php:function('lang', 'Activity')" />
-                               </div>
-                               <ul id="top_level">
-                                       <xsl:for-each select="top_levels">
+                       <div class="pure-u-1 pure-u-lg-1-2">
+                               
+                               <div id = "total_records_top"></div>
+                               <div class="pure-u-1">
+                                       <div class="heading">
+                                               <xsl:value-of 
select="php:function('lang', 'type')" />
+                                       </div>
+                                       <ul id="search_type">
                                                <li>
                                                        <label>
-                                                               <input 
type="checkbox" name="top_levels[]">
-                                                                       
<xsl:attribute name="value">
-                                                                               
<xsl:value-of select="id"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="id">
-                                                                               
<xsl:value-of select="location"/>
-                                                                       
</xsl:attribute>
-                                                                       <xsl:if 
test="checked = 1">
-                                                                               
<xsl:attribute name="checked">
-                                                                               
        <xsl:text>checked</xsl:text>
-                                                                               
</xsl:attribute>
-                                                                       
</xsl:if>
-                                                               </input>
-                                                               <xsl:value-of 
select="name"/>
+                                                               <input 
type="checkbox" name="search_type[]" value="building" checked="checked="/>
+                                                               <xsl:value-of 
select="php:function('lang', 'building')" />
                                                        </label>
                                                </li>
-                                       </xsl:for-each>
-                               </ul>
-                       </div>
-
-                       <div class="pure-u-1 pure-u-lg-1-3" id="activity_tree">
-                               <div class="heading">
-                                       <xsl:value-of 
select="php:function('lang', 'Resource')" />
-                               </div>
-                               <fieldset>
-                                       <!-- Some style for the expand/contract 
section-->
-                                       <style>
-                                               #expandcontractdiv {border:1px 
dotted #dedede; margin:0 0 .5em 0; padding:0.4em;}
-                                               #treeDiv1 { background: #fff; 
padding:1em; margin-top:1em; }
-                                               .no_checkbox>i.jstree-checkbox{ 
display:none}
-                                       </style>
-                                       <script type="text/javascript">
-                                               filter_tree = <xsl:value-of 
select="filter_tree"/>;
-                                       </script>
-                                       <!-- markup for expand/contract links 
-->
-                                       <div id="treecontrol">
-                                               <a id="collapse1" 
title="Collapse the entire tree below" href="#">
-                                                       <xsl:value-of 
select="php:function('lang', 'collapse all')"/>
-                                               </a>
-                                               <xsl:text> | </xsl:text>
-                                               <a id="expand1" title="Expand 
the entire tree below" href="#">
-                                                       <xsl:value-of 
select="php:function('lang', 'expand all')"/>
-                                               </a>
-                                       </div>
-                                       <div id="treeDiv1"></div>
-                               </fieldset>
-                       </div>
-                       <div class="pure-u-1 pure-u-lg-1-3">
-                               <div class="heading">
-                                       <xsl:value-of 
select="php:function('lang', 'part of town')" />
-                               </div>
-                               <ul id="part_of_town">
-                                       <xsl:for-each select="part_of_towns">
                                                <li>
                                                        <label>
-                                                               <input 
type="checkbox" name="part_of_town[]">
-                                                                       
<xsl:attribute name="value">
-                                                                               
<xsl:value-of select="id"/>
-                                                                       
</xsl:attribute>
-                                                                       <xsl:if 
test="checked = 1">
-                                                                               
<xsl:attribute name="checked">
-                                                                               
        <xsl:text>checked</xsl:text>
-                                                                               
</xsl:attribute>
-                                                                       
</xsl:if>
-                                                               </input>
-                                                               <xsl:value-of 
select="name"/>
+                                                               <input 
type="checkbox" name="search_type[]" value="resource" checked="checked="/>
+                                                               <xsl:value-of 
select="php:function('lang', 'resource')" />
                                                        </label>
                                                </li>
-                                       </xsl:for-each>
-                               </ul>
-                       </div>
-                       <div class="pure-u-1 pure-u-lg-1-3">
-                               <div class="heading">
-                                       <xsl:value-of 
select="php:function('lang', 'building')" />
+                                               <!--li>
+                                                       <label>
+                                                               <input 
type="checkbox" name="search_type[]" value="organization"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'organization')" />
+                                                       </label>
+                                               </li>
+                                               <li>
+                                                       <label>
+                                                               <input 
type="checkbox" name="search_type[]" value="event"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'event')" />
+                                                       </label>
+                                               </li-->
+                                       </ul>
                                </div>
-                               <div id="building_container">
-                                       <input id="field_building_id" 
name="building_id" type="hidden">
-                                               <xsl:attribute name="value">
-                                                       <xsl:value-of 
select="building_id"/>
-                                               </xsl:attribute>
-                                       </input>
-                                       <input id="field_building_name" 
name="building_name" type="text">
-                                               <xsl:attribute name="value">
-                                                       <xsl:value-of 
select="building_name"/>
-                                               </xsl:attribute>
-                                               <xsl:attribute 
name="placeholder">
-                                                       <xsl:text> Søk 
bygning</xsl:text>
-                                               </xsl:attribute>
+                               <div class="pure-u-1">
+                                       <div class="heading">
+                                               <xsl:value-of 
select="php:function('lang', 'Activity')" />
+                                       </div>
+                                       <ul id="top_level">
+                                               <xsl:for-each 
select="top_levels">
+                                                       <li>
+                                                               <label>
+                                                                       <input 
type="checkbox" name="top_levels[]">
+                                                                               
<xsl:attribute name="value">
+                                                                               
        <xsl:value-of select="id"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:attribute name="id">
+                                                                               
        <xsl:value-of select="location"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:if test="checked = 1">
+                                                                               
        <xsl:attribute name="checked">
+                                                                               
                <xsl:text>checked</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                                       
<xsl:value-of select="name"/>
+                                                               </label>
+                                                       </li>
+                                               </xsl:for-each>
+                                       </ul>
+                               </div>
 
-                                       </input>
-                                       <xsl:text> </xsl:text>
-                                       <a id="reset" title="Reset" href="#">
-                                               <xsl:value-of 
select="php:function('lang', 'reset')"/>
-                                       </a>
-
+                               <div class="pure-u-1" id="activity_tree">
+                                       <div class="heading">
+                                               <xsl:value-of 
select="php:function('lang', 'Resource')" />
+                                       </div>
+                                       <fieldset>
+                                               <!-- Some style for the 
expand/contract section-->
+                                               <style>
+                                                       #expandcontractdiv 
{border:1px dotted #dedede; margin:0 0 .5em 0; padding:0.4em;}
+                                                       #treeDiv1 { background: 
#fff; padding:1em; margin-top:1em; }
+                                                       
.no_checkbox>i.jstree-checkbox{ display:none}
+                                               </style>
+                                               <script type="text/javascript">
+                                                       filter_tree = 
<xsl:value-of select="filter_tree"/>;
+                                               </script>
+                                               <!-- markup for expand/contract 
links -->
+                                               <div id="treecontrol">
+                                                       <a id="collapse1" 
title="Collapse the entire tree below" href="#">
+                                                               <xsl:value-of 
select="php:function('lang', 'collapse all')"/>
+                                                       </a>
+                                                       <xsl:text> | </xsl:text>
+                                                       <a id="expand1" 
title="Expand the entire tree below" href="#">
+                                                               <xsl:value-of 
select="php:function('lang', 'expand all')"/>
+                                                       </a>
+                                               </div>
+                                               <div id="treeDiv1"></div>
+                                       </fieldset>
                                </div>
-                               <div class="hint">
-                                       F.eks. "<i>Haukelandshallen</i>", 
"<i>Nordnes bydelshus</i>".
+                               <div class="pure-u-1">
+                                       <div class="heading">
+                                               <xsl:value-of 
select="php:function('lang', 'part of town')" />
+                                       </div>
+                                       <ul id="part_of_town">
+                                               <xsl:for-each 
select="part_of_towns">
+                                                       <li>
+                                                               <label>
+                                                                       <input 
type="checkbox" name="part_of_town[]">
+                                                                               
<xsl:attribute name="value">
+                                                                               
        <xsl:value-of select="id"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:if test="checked = 1">
+                                                                               
        <xsl:attribute name="checked">
+                                                                               
                <xsl:text>checked</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                                       
<xsl:value-of select="name"/>
+                                                               </label>
+                                                       </li>
+                                               </xsl:for-each>
+                                       </ul>
                                </div>
+                               <div class="pure-u-1">
+                                       <div class="heading">
+                                               <xsl:value-of 
select="php:function('lang', 'building')" />
+                                       </div>
+                                       <div id="building_container">
+                                               <input id="field_building_id" 
name="building_id" type="hidden">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="building_id"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                               <input id="field_building_name" 
name="building_name" type="text">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="building_name"/>
+                                                       </xsl:attribute>
+                                                       <xsl:attribute 
name="placeholder">
+                                                               <xsl:text> Søk 
bygning</xsl:text>
+                                                       </xsl:attribute>
 
-                       </div>
-                       <div class="pure-u-1 pure-u-lg-1-3">
-                               <div class="heading">
-                                       <xsl:value-of 
select="php:function('lang', 'I am feeling lucky')" />
+                                               </input>
+                                               <xsl:text> </xsl:text>
+                                               <a id="reset" title="Reset" 
href="#">
+                                                       <xsl:value-of 
select="php:function('lang', 'reset')"/>
+                                               </a>
+
+                                       </div>
+                                       <div class="hint">
+                                               F.eks. 
"<i>Haukelandshallen</i>", "<i>Nordnes bydelshus</i>".
+                                       </div>
+
                                </div>
+                               <div class="pure-u-1">
+                                       <div class="heading">
+                                               <xsl:value-of 
select="php:function('lang', 'I am feeling lucky')" />
+                                       </div>
                                        <input id="field_searchterm" 
name="searchterm" type="text">
                                                <xsl:attribute name="value">
                                                        <xsl:value-of 
select="searchterm"/>
@@ -168,9 +171,13 @@
                                                        <xsl:text> 
Fritekst</xsl:text>
                                                </xsl:attribute>
                                        </input>
-                               <xsl:text> </xsl:text>
-                               <input id="submit_searchterm" type="button" 
value="{php:function('lang', 'Search')}"/>
+                                       <xsl:text> </xsl:text>
+                                       <input id="submit_searchterm" 
type="button" value="{php:function('lang', 'Search')}"/>
+                               </div>
                        </div>
+                       <div class="pure-u-1 pure-u-lg-1-2">
+                               <div id="result"></div>
+                       </div>
 
                </div>
 
@@ -190,6 +197,5 @@
                                </div>
                        </xsl:if>
                </div>
-               <div id="result"></div>
        </div>
 </xsl:template>

Modified: 
branches/dev-syncromind/bookingfrontend/templates/base/search_details.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/search_details.xsl   
2016-01-18 14:29:13 UTC (rev 14661)
+++ branches/dev-syncromind/bookingfrontend/templates/base/search_details.xsl   
2016-01-19 14:35:29 UTC (rev 14662)
@@ -16,13 +16,15 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
        <xsl:choose>
                <xsl:when test="results/total_records_sum &gt; 0">
-                       <h5>
-                               <u>
-                                       <strong>
-                                               <xsl:value-of 
select="php:function('lang', 'Found %1 results', results/total_records_sum)" />
-                                       </strong>
-                               </u>
-                       </h5>
+                       <div id = "total_records" style="display: none;">
+                               <h5>
+                                       <u>
+                                               <strong>
+                                                       <xsl:value-of 
select="php:function('lang', 'Found %1 results', results/total_records_sum)" />
+                                               </strong>
+                                       </u>
+                               </h5>
+                       </div>
                        <br />
                        <br />
                        <ol id="result">
@@ -97,13 +99,15 @@
                        </ol>
                </xsl:when>
                <xsl:otherwise>
-                       <h5>
-                               <u>
-                                       <strong>
-                                               <xsl:value-of 
select="php:function('lang', 'Found %1 results', 0)" />
-                                       </strong>
-                               </u>
-                       </h5>
+                       <div id = "total_records" style="display: none;">
+                               <h5>
+                                       <u>
+                                               <strong>
+                                                       <xsl:value-of 
select="php:function('lang', 'Found %1 results', 0)" />
+                                               </strong>
+                                       </u>
+                               </h5>
+                       </div>
 
                </xsl:otherwise>
        </xsl:choose>




reply via email to

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