fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8277] bkbooking: nsf update fronend search


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [8277] bkbooking: nsf update fronend search
Date: Tue, 13 Dec 2011 08:43:25 +0000

Revision: 8277
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8277
Author:   kjell
Date:     2011-12-13 08:43:24 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
bkbooking: nsf update fronend search

Modified Paths:
--------------
    branches/dev-thomasez/booking/inc/class.boresource.inc.php
    branches/dev-thomasez/booking/inc/class.sobuilding.inc.php
    branches/dev-thomasez/booking/inc/class.soresource.inc.php
    branches/dev-thomasez/booking/inc/class.uibuilding.inc.php
    branches/dev-thomasez/booking/setup/phpgw_no.lang
    branches/dev-thomasez/booking/templates/base/building_form.xsl
    branches/dev-thomasez/booking/templates/base/css/base.css
    branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php
    branches/dev-thomasez/bookingfrontend/inc/class.uisearch.inc.php
    branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang
    branches/dev-thomasez/bookingfrontend/templates/base/search.xsl

Added Paths:
-----------
    branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js

Modified: branches/dev-thomasez/booking/inc/class.boresource.inc.php
===================================================================
--- branches/dev-thomasez/booking/inc/class.boresource.inc.php  2011-12-12 
19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/booking/inc/class.boresource.inc.php  2011-12-13 
08:43:24 UTC (rev 8277)
@@ -121,6 +121,7 @@
                                $resource['link']        = 
$this->link(array('menuaction' => $menuaction, 'id' => $resource['id']));
                                $resource['type']                = 
lang($resource['type']);
                                $resource['full_name'] = 
$resource['building_name'] . ' / ' . $resource['name'];
+                               $resource['building_district'] 
=lang($resource['building_district']); 
                                if ($resource['cost_type'] != '') 
                                {
                                        $resource['cost_type']           = 
lang($resource['cost_type']);

Modified: branches/dev-thomasez/booking/inc/class.sobuilding.inc.php
===================================================================
--- branches/dev-thomasez/booking/inc/class.sobuilding.inc.php  2011-12-12 
19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/booking/inc/class.sobuilding.inc.php  2011-12-13 
08:43:24 UTC (rev 8277)
@@ -43,6 +43,28 @@
                        );
                }
 
+               function fylker()
+               {
+                       return array( "akerhus" => "Akershus",
+                               "austagder" => "Aust-Agder",
+                               "buskerud" => "Buskerud",
+                               "finnmark" => "Finnmark",
+                               "hedemark" => "Hedmark",
+                               "hordaland" => "Hordaland",
+                               "moreogromsdal" => "Møre og Romsdal",
+                               "nordland" => "Nordland",
+                               "nordtrodelag" => "Nord-Trøndelag",
+                               "oppland" => "Oppland",
+                               "rogaland" => "Rogaland",
+                               "songogfjordane" => "Sogn og Fjordane",
+                               "sortrondelag" => "Sør-Trøndelag",
+                               "telemark" => "Telemark",
+                               "troms" => "Troms",
+                               "vestagder" => "Vest-Agder",
+                               "vestfold" => "Vestfold",
+                               "ostfold" => "Østfold");
+               }       
+
                public static function allowed_cost_types()
                {
                        return array(self::COST_TYPE_PH, self::COST_TYPE_PD, 
self::COST_TYPE_PW);

Modified: branches/dev-thomasez/booking/inc/class.soresource.inc.php
===================================================================
--- branches/dev-thomasez/booking/inc/class.soresource.inc.php  2011-12-12 
19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/booking/inc/class.soresource.inc.php  2011-12-13 
08:43:24 UTC (rev 8277)
@@ -6,6 +6,7 @@
                const TYPE_LOCATION = 'Location';
                const TYPE_HOUSE = 'House';
                const TYPE_EQUIPMENT = 'Equipment';
+               const TYPE_BOAT = 'Boat';
                const TYPE_CAMPSITE = 'Campsite';
                const COST_TYPE_PH      = 'Perhour';
                const COST_TYPE_PD      = 'Perday';
@@ -81,7 +82,7 @@
                
                public static function allowed_types()
                {
-                       return array(self::TYPE_LOCATION, self::TYPE_EQUIPMENT, 
self::TYPE_HOUSE, self::TYPE_CAMPSITE);
+                       return array(self::TYPE_HOUSE, self::TYPE_CAMPSITE, 
self::TYPE_BOAT, self::TYPE_EQUIPMENT,self::TYPE_LOCATION);
                }
 
                public static function allowed_cost_types()

Modified: branches/dev-thomasez/booking/inc/class.uibuilding.inc.php
===================================================================
--- branches/dev-thomasez/booking/inc/class.uibuilding.inc.php  2011-12-12 
19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/booking/inc/class.uibuilding.inc.php  2011-12-13 
08:43:24 UTC (rev 8277)
@@ -146,6 +146,7 @@
                        $buildings = $this->bo->read();
                        foreach($buildings['results'] as &$building)
                        {
+                               $building['district'] 
=lang($building['district']);
                                $building['link'] = 
$this->link(array('menuaction' => 'booking.uibuilding.show', 'id' => 
$building['id']));
                                $building['active'] = $building['active'] ? 
lang('Active') : lang('Inactive');
                        }
@@ -168,7 +169,9 @@
                                {
                                        $errors['urlfields'] = lang('Max 250 
characters in url fields');
                                }
-
+                               if($_POST['district'] == ''){
+                                       $errors['district'] = lang('Du må velge 
et fylke');
+                               }
                                if(!$errors)
                                {
                                        $receipt = $this->bo->add($building);
@@ -176,6 +179,7 @@
                                }
                        }
                        $this->flash_form_errors($errors);
+                       $building['fylker'] = $this->bo->so->fylker();
                        $building['cost_types'] = $this->building_cost_types();
                        $building['buildings_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.index'));
                        $building['cancel_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.index'));
