fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8371] bkbooking: nsf update s?\195?\184k


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [8371] bkbooking: nsf update s?\195?\184k
Date: Mon, 19 Dec 2011 14:39:01 +0000

Revision: 8371
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8371
Author:   kjell
Date:     2011-12-19 14:39:01 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
bkbooking: nsf update s?\195?\184k

Modified Paths:
--------------
    branches/dev-thomasez/booking/inc/class.soresource.inc.php
    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/js/bookingfrontend/search.js
    branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang
    branches/dev-thomasez/bookingfrontend/templates/base/search.xsl

Modified: branches/dev-thomasez/booking/inc/class.soresource.inc.php
===================================================================
--- branches/dev-thomasez/booking/inc/class.soresource.inc.php  2011-12-19 
13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/booking/inc/class.soresource.inc.php  2011-12-19 
14:39:01 UTC (rev 8371)
@@ -79,6 +79,64 @@
                        );
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                }
+               public static function getresources($searchterm,$wclause)
+               {
+
+            $results = array();
+
+                       if($searchterm != '') {
+                               $wclause .= " AND (br.name like 
lower('%".$searchterm."%') OR br.description like lower('%".$searchterm."%'))";
+                       }
+                       
+                       $sql = "SELECT 
br.id,br.active,br.sort,br.building_id,br.name,br.type,
+br.description,br.activity_id,br.campsites,br.bedspaces,br.heating,br.water,
+br.kitchen,br.location,br.communication,br.usage_time,br.internal_cost,
+br.external_cost,br.cost_type,bb.name AS building_name,bb.street AS 
building_street,
+bb.city AS building_city,bb.district AS building_district,ba.name AS 
activity_name 
+FROM bb_resource AS br,bb_building AS bb,bb_activity AS ba 
+WHERE br.building_id = bb.id AND br.activity_id = ba.id AND br.active = 1 
".$wclause." ORDER BY br.name ASC";
+
+                       $GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);
+                       while ($GLOBALS['phpgw']->db->next_record())
+                       {
+                               $results[] = array('id'  => 
$GLOBALS['phpgw']->db->f('id', false),
+                                                                       
'active'  => $GLOBALS['phpgw']->db->f('active', false),
+                                                                       'sort'  
=> $GLOBALS['phpgw']->db->f('sort', false),
+                                                                       
'building_id'  => $GLOBALS['phpgw']->db->f('building_id', false),
+                                                                       'name'  
=> $GLOBALS['phpgw']->db->f('name', false),
+                                                                       'type'  
=> $GLOBALS['phpgw']->db->f('type', false),
+                                                                       
'description'  => $GLOBALS['phpgw']->db->f('description', false),
+                                                                       
'activity_id'  => $GLOBALS['phpgw']->db->f('activity_id', false),
+                                                                       
'campsites'  => $GLOBALS['phpgw']->db->f('campsites', false),
+                                                                       
'bedspaces'  => $GLOBALS['phpgw']->db->f('bedspaces', false),
+                                                                       
'heating'  => $GLOBALS['phpgw']->db->f('heating', false),
+                                                                       'water' 
 => $GLOBALS['phpgw']->db->f('water', false),
+                                                                       
'kitchen'  => $GLOBALS['phpgw']->db->f('kitchen', false),
+                                                                       
'location'  => $GLOBALS['phpgw']->db->f('location', false),
+                                                                       
'communication'  => $GLOBALS['phpgw']->db->f('communication', false),
+                                                                       
'usage_time'  => $GLOBALS['phpgw']->db->f('usage_time', false),
+                                                                       
'internal_cost'  => $GLOBALS['phpgw']->db->f('internal_cost', false),
+                                                                       
'external_cost'  => $GLOBALS['phpgw']->db->f('external_cost', false),
+                                                                       
'cost_type'  => $GLOBALS['phpgw']->db->f('cost_type', false),
+                                                                       
'building_name'  => $GLOBALS['phpgw']->db->f('building_name', false),
+                                                                       
'building_street'  => $GLOBALS['phpgw']->db->f('building_street', false),
+                                                                       
'building_city '  => $GLOBALS['phpgw']->db->f('building_city', false),
+                                                                       
'building_district'  => $GLOBALS['phpgw']->db->f('building_district', false),
+                                                                       
'activity_name'  => $GLOBALS['phpgw']->db->f('activity_name', false));
+                       }
+                       $GLOBALS['phpgw']->db->query("SELECT count(1) AS count 
FROM bb_resource AS br,bb_building AS bb,bb_activity AS ba 
+WHERE br.building_id = bb.id AND br.activity_id = ba.id AND br.active = 1 
".$wclause, __LINE__, __FILE__);
+                       $GLOBALS['phpgw']->db->next_record();
+                       $total_records = (int)$GLOBALS['phpgw']->db->f('count');
+
+                       return array(
+                               'total_records' => $total_records,
+                               'results'               => $results,
+                               'start'                 => 0,
+                               'sort'                  => null,
+                               'dir'                   => 'asc'
+                       );
+               }
                
                public static function allowed_types()
                {

Modified: branches/dev-thomasez/booking/templates/base/css/base.css
===================================================================
--- branches/dev-thomasez/booking/templates/base/css/base.css   2011-12-19 
13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/booking/templates/base/css/base.css   2011-12-19 
14:39:01 UTC (rev 8371)
@@ -333,6 +333,18 @@
 #field_type {
        margin-left: 5px;
 }
