fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16802] bookingfrontend: search


From: sigurdne
Subject: [Fmsystem-commits] [16802] bookingfrontend: search
Date: Tue, 30 May 2017 13:16:18 -0400 (EDT)

Revision: 16802
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16802
Author:   sigurdne
Date:     2017-05-30 13:16:18 -0400 (Tue, 30 May 2017)
Log Message:
-----------
bookingfrontend: search

Modified Paths:
--------------
    trunk/booking/inc/class.boactivity.inc.php
    trunk/booking/inc/class.soactivity.inc.php
    trunk/bookingfrontend/inc/class.bosearch.inc.php
    trunk/bookingfrontend/inc/class.uisearch.inc.php
    trunk/bookingfrontend/templates/base/search.xsl

Modified: trunk/booking/inc/class.boactivity.inc.php
===================================================================
--- trunk/booking/inc/class.boactivity.inc.php  2017-05-30 17:07:20 UTC (rev 
16801)
+++ trunk/booking/inc/class.boactivity.inc.php  2017-05-30 17:16:18 UTC (rev 
16802)
@@ -72,7 +72,7 @@
                        $values = $this->so->get_top_level();
                        if ($selected)
                        {
-                               foreach ($values as $entry)
+                               foreach ($values as &$entry)
                                {
                                        $entry['selected'] = $entry['id'] == 
$selected ? 1 : 0;
                                }

Modified: trunk/booking/inc/class.soactivity.inc.php
===================================================================
--- trunk/booking/inc/class.soactivity.inc.php  2017-05-30 17:07:20 UTC (rev 
16801)
+++ trunk/booking/inc/class.soactivity.inc.php  2017-05-30 17:16:18 UTC (rev 
16802)
@@ -61,7 +61,7 @@
                public function get_top_level()
                {
 
-                       $sql = "SELECT name, id FROM bb_activity WHERE 
parent_id = 0 OR parent_id IS NULL";
+                       $sql = "SELECT name, id, active FROM bb_activity WHERE 
parent_id = 0 OR parent_id IS NULL";
 
                        $this->db->query($sql, __LINE__, __FILE__);
                        $values = array();
@@ -71,6 +71,7 @@
                                $values[] = array(
                                        'id' => $this->db->f('id'),
                                        'name' => $this->db->f('name', true),
+                                       'active' => $this->db->f('active'),
                                );
                        }
                        return $values;

Modified: trunk/bookingfrontend/inc/class.bosearch.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.bosearch.inc.php    2017-05-30 17:07:20 UTC 
(rev 16801)
+++ trunk/bookingfrontend/inc/class.bosearch.inc.php    2017-05-30 17:16:18 UTC 
(rev 16802)
@@ -228,9 +228,9 @@
                                        $event['name'] = 
$event['building_name'] . ' / ' . $event['description'];
                                        $event['type'] = "Event";
                                        $date = date('Y-m-d', 
strtotime($event['from_']));
-                                       $event_res = 
$this->soresource->read(array('filters' => array('id' => 
$event['resources'][0])));
+               //                      $event_res = 
$this->soresource->read(array('filters' => array('id' => 
$event['resources'][0])));
                                        $event['link'] = 
$GLOBALS['phpgw']->link('/bookingfrontend/', array('menuaction' => 
'bookingfrontend.uibuilding.schedule',
-                                               'id' => 
$event_res['results'][0]['building_id'], 'date' => $date));
+                                               'id' => $event['building_id'], 
'date' => $date));
                                }
                        }
 

Modified: trunk/bookingfrontend/inc/class.uisearch.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.uisearch.inc.php    2017-05-30 17:07:20 UTC 
(rev 16801)
+++ trunk/bookingfrontend/inc/class.uisearch.inc.php    2017-05-30 17:16:18 UTC 
(rev 16802)
@@ -67,6 +67,10 @@
                        $filter_tree = array();
                        foreach ($activities as $activity)
                        {
+                               if(!$activity['active'])
+                               {
+                                       continue;
+                               }
                                $top_levels[] = array(
                                        'id' => $activity['id'],
                                        'location' => 
"resource_{$activity['id']}",
@@ -185,7 +189,7 @@
 //                     _debug_array($activity_criteria);
 //                     _debug_array($criteria);
 //                     die();
-                       if ($searchterm || $building_id || $activity_criteria 
|| $filter_part_of_town || phpgw::get_var('filter_top_level', 'string') || 
phpgw::get_var('filter_search_type'))
+                       if ($searchterm || $building_id || $activity_criteria 
|| $filter_part_of_town || phpgw::get_var('filter_top_level', 'string') || 
(phpgw::get_var('filter_search_type') && $searchterm))
                        {
                                $data = array(
                                        'results' => 
$this->bo->search($searchterm, $building_id, $filter_part_of_town, 
$filter_top_level, $activity_criteria)

Modified: trunk/bookingfrontend/templates/base/search.xsl
===================================================================
--- trunk/bookingfrontend/templates/base/search.xsl     2017-05-30 17:07:20 UTC 
(rev 16801)
+++ trunk/bookingfrontend/templates/base/search.xsl     2017-05-30 17:16:18 UTC 
(rev 16802)
@@ -174,7 +174,7 @@
                                                                <xsl:value-of 
select="php:function('lang', 'resource')" />
                                                        </label>
                                                </li>
-                                               <!--li>
+                                               <li>
                                                        <label>
                                                                <input 
type="checkbox" name="search_type[]" value="organization"/>
                                                                <xsl:value-of 
select="php:function('lang', 'organization')" />
@@ -185,7 +185,7 @@
                                                                <input 
type="checkbox" name="search_type[]" value="event"/>
                                                                <xsl:value-of 
select="php:function('lang', 'event')" />
                                                        </label>
-                                               </li-->
+                                               </li>
                                        </ul>
                                </div>
                                




reply via email to

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