@@ -192,6 +196,7 @@
                        $building['buildings_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.index'));
                        $building['cancel_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.show', 'id' => 
$building['id']));
                        $building['top-nav-bar-buildings'] = lang('Buildings');
+                       $building['fylker'] = $this->bo->so->fylker();
                        $errors = array();
                        if($_SERVER['REQUEST_METHOD'] == 'POST')
                        {
@@ -206,6 +211,9 @@
                                {
                                        $errors['urlfields'] = lang('Max 250 
characters in url fields');
                                }
+                               if($_POST['district'] == ''){
+                                       $errors['district'] = lang('You must 
choose a county');
+                               }
 
                                if(!$errors)
                                {
@@ -221,6 +229,7 @@
                public function show()
                {
                        $building = $this->bo->read_single(phpgw::get_var('id', 
'GET'));
+                       $building['district'] =lang($building['district']);
                        $building['buildings_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.index'));
                        $building['edit_link'] = self::link(array('menuaction' 
=> 'booking.uibuilding.edit', 'id' => $building['id']));
                        $building['schedule_link'] = 
self::link(array('menuaction' => 'booking.uibuilding.schedule', 'id' => 
$building['id']));

Modified: branches/dev-thomasez/booking/setup/phpgw_no.lang
===================================================================
--- branches/dev-thomasez/booking/setup/phpgw_no.lang   2011-12-12 19:49:09 UTC 
(rev 8276)
+++ branches/dev-thomasez/booking/setup/phpgw_no.lang   2011-12-13 08:43:24 UTC 
(rev 8277)
@@ -520,8 +520,8 @@
 Upload manual  booking no      Last opp dokumentasjon
 Are you sure you want to delete?       booking no      Er du sikker på at 
søknad skal avvises?
 House  booking no      Hytte/hus
-Campsite       booking no      Leirplass
-Campsites      booking no      Teltplasser
+Campsites      booking no      Teltplass
+Boat   booking no      Seilbåt
 Bedspaces      booking no      Sengeplasser
 Heating        booking no      Oppvarming
 Kitchen        booking no      Kjøkken
@@ -541,4 +541,23 @@
 Click here     booking no      Klikk her
 Mail Settings  booking no      E-post oppsett
 Application Settings   booking no      Søknads oppsett
-
+Select County  booking no      Velg Fylke
+akerhus        booking no      Akershus
+austagder      booking no      Aust-Agder
+buskerud       booking no      Buskerud
+finnmark       booking no      Finnmark
+hedemark       booking no      Hedmark
+hordaland      booking no      Hordaland
+moreogromsdal  booking no      Møre og Romsdal
+nordland       booking no      Nordland
+nordtrodelag   booking no      Nord-Trøndelag
+oppland        booking no      Oppland
+rogaland       booking no      Rogaland
+songogfjordane booking no      Sogn og Fjordane
+sortrondelag   booking no      Sør-Trøndelag
+telemark       booking no      Telemark
+troms  booking no      Troms
+vestagder      booking no      Vest-Agder
+vestfold       booking no      Vestfold
+ostfold        booking no      Østfold
+You must choose a county       booking no      Du må velge et fylke

Modified: branches/dev-thomasez/booking/templates/base/building_form.xsl
===================================================================
--- branches/dev-thomasez/booking/templates/base/building_form.xsl      
2011-12-12 19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/booking/templates/base/building_form.xsl      
2011-12-13 08:43:24 UTC (rev 8277)
@@ -54,7 +54,20 @@
                                <dd><input type="text" name="city" 
id="field_city" value="{building/city}"/></dd>
 
                                <dt><label for='field_district'><xsl:value-of 
select="php:function('lang', 'District')"/></label></dt>
-                               <dd><input type="text" name="district" 
id="field_district" value="{building/district}"/></dd>
+                               <dd>
+                               <select name='district' id='field_district'>
+                               <option value=''><xsl:value-of 
select="php:function('lang', 'Select County')" />...</option>
+                                       <xsl:for-each 
select="building/fylker/*">
+                                               <option value="{local-name()}">
+                                                       <xsl:if 
test="../../district = local-name()">
+                                                               <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                                       </xsl:if>
+                                                       <xsl:value-of 
select="string(node())"/>
+                                               </option>
+                                       </xsl:for-each>
+                               </select>
+                               </dd>
+<!--                           <dd><input type="text" name="district" 
id="field_district" value="{building/district}"/></dd>-->
                                
                                <xsl:if test="not(new_form)">
                                        <dt><label 
for="field_active"><xsl:value-of select="php:function('lang', 
'Active')"/></label></dt>

Modified: branches/dev-thomasez/booking/templates/base/css/base.css
===================================================================
--- branches/dev-thomasez/booking/templates/base/css/base.css   2011-12-12 
19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/booking/templates/base/css/base.css   2011-12-13 
08:43:24 UTC (rev 8277)
@@ -304,3 +304,41 @@
 .image_container {
        margin-top: 8px;
 }
+em {
+       font-style:italic;
+}
+ul {
+       margin-left:0em; 
+       padding-left:1.2em; 
+       margin-bottom:1em; 
+}
+ul li {
+       padding-left: 0.2em; 
+       list-style: disc;
+}
+ol {
+       margin-left:0em; 
+       padding-left:1.6em; 
+       margin-bottom:1em; 
+}
+ol li {
+       list-style:decimal; 
+       background-image:none; 
+       padding-left:0em; 
+}
+#field_type {
+       margin-left: 5px;
+}
+#regions input {
+       margin: 0px 5px 0px 3px;
+}
+form#searchterm {
+    text-align: center;
+    padding-top: 5em;
+}
+input#searchterm {
+    font-size: 120%;
+    color: #666;
+    width: 20em;
+}
+