+#field_campsites {
+       margin-left: 5px;
+}
+#field_bedspaces {
+       margin-left: 5px;
+}
+#field_regions {
+       margin-left: 5px;
+}
+#field_fylker {
+       margin-left: 5px;
+}
 #regions input {
        margin: 0px 5px 0px 3px;
 }

Modified: branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php
===================================================================
--- branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php    
2011-12-19 13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/bookingfrontend/inc/class.bosearch.inc.php    
2011-12-19 14:39:01 UTC (rev 8371)
@@ -52,18 +52,98 @@
                                                
                                $filters = array();
 
-#                              if($resource['campsite'] != '') {
-#                                      $filters['where'] = "(campsites > 
".$resource['campsite'].")";
-#                              }
-                               if($resource['res'] != '') {
-                                       $filters['type'] = $resource['res'];
-                               }
-                               $filters['active'] = "1";
+                               if (($resource['region'] == '' || 
$resource['region'] == 'all')  && $resource['res'] == '')
+                               {
+                                       $filters['active'] = "1";
+                       $res_result = 
$this->soresource->read(array("query"=>$searchterm, "filters" => $filters));
+                               } else {
 
-#                              echo "<pre>";print_r($filters);exit;
 
-                $res_result = 
$this->soresource->read(array("query"=>$searchterm, "filters" => $filters));
+                                       if ($resource['region'] == 'east') {
+                                               $regions = 
"('akerhus','oslo','ostfold','vestfold','hedemark','oppland','buskerud','telemark')";
+                                       }
+                                       elseif ($resource['region'] == 'south') 
{
+                                               $regions = 
"('vestagder','austagder')";
+                                       }                                       
+                                       elseif ($resource['region'] == 'west') {
+                                               $regions = 
"('rogaland','hordaland','sognogfjordane','moreogromsdal')";
+                                       }                                       
+                                       elseif ($resource['region'] == 
'middle') {
+                                               $regions = 
"('nordtrodelag','sortrondelag')";
+                                       }                                       
+                                       elseif ($resource['region'] == 'north') 
{
+                                               $regions = 
"('finnmark','nordland','troms')";
+                                       } else {
+                                               $regions = '';
+                                       }                               
+                                       if( $resource['fylke'] != '') {
+                                               $fylke = $resource['fylke'];
+                                       } else {
+                                               $fylke = '';
+                                       }
+                                       if ($resource['res'] != ''){
+                                               $ressurs = $resource['res'];
+                                               
if(in_array($ressurs,array('House','Boat','Location'))) {
+                                                       if 
($resource['beds']=='one') {
+                                                               $sengeplasser = 
'(br.bedspaces >= 1 and br.bedspaces <= 10)';
+                                                       } 
+                                                       elseif 
($resource['beds']=='two') {
+                                                               $sengeplasser = 
'br.bedspaces >= 10 AND br.bedspaces <= 25';
+                                                       }
+                                                       elseif 
($resource['beds']=='three') {
+                                                               $sengeplasser = 
'br.bedspaces >= 25 AND br.bedspaces <= 50';
+                                                       }
+                                                       elseif 
($resource['beds']=='four') {
+                                                               $sengeplasser = 
'br.bedspaces >= 50 AND br.bedspaces <= 100';
+                                                       }
+                                                       elseif 
($resource['beds']=='five') {
+                                                               $sengeplasser = 
'br.bedspaces >= 100 AND br.bedspaces <= 300';
+                                                       }
+                                                       elseif 
($resource['beds']=='six') {
+                                                               $sengeplasser = 
'br.bedspaces >= 300';
+                                                       }
+                                                       $teltplasser = '';
+                                               } 
elseif(in_array($ressurs,array('Campsite'))) {
+                                                       if 
($resource['campsite'] != '') {
+                                                               $teltplasser = 
'br.campsites > '.$resource['campsite'];
+                                                               $sengeplasser = 
'';
+                                                       } else {
+                                                               $teltplasser = 
'';
+                                                               $sengeplasser = 
'';
+                                                       }
+                                               } else {
+                                                       $teltplasser = '';
+                                                       $sengeplasser = '';
+                                               }
 
+                                       } else {
+                                               $ressurs = '';
+                                               $teltplasser = '';
+                                               $sengeplasser = '';
+                                       }
+
+                                       $wclause = '';
+
+                                       if($regions != '') {
+                                               $wclause .= " AND bb.district 
IN ".$regions;                    
+                                       }                                       
+                                       if($fylke != '') {
+                                               $wclause .= " AND bb.district = 
'".$fylke."'";                                          
+                                       }                                       
+                                       if($ressurs != '') {
+                                               $wclause .= " AND br.type = 
'".$ressurs."'";                                            
+                                       }                                       
+                                       if($teltplasser != '') {
+                                               $wclause .= ' AND 
'.$teltplasser;                                               
+                                       }                                       
+                                       if($sengeplasser != '') {
+                                               $wclause .= ' AND 
'.$sengeplasser;                                              
+                                       }                                       
+
+                                       $res_result = 
$this->soresource->getresources($searchterm,$wclause);
+
+                               }                               
+
                 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-19 13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/bookingfrontend/inc/class.uisearch.inc.php    
