[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14644] more on bookingfrontend
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [14644] more on bookingfrontend |
Date: |
Thu, 14 Jan 2016 13:07:55 +0000 |
Revision: 14644
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14644
Author: sigurdne
Date: 2016-01-14 13:07:54 +0000 (Thu, 14 Jan 2016)
Log Message:
-----------
more on bookingfrontend
Modified Paths:
--------------
branches/dev-syncromind/bookingfrontend/inc/class.bosearch.inc.php
branches/dev-syncromind/bookingfrontend/inc/class.uisearch.inc.php
branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js
branches/dev-syncromind/bookingfrontend/setup/phpgw_no.lang
branches/dev-syncromind/bookingfrontend/templates/base/search.xsl
Modified: branches/dev-syncromind/bookingfrontend/inc/class.bosearch.inc.php
===================================================================
--- branches/dev-syncromind/bookingfrontend/inc/class.bosearch.inc.php
2016-01-13 19:50:20 UTC (rev 14643)
+++ branches/dev-syncromind/bookingfrontend/inc/class.bosearch.inc.php
2016-01-14 13:07:54 UTC (rev 14644)
@@ -48,7 +48,7 @@
$_filter_building['part_of_town_id'] =
$filter_part_of_town;
- if($filter_top_level && !$building_id)
+ if($filter_top_level && !$building_id && !$searchterm)
{
$buildings =
$this->sobuilding->get_buildings_from_activity($filter_top_level);
$_filter_building['id'] = $buildings;
@@ -107,7 +107,7 @@
$_filter_resource['filter_top_level'] =
$filter_top_level;
}
- if($building_filter)
+ if($building_filter && !$searchterm)
{
$_filter_resource['building_id'] =
$building_filter;
}
@@ -116,7 +116,7 @@
{
$_filter_resource['building_id'][] =
$building_id;
}
- if(isset($filter_part_of_town) &&
$filter_part_of_town && !$bui_result)
+ if(isset($filter_part_of_town) &&
$filter_part_of_town)// && !$bui_result)
{
$_bui_result =
$this->sobuilding->read(array("filters" => $_filter_building));
foreach($_bui_result['results'] as
$_bui)
@@ -146,7 +146,7 @@
'filter_owner_id' =>
$res['id'], 'phpgw_return_as' => 'json', 'results' => '1'));
}
- if($bui_result)
+ if(isset($bui_result['total_records']) &&
$bui_result['total_records'] > 0)
{
$_bui_result = array(
'total_records' =>
count($_resource_buildings),
Modified: branches/dev-syncromind/bookingfrontend/inc/class.uisearch.inc.php
===================================================================
--- branches/dev-syncromind/bookingfrontend/inc/class.uisearch.inc.php
2016-01-13 19:50:20 UTC (rev 14643)
+++ branches/dev-syncromind/bookingfrontend/inc/class.uisearch.inc.php
2016-01-14 13:07:54 UTC (rev 14644)
@@ -65,7 +65,7 @@
$top_levels = array();
$filter_tree = array();
- foreach($activities as &$activity)
+ foreach($activities as $activity)
{
$top_levels[] = array(
'id' => $activity['id'],
@@ -78,18 +78,13 @@
'building_id' =>
$building_id,
'filter_part_of_town' =>
$imploded_filter_part_of_town));
- $dummy_sub = array();
$organized_fields =
$GLOBALS['phpgw']->custom_fields->get_attribute_tree('booking',
".resource.{$activity['id']}", 0, $activity['id']);
if(!$organized_fields)
{
continue;
-// $dummy_sub[] = array(
-// 'text' =>
$activity['name'],
-// 'activity_top_level' =>
$activity['id'],
-// );
}
$filter_tree[] = array(
- 'text' => $activity['id'] ==
$activity_top_level ? "[{$activity['name']}]" : $activity['name'],
+ 'text' => $activity['name'],
'state' => array(
'opened'
=> false,
'selected'
=> $activity['id'] == $activity_top_level ? true : false,
@@ -104,7 +99,7 @@
// ),
'activity_top_level' => $activity['id'],
'activity_location' =>
"resource_{$activity['id']}",
-// 'children' =>
array_merge($dummy_sub,$organized_fields),
+// 'id' => "resource_{$activity['id']}",
'children' => $organized_fields,
);
}
@@ -152,6 +147,15 @@
}
unset($value);
+ if(!$filter_top_level)
+ {
+ $activities =
ExecMethod('booking.boactivity.get_top_level');
+ foreach($activities as $activity)
+ {
+ $filter_top_level[] = $activity['id'];
+ }
+ }
+
$criteria = phpgw::get_var('criteria', 'string',
'REQUEST', array());
$activity_criteria = array();
foreach($criteria as $entry)
Modified: branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js
===================================================================
--- branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js
2016-01-13 19:50:20 UTC (rev 14643)
+++ branches/dev-syncromind/bookingfrontend/js/bookingfrontend/search.js
2016-01-14 13:07:54 UTC (rev 14644)
@@ -10,6 +10,13 @@
var selected_criteria = [];
$(document).ready(function () {
+
+ $("#loading").dialog({
+ hide: 'slide',
+// show: 'slide',
+ autoOpen: false
+});
+
update_autocompleteHelper = function () {
oArgs = {
menuaction: 'bookingfrontend.uibuilding.index',
@@ -19,19 +26,23 @@
JqueryPortico.autocompleteHelper(requestUrl,
'field_building_name', 'field_building_id', 'building_container');
}
+ $("#submit_searchterm").on('click', function () {
+ update_search(selected_criteria, true);
+ });
$("#search_type :checkbox").on('click', function () {
update_search(selected_criteria, true);
});
+ $("#top_level :checkbox").on('click', function () {
+ update_search(selected_criteria, true);
+
+ });
+
$("#part_of_town :checkbox").on('click', function () {
selected_building_id = null;
update_search(selected_criteria);
});
- $("#top_level :checkbox").on('click', function () {
- update_search(selected_criteria);
-
- });
//initate autocomplete;
update_autocompleteHelper();
@@ -40,6 +51,7 @@
core: {
multiple: true,
data: filter_tree,
+ check_callback : true,
themes: {"stripes": true}
},
checkbox: {whole_node: true, three_state: false, cascade:
"up+down+undetermined"},
@@ -54,7 +66,7 @@
}
update_activity_top_level(data, true);
- update_search(selected_criteria);
+ update_search(selected_criteria, true);
});
@@ -66,12 +78,12 @@
}
update_activity_top_level(data, false);
- update_search(selected_criteria);
+ update_search(selected_criteria, true);
});
update_activity_top_level = function (data, deselect) {
-
+//console.log(data);
var parents = data.node.parents;
var level = parents.length;
// var activity_top_level = 0;
@@ -140,9 +152,22 @@
part_of_town_string = part_of_towns.join(',');
top_levels = [];
- $("#top_level :checkbox:checked").each(function () {
- top_levels.push($(this).val());
+// $("#top_level :checkbox:checked").each(function () {
+// top_levels.push($(this).val());
+// });
+
+ $("#top_level :checkbox").each(function () {
+ if($(this).prop("checked") == true)
+ {
+ top_levels.push($(this).val());
+ }
+ else
+ {
+// Not working
+// $("#treeDiv1").jstree("uncheck_node", "j1_" +
$(this).val());
+ }
});
+
top_level_string = top_levels.join(',');
@@ -164,11 +189,16 @@
requestUrl += '&phpgw_return_as=stripped_html';
$.ajax({
type: 'POST',
- data: {criteria: criteria},
+ data: {criteria: criteria, searchterm:
$("#field_searchterm").val()},
url: requestUrl,
+ beforeSend: function(){
+ $("#loading").dialog('open');
+ },
success: function (data) {
if (data != null)
{
+ $("#loading").dialog('close');
+// $('#loading').html("<p>Result Complete...</p>");
$("#no_result").html('');
$("#result").html(data);
}
@@ -187,6 +217,12 @@
$('#treeDiv1').jstree('open_all');
});
+ $('#reset').on('click', function () {
+ $(this).attr('href', 'javascript:;');
+ selected_building_id = null;
+ update_search(selected_criteria);
+ });
+
});
$(window).load(function () {
Modified: branches/dev-syncromind/bookingfrontend/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind/bookingfrontend/setup/phpgw_no.lang 2016-01-13
19:50:20 UTC (rev 14643)
+++ branches/dev-syncromind/bookingfrontend/setup/phpgw_no.lang 2016-01-14
13:07:54 UTC (rev 14644)
@@ -1,4 +1,7 @@
part of town common no Bydel
+fetching data bookingfrontend no Henter data
+please wait bookingfrontend no Vent litt...
+I am feeling lucky bookingfrontend no Jeg prøver lykken
current activities bookingfrontend no Aktiviteter
-- select an activity -- bookingfrontend no Velg en aktivitet
why? bookingfrontend no Hvorfor?
Modified: branches/dev-syncromind/bookingfrontend/templates/base/search.xsl
===================================================================
--- branches/dev-syncromind/bookingfrontend/templates/base/search.xsl
2016-01-13 19:50:20 UTC (rev 14643)
+++ branches/dev-syncromind/bookingfrontend/templates/base/search.xsl
2016-01-14 13:07:54 UTC (rev 14644)
@@ -2,143 +2,177 @@
<script type="text/javascript">
// var selected_part_of_towns = "<xsl:value-of
select="selected_part_of_towns"/>";
</script>
+ <div id="loading">
+ <xsl:attribute name="title">
+ <xsl:value-of select="php:function('lang', 'fetching
data')" />
+ </xsl:attribute>
+ <p>
+ <xsl:value-of select="php:function('lang', 'please
wait')" />
+ </p>
+ </div>
<div id="content">
<form action="" method="GET" id="search">
<input type="hidden" id="menuaction" name="menuaction"
value="bookingfrontend.uisearch.index" />
- <input type="hidden" id="activity_top_level"
name="activity_top_level" value="{activity_top_level}" />
- <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>
-
- </input>
- </div>
- <!--xsl:text> </xsl:text><input type="submit"
value="{php:function('lang', 'Search')}"/-->
- <div class="hint">
- F.eks. "<i>Haukelandshallen</i>", "<i>Nordnes
bydelshus</i>", "<i>idrett</i>" eller "<i>kor</i>".
- </div>
+ <!--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-4">
- <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"/>
- <xsl:value-of
select="php:function('lang', 'building')" />
- </label>
- </li>
- <li>
- <label>
- <input type="checkbox"
name="search_type[]" value="resource"/>
- <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-4">
- <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">
+ <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="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="building" checked="checked="/>
+ <xsl:value-of
select="php:function('lang', 'building')" />
</label>
</li>
- </xsl:for-each>
- </ul>
- </div>
- <div class="pure-u-1-4">
- <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"/>
+ <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>
+ <!--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">
+ <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>
- <div class="pure-u-1-4" id="activity_tree">
- <div class="heading">
- <xsl:value-of select="php:function('lang',
'Resource')" />
+ <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>
- <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 class="pure-u-1 pure-u-lg-1-3">
+ <div class="heading">
+ <xsl:value-of
select="php:function('lang', 'part of town')" />
</div>
- <div id="treeDiv1"></div>
- </fieldset>
+ <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 pure-u-lg-1-3">
+ <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>
+
+ </input>
+ </div>
+ <!--xsl:text> </xsl:text><input type="submit"
value="{php:function('lang', 'Search')}"/-->
+ <div class="hint">
+ F.eks. "<i>Haukelandshallen</i>",
"<i>Nordnes bydelshus</i>".
+ </div>
+ <br/>
+ <a id="reset" title="Reset" href="#">
+ <xsl:value-of
select="php:function('lang', 'reset')"/>
+ </a>
+
+ </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')" />
+ </div>
+ <input id="field_searchterm"
name="searchterm" type="text">
+ <xsl:attribute name="value">
+ <xsl:value-of
select="searchterm"/>
+ </xsl:attribute>
+ <xsl:attribute
name="placeholder">
+ <xsl:text>
Fritekst</xsl:text>
+ </xsl:attribute>
+ </input>
+ <xsl:text> </xsl:text>
+ <input id="submit_searchterm" type="button"
value="{php:function('lang', 'Search')}"/>
+ </div>
+
</div>
- </div>
<div id="no_result">
<xsl:if test="not(search)">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14644] more on bookingfrontend,
Sigurd Nes <=