Modified: branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php
===================================================================
--- branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php    
2011-12-12 19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php    
2011-12-13 08:43:24 UTC (rev 8277)
@@ -11,15 +11,19 @@
                        $this->soresource = CreateObject('booking.soresource');
                }
                
-               function search($searchterm)
+               function search($searchterm,$resource)
                {
                        $type = phpgw::get_var('type', 'GET');
             $bui_result = $org_result = $res_result = array();
 
-            if (!$type || $type == "building") {
-                $bui_result = 
$this->sobuilding->read(array("query"=>$searchterm, "filters" => array("active" 
=> "1")));
+            if ((!$type || $type == "building") && $resource['res'] == 
'House') {
+               
+                               $conditions = '(bedspaces > 10 and bedspaces < 
25)';
+                $bui_result = 
$this->sobuilding->read(array("query"=>$searchterm, "filters" => array('where' 
=> $conditions,"active" => "1")));
+
                 foreach($bui_result['results'] as &$bui)
                 {
+
                     $bui['type'] = "building";
                     $bui['link'] = 
$GLOBALS['phpgw']->link('/bookingfrontend/', array('menuaction' => 
'bookingfrontend.uibuilding.show', 'id' => $bui['id']));
                     $bui['img_container'] = "building-" . $bui['id'];
@@ -30,21 +34,36 @@
                                        }
                 }
             }