2011-12-19 14:39:01 UTC (rev 8371)
@@ -31,8 +31,9 @@
                        return array( "one" => "1-10",
                                "two" => "10-25",
                                "three" => "25-50",
-                               "Four" => "50-100",
-                               "Five" => "100+");
+                               "four" => "50-100",
+                               "five" => "100-300",
+                               "six" => "300+");
                }       
 
                protected function regions()
@@ -82,12 +83,7 @@
                        $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);
+                       $resource['region'] = phpgw::get_var('regions', 'GET', 
null);
        
                        $search = null;
                        

Modified: branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js
===================================================================
--- branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js  
2011-12-19 13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/bookingfrontend/js/bookingfrontend/search.js  
2011-12-19 14:39:01 UTC (rev 8371)
@@ -1,45 +1,229 @@
+GenerateAll = function(fylker,fylke) {
+       var i;
+       for ( i = fylker.length - 1; i >= 0; i--) {
+               fylker.remove(i);
+       }
+       fylker.options[0]=new Option("Velg Fylke", "", true, false);
+       fylker.options[1]=new Option("Akerhus", "akerhus", false, false);
+       fylker.options[2]=new Option("Oslo", "oslo", false, false);
+       fylker.options[3]=new Option("Vestfold", "vestfold", false, false);
+       fylker.options[4]=new Option("Østfold", "ostfold", false, false);
+       fylker.options[5]=new Option("Hedemark", "hedemark", false, false);
+       fylker.options[6]=new Option("Oppland", "oppland", false, false);
+       fylker.options[7]=new Option("Buskerud", "buskerud", false, false);
+       fylker.options[8]=new Option("Telemark", "telemark", false, false);
+       fylker.options[9]=new Option("Vest-Agder", "vestagder", false, false);
+       fylker.options[10]=new Option("Aust-Agder", "austagder", false, false);
+       fylker.options[11]=new Option("Møre og Romsdal", "moreogromsdal", 
false, false);
+       fylker.options[12]=new Option("Sogn og Fjordane", "sognogfjordane", 
false, false);
+       fylker.options[13]=new Option("Hordaland", "hordaland", false, false);
+       fylker.options[14]=new Option("Rogaland", "rogaland", false, false);
+       fylker.options[15]=new Option("Sør-Trøndelag", "sortrondelag", false, 
false);
+       fylker.options[16]=new Option("Nord-Trøndelag", "nordtrodelag", false, 
false);
+       fylker.options[17]=new Option("Finnmark", "finnmark", false, false);
+       fylker.options[18]=new Option("Troms", "troms", false, false);
+       fylker.options[19]=new Option("Nordland", "nordland", false, false);
+       for ( i=0; i < fylker.length; i++) {
+               if(fylke == fylker.options(i).value) {
+                       fylker.options(i).selected = true;
+               }
+       }
+}
+GenerateNorth = function(fylker,fylke) {
+       var i;
+       for ( i = fylker.length - 1; i >= 0; i--) {
+               fylker.remove(i);
+       }
+       fylker.options[0]=new Option("Velg Fylke", "", true, false);
+       fylker.options[1]=new Option("Finnmark", "finnmark", false, false);
+       fylker.options[2]=new Option("Troms", "troms", false, false);
+       fylker.options[2]=new Option("Nordland", "nordland", false, false);
+       for ( i=0; i < fylker.length; i++) {
+               if(fylke == fylker.options(i).value) {
+                       fylker.options(i).selected = true;
+               }
+       }
+}
+GenerateMiddle = function(fylker,fylke) {
+       var i;
+       for ( i = fylker.length - 1; i >= 0; i--) {
+               fylker.remove(i);
+       }
+       fylker.options[0]=new Option("Velg Fylke", "", true, false);
+       fylker.options[1]=new Option("Sør-Trøndelag", "sortrondelag", false, 
false);
+       fylker.options[2]=new Option("Nord-Trøndelag", "nordtrodelag", false, 
false);
+       for ( i=0; i < fylker.length; i++) {
+               if(fylke == fylker.options(i).value) {
+                       fylker.options(i).selected = true;
+               }
+       }
+}
+GenerateWest = function(fylker,fylke) {
+       var i;
+       for ( i = fylker.length - 1; i >= 0; i--) {
+               fylker.remove(i);
+       }
+       fylker.options[0]=new Option("Velg Fylke", "", true, false);
+       fylker.options[1]=new Option("Møre og Romsdal", "moreogromsdal", false, 
false);
+       fylker.options[2]=new Option("Sogn og Fjordane", "sognogfjordane", 
false, false);
+       fylker.options[3]=new Option("Hordaland", "hordaland", false, false);
+       fylker.options[4]=new Option("Rogaland", "rogaland", false, false);
+       for ( i=0; i < fylker.length; i++) {
+               if(fylke == fylker.options(i).value) {
+                       fylker.options(i).selected = true;
+               }
+       }
+}
+GenerateSouth = function(fylker,fylke) {
+       var i;
+       for ( i = fylker.length - 1; i >= 0; i--) {
+               fylker.remove(i);
+       }
+       fylker.options[0]=new Option("Velg Fylke", "", true, false);
+       fylker.options[1]=new Option("Vest-Agder", "vestagder", false, false);
+       fylker.options[2]=new Option("Aust-Agder", "austagder", false, false);
+       for ( i=0; i < fylker.length; i++) {
+               if(fylke == fylker.options(i).value) {
+                       fylker.options(i).selected = true;
+               }
+       }
+}
+GenerateEast = function(fylker,fylke) {
+       var i;
+       for ( i = fylker.length - 1; i >= 0; i--) {
+               fylker.remove(i);
+       }
+       fylker.options[0]=new Option("Velg Fylke", "", false, false);
+       fylker.options[1]=new Option("Akerhus", "akerhus", false, false);
+       fylker.options[2]=new Option("Oslo", "oslo", false, false);
+       fylker.options[3]=new Option("Vestfold", "vestfold", false, false);
+       fylker.options[4]=new Option("Østfold", "ostfold", false, false);
+       fylker.options[5]=new Option("Hedemark", "hedemark", false, false);
+       fylker.options[6]=new Option("Oppland", "oppland", false, false);
+       fylker.options[7]=new Option("Buskerud", "buskerud", false, false);
+       fylker.options[8]=new Option("Telemark", "telemark", false, false);
+       for ( i=0; i < fylker.length; i++) {
+               if(fylke == fylker.options(i).value) {
+                       fylker.options(i).selected = true;
+               }
+       }
+}
+
 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');     