-            if (!$type || $type == "organization") {
-                $org_result = 
$this->soorganization->read(array("query"=>$searchterm, "filters" => 
array("active" => "1")));
-                foreach($org_result['results'] as &$org)
-                {
-                    $org['type'] = "organization";
-                    $org['description'] = 
nl2br(strip_tags($org['description']));
-                    $org['link'] = 
$GLOBALS['phpgw']->link('/bookingfrontend/', array('menuaction' => 
'bookingfrontend.uiorganization.show', 'id' => $org['id']));
-                                       if ( trim($org['homepage']) != '' && 
!preg_match("/^http|https:\/\//", trim($org['homepage'])) )
-                                       {
-                                               $org['homepage'] = 
'http://'.$org['homepage'];
-                                       }
-                }
-            }
+#            if (!$type || $type == "organization") {
+#                $org_result = 
$this->soorganization->read(array("query"=>$searchterm, "filters" => 
array("active" => "1")));
+#                foreach($org_result['results'] as &$org)
+#                {
+#                    $org['type'] = "organization";
+#                    $org['description'] = 
nl2br(strip_tags($org['description']));
+#                    $org['link'] = 
$GLOBALS['phpgw']->link('/bookingfrontend/', array('menuaction' => 
'bookingfrontend.uiorganization.show', 'id' => $org['id']));
+#                                      if ( trim($org['homepage']) != '' && 
!preg_match("/^http|https:\/\//", trim($org['homepage'])) )
+#                                      {
+#                                              $org['homepage'] = 
'http://'.$org['homepage'];
+#                                      }
+#                }
+#            }
             if(!$type || $type == "resource") {
-                $res_result = 
$this->soresource->read(array("query"=>$searchterm, "filters" => array("active" 
=> "1")));
+
+                                               
+                               $filters = array();
+
+#                              if($resource['campsite'] != '') {
+#                                      $filters['where'] = "(campsites > 
".$resource['campsite'].")";
+#                              }
+                               if($resource['res'] != '') {
+                                       $filters['type'] = $resource['res'];
+                               }
+                               $filters['active'] = "1";
+
+#                              echo "<pre>";print_r($filters);exit;
+
+                $res_result = 
$this->soresource->read(array("query"=>$searchterm, "filters" => $filters));
+
                 foreach($res_result['results'] as &$res)
                 {
                     $res['name'] = $res['building_name']. ' / ' . $res['name'];

Modified: branches/dev-thomasez/bookingfrontend/inc/class.uisearch.inc.php
===================================================================
--- branches/dev-thomasez/bookingfrontend/inc/class.uisearch.inc.php    
2011-12-12 19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/bookingfrontend/inc/class.uisearch.inc.php    
2011-12-13 08:43:24 UTC (rev 8277)
@@ -3,6 +3,7 @@
 
        class bookingfrontend_uisearch extends booking_uicommon
        {
+
                public $public_functions = array
                (
                        'index' =>      true
@@ -11,33 +12,99 @@
                function __construct()
                {
                        $this->bo = CreateObject('bookingfrontend.bosearch');
+                       $this->bbresource = CreateObject('booking.soresource');
                        parent::__construct();
       array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . 
'/bookingfrontend/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set']);
                        array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . 
'/booking/templates/base');
                }
-               
+
+
+               protected function resource_types()
+               {
+                       $types = array();
+                       foreach($this->bbresource->allowed_types() as $type) { 
$types[$type] = self::humanize($type); }
+                       return $types;
+               }
+
+               protected function bedspaces()
+               {
+                       return array( "one" => "1-10",
+                               "two" => "10-25",
+                               "three" => "25-50",
+                               "Four" => "50-100",
+                               "Five" => "100+");
+               }       
+
+               protected function regions()
+               {
+                       return array( "all" => lang("All"),
+                               "east" => lang("East"),
+                               "south" => lang("South"),
+                               "west" => lang("West"),
+                               "middle" => lang("Middle"),
+                               "north" => lang("North"));
+               }       
+
+               protected function fylker()
+               {
+                       return array( "akerhus" => "Akershus",
+                               "austagder" => "Aust-Agder",
+                               "buskerud" => "Buskerud",
+                               "finnmark" => "Finnmark",
+                               "hedemark" => "Hedmark",
+                               "hordaland" => "Hordaland",
+                               "moreogromsdal" => "Møre og Romsdal",
+                               "nordland" => "Nordland",
+                               "nordtrodelag" => "Nord-Trøndelag",
+                               "oppland" => "Oppland",
+                               "rogaland" => "Rogaland",
+                               "songogfjordane" => "Sogn og Fjordane",
+                               "sortrondelag" => "Sør-Trøndelag",
+                               "telemark" => "Telemark",
+                               "troms" => "Troms",
+                               "vestagder" => "Vest-Agder",
+                               "vestfold" => "Vestfold",
+                               "ostfold" => "Østfold");
+               }       
                function index()
                {
                        $config = CreateObject('phpgwapi.config','booking');
                        $config->read();
                        $layout = $config->config_data['layout_settings'];
+                       $resource = array();
+                       $resource['types'] = $this->resource_types();
+                       $resource['fylker'] = $this->fylker();
+                       $resource['regions'] = $this->regions();
+                       $resource['bedspaces'] = $this->bedspaces();
                        $searchterm = trim(phpgw::get_var('searchterm', 
'string', null));
-                       $type = phpgw::get_var('type', 'GET', null);
+                       $resource['type'] = phpgw::get_var('type', 'GET', null);
+                       $resource['res'] = phpgw::get_var('res', 'GET', null);
+                       $resource['fylke'] = phpgw::get_var('fylker', 'GET', 
null);
+                       $resource['campsite'] = phpgw::get_var('campsites', 
'GET', null);
+                       $resource['beds'] = phpgw::get_var('bedspaces', 'GET', 
null);
+                       $resource['region']['all'] = phpgw::get_var('all', 
'GET', null);
+                       $resource['region']['east'] = phpgw::get_var('east', 
'GET', null);
+                       $resource['region']['south'] = phpgw::get_var('south', 
'GET', null);
+                       $resource['region']['west'] = phpgw::get_var('west', 
'GET', null);
+                       $resource['region']['middle'] = 
phpgw::get_var('middle', 'GET', null);
+                       $resource['region']['north'] = phpgw::get_var('north', 
'GET', null);
+       
                        $search = null;
                        
-                       if (strlen($searchterm) || $type)
+                       if (strlen($searchterm) || $type || $resource['res'] || 
$resource['fylke'])
                        {
                                $search = array(
-                                       'results'    => 
$this->bo->search($searchterm),
+                                       'results'    => 
$this->bo->search($searchterm,$resource),
                                        'searchterm' => $searchterm
                                );
                        }
-                       
+                       self::add_javascript('bookingfrontend', 
'bookingfrontend', 'search.js');
       // Should of course be replaced with some config option for the image
       // or using the tmpl_search_path. Need to work a little mor on this 
system
       // to find the right option. - thomasez
-                       $params = is_null($search) ? array('frontimage' => 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/{$GLOBALS['phpgw_info']['server']['template_set']}/images/nsf/forsidebilde.png")
 : array('search' => $search,'layout' => $layout);
-
+                       $params = is_null($search) ? array('frontimage' => 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/{$GLOBALS['phpgw_info']['server']['template_set']}/images/nsf/forsidebilde.png",'layout'
 => $layout,'resource' => $resource) : array('search' => $search,'layout' => 
$layout,'resource' => $resource);
+//                     echo "<pre>";print_r($resource);exit;
+                       
                        self::render_template('search', $params);
                }
                

Added: branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js
===================================================================
--- branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js          
                (rev 0)
+++ branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js  
2011-12-13 08:43:24 UTC (rev 8277)
@@ -0,0 +1,56 @@
+YAHOO.booking.initializeDataTable = function()
+{
+       var val = YAHOO.util.Dom.get('field_type').value;
+       if(['House','Campsite','Boat'].indexOf(val) >= 0) {
+               YAHOO.util.Dom.setStyle('extrafields', 'display', 'block');     
+       } 
+       else            
+       {
+               YAHOO.util.Dom.setStyle('extrafields', 'display', 'none');      
+       }
+       
+       YAHOO.util.Event.on(
+           YAHOO.util.Selector.query('input'), 'change', function (e) {
+                       var id = this.id;
+               var checked = this.checked;
+                       if (id == 'all' && checked == true) {
+                               var oEast = YAHOO.util.Dom.get('east');
+                               oEast.checked = false;
+                               var oSouth = YAHOO.util.Dom.get('south');
+                               oSouth.checked = false;
+                               var oWest = YAHOO.util.Dom.get('west');
+                               oWest.checked = false;
+                               var oMiddle = YAHOO.util.Dom.get('middle');
+                               oMiddle.checked = false;
+                               var oNorth = YAHOO.util.Dom.get('north');
+                               oNorth.checked = false;
+                       } else {
+                               var oAll = YAHOO.util.Dom.get('all');
+                               oAll.checked = false;
+                       }
+       });
+
+       YAHOO.util.Event.on(
+           YAHOO.util.Selector.query('select'), 'change', function (e) {
+               var val = this.value;
+                       if(['House','Campsite','Boat'].indexOf(val) >= 0) {
+                               YAHOO.util.Dom.setStyle('extrafields', 
'display', 'block');     
+                       } 
+                       else if (['Equipment','Location'].indexOf(val) >= 0)    
        
+                       {
+                               YAHOO.util.Dom.setStyle('extrafields', 
'display', 'none');      
+                       }
+       });
+
+    YAHOO.util.Event.addListener('search', "submit", function(e){
+               var oInput = YAHOO.util.Dom.get('searchterm');
+               if (oInput.value == 'Søk leirplass, hytte, utstyr eller 
aktivitet') {
+                       oInput.value = '';              
+               }
+                       
+    });
+
+};
+
+YAHOO.util.Event.addListener(window, "load", 
YAHOO.booking.initializeDataTable);
+

Modified: branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang   2011-12-12 
19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang   2011-12-13 
08:43:24 UTC (rev 8277)
@@ -336,10 +336,36 @@
 manual common  no      Veiledning lag og organisasjoner
 Cancel allocation      bookingfrontend no      Avbestill tildelinger
 House  bookingfrontend no      Hytte/hus
-Campsite       bookingfrontend no      Leirplass
+Campsite       bookingfrontend no      Teltplass
+Boat   bookingfrontend no      Seilbåt
 Internal Cost  bookingfrontend no      Medlems pris
 External Cost  bookingfrontend no      Pris
 Cost Type      bookingfrontend no      Pris type
 Perhour        bookingfrontend no      Pr time
 Perday bookingfrontend no      Pr dag
 Perweek        bookingfrontend no      Pr uke
+Select County  bookingfrontend no      Velg Fylke
+East   bookingfrontend no      Østlandet
+South  bookingfrontend no      Sørlandet
+West   bookingfrontend no      Vestlandet
+Middle bookingfrontend no      Midt-Norge
+North  bookingfrontend no      Nord-Norge
+Select bedspaces       bookingfrontend no      Velg antall sengeplasser
+akerhus        booking no      Akershus
+austagder      booking no      Aust-Agder
+buskerud       booking no      Buskerud
+finnmark       booking no      Finnmark
+hedemark       booking no      Hedmark
+hordaland      booking no      Hordaland
+moreogromsdal  booking no      Møre og Romsdal
+nordland       booking no      Nordland
+nordtrodelag   booking no      Nord-Trøndelag
+oppland        booking no      Oppland
+rogaland       booking no      Rogaland
+songogfjordane booking no      Sogn og Fjordane
+sortrondelag   booking no      Sør-Trøndelag
+telemark       booking no      Telemark
+troms  booking no      Troms
+vestagder      booking no      Vest-Agder
+vestfold       booking no      Vestfold
+ostfold        booking no      Østfold

Modified: branches/dev-thomasez/bookingfrontend/templates/base/search.xsl
===================================================================
--- branches/dev-thomasez/bookingfrontend/templates/base/search.xsl     
2011-12-12 19:49:09 UTC (rev 8276)
+++ branches/dev-thomasez/bookingfrontend/templates/base/search.xsl     
2011-12-13 08:43:24 UTC (rev 8277)
@@ -12,24 +12,75 @@
                </xsl:otherwise>
        </xsl:choose>
 </xsl:template>
-
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
        <xsl:call-template name="yui_booking_i18n"/>
+       <xsl:variable name="resource"><xsl:value-of select="resource" 
/></xsl:variable>
   <div id="content">
     <form action="" method="GET" id="search">
       <input type="hidden" name="menuaction" 
value="bookingfrontend.uisearch.index" />
       <xsl:choose>
         <xsl:when test="search and string-length(search/searchterm) &gt; 0">
-          <input id="search" type="text" name="searchterm" 
value="{search/searchterm}"/>
+          <input id="searchterm" type="text" name="searchterm" 
value="{search/searchterm}"/>
         </xsl:when>
         <xsl:otherwise>
-          <input id="search" type="text" name="searchterm" value="Søk 
leirplass, hytte, utstyr eller aktivitet" onclick="value=''" />
+          <input id="searchterm" type="text" name="searchterm" value="Søk 
leirplass, hytte, utstyr eller aktivitet" onclick="value=''" />
         </xsl:otherwise>
       </xsl:choose>
       <xsl:text> </xsl:text><input type="submit" value="{php:function('lang', 
'Search')}"/>
-      <div class="hint">
+      <div class="hint" id="hint">
         F.eks. "<i>Solstølen</i>", "<i>Tredalen</i>", "<i>kano</i>" eller 