+       if(['House','Boat'].indexOf(val) >= 0) {
+               YAHOO.util.Dom.setStyle('field_bedspaces', 'display', 
'inline');        
+               YAHOO.util.Dom.setStyle('field_campsites', 'display', 'none');  
        } 
+       else if (['Location','Campsite'].indexOf(val) >= 0) 
+       {
+               YAHOO.util.Dom.setStyle('field_bedspaces', 'display', 'none');  
+               YAHOO.util.Dom.setStyle('field_campsites', 'display', 
'inline');        
+       }
+       else if (['Equipment',''].indexOf(val) >= 0)            
+       {
+               YAHOO.util.Dom.setStyle('field_bedspaces', 'display', 'none');  
+               YAHOO.util.Dom.setStyle('field_campsites', 'display', 'none');  
+       }
+
+       var fylke = document.getElementById('field_fylke').value;
+       var fylker = document.getElementById('field_fylker');
+       var regions = YAHOO.util.Dom.get('field_regions').value;
+       if((regions != '' && regions != 'all')) {
+               YAHOO.util.Dom.setStyle('field_fylker', 'display', 'inline');   
+               if(regions == 'east') {
+                       GenerateEast(fylker,fylke);
+               }
+               if(regions == 'south') {
+                       GenerateSouth(fylker,fylke);
+               }
+               if(regions == 'west') {
+                       GenerateWest(fylker,fylke);
+               }
+               if(regions == 'middle') {
+                       GenerateMiddle(fylker,fylke);
+               }
+               if(regions == 'north') {
+                       GenerateNorth(fylker,fylke);
+               }
+       } 
        else            
        {
-               YAHOO.util.Dom.setStyle('extrafields', 'display', 'none');      
+               YAHOO.util.Dom.setStyle('field_fylker', '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('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');      
+                       var fylker = document.getElementById('field_fylker');
+                       var bedspaces = 
document.getElementById('field_bedspaces');
+
+                       if (this.id == 'field_type') {
+                               if(['House','Boat'].indexOf(val) >= 0) {
+                                       
YAHOO.util.Dom.setStyle('field_bedspaces', 'display', 'inline');        
+                                       
YAHOO.util.Dom.setStyle('field_campsites', 'display', 'none');  
+                               } 
+                               else if (['Location','Campsite'].indexOf(val) 
>= 0) 
+                               {
+                                       
YAHOO.util.Dom.setStyle('field_bedspaces', 'display', 'none');  
+                                       
YAHOO.util.Dom.setStyle('field_campsites', 'display', 'inline');        
+                               }
+                               else if (['Equipment',''].indexOf(val) >= 0)    
        
+                               {
+                                       
YAHOO.util.Dom.setStyle('field_bedspaces', 'display', 'none');  
+                                       
YAHOO.util.Dom.setStyle('field_campsites', 'display', 'none');  
+                               }
+                       }                       
+                       if ((this.id != 'field_type' && this.id != 
'field_bedspaces' && this.id != 'field_fylker')) {
+                               if((val != '' && val != 'all')) {
+                                       YAHOO.util.Dom.setStyle('field_fylker', 
'display', 'inline');   
+                               } 
+                               else            
+                               {
+                                       YAHOO.util.Dom.setStyle('field_fylker', 
'display', 'none');     
+                               }
                        }
+                       var fylke = '';
+//                     if(val == 'all' && this.id == 'field_fylker') {
+//                             GenerateAll(fylker,fylke);
+//                     }
+                       if(val == 'east') {
+                               GenerateEast(fylker,fylke);
+                       }
+                       if(val == 'south') {
+                               GenerateSouth(fylker,fylke);
+                       }
+                       if(val == 'west') {
+                               GenerateWest(fylker,fylke);
+                       }
+                       if(val == 'middle') {
+                               GenerateMiddle(fylker,fylke);
+                       }
+                       if(val == 'north') {
+                               GenerateNorth(fylker,fylke);
+                       }
        });
 
     YAHOO.util.Event.addListener('search', "submit", function(e){

Modified: branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang   2011-12-19 
13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/bookingfrontend/setup/phpgw_no.lang   2011-12-19 
14:39:01 UTC (rev 8371)
@@ -344,6 +344,7 @@
 Perhour        bookingfrontend no      Pr time
 Perday bookingfrontend no      Pr dag
 Perweek        bookingfrontend no      Pr uke
+Select Area    bookingfrontend no      Velg Region
 Select County  bookingfrontend no      Velg Fylke
 East   bookingfrontend no      Østlandet
 South  bookingfrontend no      Sørlandet

Modified: branches/dev-thomasez/bookingfrontend/templates/base/search.xsl
===================================================================
--- branches/dev-thomasez/bookingfrontend/templates/base/search.xsl     
2011-12-19 13:41:28 UTC (rev 8370)
+++ branches/dev-thomasez/bookingfrontend/templates/base/search.xsl     
2011-12-19 14:39:01 UTC (rev 8371)
@@ -31,26 +31,19 @@
         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/*">
+                       <select name='regions' id='field_regions'>
+                       <option value=''><xsl:value-of 
select="php:function('lang', 'Select Area')" />...</option>
+                               <xsl:for-each select="resource/regions/*">
                                        <option value="{local-name()}">
-                                               <xsl:if test="../../res = 
local-name()">
+                                               <xsl:if test="../../region = 
local-name()">
                                                        <xsl:attribute 
name="selected">selected</xsl:attribute>
                                                </xsl:if>
-                                               <xsl:value-of 
select="php:function('lang', string(node()))"/>
+                                               <xsl:value-of 
select="string(node())"/>
                                        </option>
                                </xsl:for-each>
-
                        </select>
-                       <select name='fylker' id='field_type'>
+                       <input type='hidden' value='{resource/fylke}' 
id='field_fylke' />                       
+                       <select name='fylker' id='field_fylker'>
                        <option value=''><xsl:value-of 
select="php:function('lang', 'Select County')" />...</option>
                                <xsl:for-each select="resource/fylker/*">
                                        <option value="{local-name()}">
@@ -63,13 +56,26 @@
                        </select>
         </div>
        <div class="settings" id="extrafields">
+               <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>
+               <div id="field_campsites">
                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'>
+               </div>
+               <select name='bedspaces' id='field_bedspaces'>
                        <option value=''><xsl:value-of 
select="php:function('lang', 'Select bedspaces')" />...</option>
                        <xsl:for-each select="resource/bedspaces/*">
                                <option value="{local-name()}">




reply via email to

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