"<i>leir</i>" 
       </div>
+         <div class="settings" id="regions">
+               Region: 
+                       <xsl:for-each select="resource/regions/*">
+                               <input type="checkbox" name="{local-name()}" 
id="{local-name()}" /> 
+                               <xsl:value-of select="string(node())"/>
+                       </xsl:for-each> 
+         </div>
+         <div>
+                       <select name='res' id='field_type'>
+                       <option value=''><xsl:value-of 
select="php:function('lang', 'Select Type')" />...</option>
+                               <xsl:for-each select="resource/types/*">
+                                       <option value="{local-name()}">
+                                               <xsl:if test="../../res = 
local-name()">
+                                                       <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                               </xsl:if>
+                                               <xsl:value-of 
select="php:function('lang', string(node()))"/>
+                                       </option>
+                               </xsl:for-each>
+
+                       </select>
+                       <select name='fylker' id='field_type'>
+                       <option value=''><xsl:value-of 
select="php:function('lang', 'Select County')" />...</option>
+                               <xsl:for-each select="resource/fylker/*">
+                                       <option value="{local-name()}">
+                                               <xsl:if test="../../fylke = 
local-name()">
+                                                       <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                               </xsl:if>
+                                               <xsl:value-of 
select="string(node())"/>
+                                       </option>
+                               </xsl:for-each>
+                       </select>
+        </div>
+       <div class="settings" id="extrafields">
+               Minimum antall plasser: 
+               <input type="text" size="3" id="campsites" name="campsites">
+                       <xsl:if test="resource/campsite">
+                               <xsl:attribute name="value"><xsl:value-of 
select="resource/campsite"/></xsl:attribute>
+                       </xsl:if>
+               </input>                                                
+               <select name='bedspaces' id='field_type'>
+                       <option value=''><xsl:value-of 
select="php:function('lang', 'Select bedspaces')" />...</option>
+                       <xsl:for-each select="resource/bedspaces/*">
+                               <option value="{local-name()}">
+                                       <xsl:if test="../../beds = 
local-name()">
+                                               <xsl:attribute 
name="selected">selected</xsl:attribute>
+                                       </xsl:if>
+                                       <xsl:value-of select="string(node())"/>
+                               </option>
+                       </xsl:for-each>
+               </select>
+       </div>
     </form>
        
        <xsl:if test="not(search)">     




reply via email to

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