fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10723] Calendar view when no location is selected


From: Torstein
Subject: [Fmsystem-commits] [10723] Calendar view when no location is selected
Date: Tue, 29 Jan 2013 11:00:47 +0000

Revision: 10723
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10723
Author:   vator
Date:     2013-01-29 11:00:46 +0000 (Tue, 29 Jan 2013)
Log Message:
-----------
Calendar view when no location is selected

Modified Paths:
--------------
    trunk/controller/templates/base/calendar/calendar_month_no_loc.xsl
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl

Modified: trunk/controller/templates/base/calendar/calendar_month_no_loc.xsl
===================================================================
--- trunk/controller/templates/base/calendar/calendar_month_no_loc.xsl  
2013-01-29 10:06:12 UTC (rev 10722)
+++ trunk/controller/templates/base/calendar/calendar_month_no_loc.xsl  
2013-01-29 11:00:46 UTC (rev 10723)
@@ -51,7 +51,7 @@
        var currentYear = $("#currentYear").val();
        var currentMonth = $("#currentMonth").val();
 
-       var oArgs = {menuaction:'controller.uicalendar.view_calendar_for_year'};
+       var oArgs = 
{menuaction:'controller.uicalendar.view_calendar_for_month'};
        var baseUrl = phpGWLink('index.php', oArgs, false);
        var requestUrl = baseUrl +  "&location_code=" + value + 
"&year=" + currentYear + "&month=" + currentMonth;
 

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2013-01-29 10:06:12 UTC (rev 10722)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2013-01-29 11:00:46 UTC (rev 10723)
@@ -4,62 +4,63 @@
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
        <script>
-               <xsl:text>
+<xsl:text>
 
-                       $(document).ready(function(){
+$(document).ready(function(){
 
-                       var oArgs = 
{menuaction:'property.bolocation.get_locations_by_name'};
-                       var baseUrl = phpGWLink('index.php', oArgs, false);
+       var oArgs = {menuaction:'property.bolocation.get_locations_by_name'};
+       var baseUrl = phpGWLink('index.php', oArgs, false);
 
-                       var location_type = $("#loc_type").val();
+       var location_type = $("#loc_type").val();
 
-                       $("#search-location-name").autocomplete({
-                       source: function( request, response ) {
+       $("#search-location-name").autocomplete({
+               source: function( request, response ) {
                        location_type = $("#loc_type").val();
-
+               
                        $.ajax({
-                       url: baseUrl,
-                       dataType: "json",
-                       data: {
-                       location_name: request.term,
-                       level: location_type,
-                       phpgw_return_as: "json"
-                       },
-                       success: function( data ) {
-                       response( $.map( data, function( item ) {
-                       return {
-                       label: item.name,
-                       value: item.location_code
-                       }
-                       }));
-                       }
+                               url: baseUrl,
+                               dataType: "json",
+                               data: {
+                                       location_name: request.term,
+                                       level: location_type,
+                                       phpgw_return_as: "json"
+                               },
+                               success: function( data ) {
+                                       response( $.map( data, function( item ) 
{
+                                               return {
+                                                       label: item.name,
+                                                       value: 
item.location_code
+                                               }
+                                       }));
+                               }
                        });
-                       },
-                       focus: function (event, ui) {
-                       $(event.target).val(ui.item.label);
-                       return false;
-                       },
-                       minLength: 1,
-                       select: function( event, ui ) {
-                       chooseLocation( ui.item.label, ui.item.value);
-                       }
-                       });
-                       });
-                       function chooseLocation( label, value ){
-                       var currentYear = $("#currentYear").val();
-                       var currentMonth = $("#currentMonth").val();
+               },
+               focus: function (event, ui) {
+                       $(event.target).val(ui.item.label);
+                       return false;
+               },
+               minLength: 1,
+               select: function( event, ui ) {
+                 chooseLocation( ui.item.label, ui.item.value);
+               }
+       });
+});
 
-                       var oArgs = 
{menuaction:'controller.uicalendar.view_calendar_for_year'};
-                       var baseUrl = phpGWLink('index.php', oArgs, false);
-                       var requestUrl = baseUrl +  "&amp;location_code=" + 
value + "&amp;year=" + currentYear + "&amp;month=" + currentMonth;
+function chooseLocation( label, value ){
+       var currentYear = $("#currentYear").val();
+       var currentMonth = $("#currentMonth").val();
+       
+       var oArgs = 
{menuaction:'controller.uicalendar.view_calendar_for_month'};
+       var baseUrl = phpGWLink('index.php', oArgs, false);
+       var requestUrl = baseUrl +  "&amp;location_code=" + value + 
"&amp;year=" + currentYear + "&amp;month=" + currentMonth;
+       
+       window.location.replace(requestUrl);
+}
 
-                       window.location.replace(requestUrl);
-                       }
+</xsl:text>
 
-               </xsl:text>
+</script>
 
-       </script>
-
        <div id="main_content">
                <div id="control_plan" class="month_view">
                        <div class="top">
@@ -403,4 +404,4 @@
                        </div>
                </div>
        </div>
-</xsl:template>
+</xsl:template>
\ No newline at end of file

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2013-01-29 10:06:12 UTC (rev 10722)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2013-01-29 11:00:46 UTC (rev 10723)
@@ -2,59 +2,61 @@
 <xsl:variable name="session_url">&amp;<xsl:value-of 
select="php:function('get_phpgw_session_url')" /></xsl:variable>
 
        <script>
-               <xsl:text>
+<xsl:text>
 
-                       $(document).ready(function(){
+$(document).ready(function(){
 
-                       var oArgs = 
{menuaction:'property.bolocation.get_locations_by_name'};
-                       var baseUrl = phpGWLink('index.php', oArgs, false);
+       var oArgs = {menuaction:'property.bolocation.get_locations_by_name'};
+       var baseUrl = phpGWLink('index.php', oArgs, false);
 
-                       var location_type = $("#loc_type").val();
+       var location_type = $("#loc_type").val();
 
-                       $("#search-location-name").autocomplete({
-                       source: function( request, response ) {
+       $("#search-location-name").autocomplete({
+               source: function( request, response ) {
                        location_type = $("#loc_type").val();
-
+               
                        $.ajax({
-                       url: baseUrl,
-                       dataType: "json",
-                       data: {
-                       location_name: request.term,
-                       level: location_type,
-                       phpgw_return_as: "json"
-                       },
-                       success: function( data ) {
-                       response( $.map( data, function( item ) {
-                       return {
-                       label: item.name,
-                       value: item.location_code
-                       }
-                       }));
-                       }
+                               url: baseUrl,
+                               dataType: "json",
+                               data: {
+                                       location_name: request.term,
+                                       level: location_type,
+                                       phpgw_return_as: "json"
+                               },
+                               success: function( data ) {
+                                       response( $.map( data, function( item ) 
{
+                                               return {
+                                                       label: item.name,
+                                                       value: 
item.location_code
+                                               }
+                                       }));
+                               }
                        });
-                       },
-                       focus: function (event, ui) {
-                       $(event.target).val(ui.item.label);
-                       return false;
-                       },
-                       minLength: 1,
-                       select: function( event, ui ) {
-                       chooseLocation( ui.item.label, ui.item.value);
-                       }
-                       });
-                       });
+               },
+               focus: function (event, ui) {
+                       $(event.target).val(ui.item.label);
+                       return false;
+               },
+               minLength: 1,
+               select: function( event, ui ) {
+                 chooseLocation( ui.item.label, ui.item.value);
+               }
+       });
+});
 
-                       function chooseLocation( label, value ){
-                       var currentYear = $("#currentYear").val();
+function chooseLocation( label, value ){
+       var currentYear = $("#currentYear").val();
+       
+       var oArgs = {menuaction:'controller.uicalendar.view_calendar_for_year'};
+       var baseUrl = phpGWLink('index.php', oArgs, false);
+       var requestUrl = baseUrl +  "&amp;location_code=" + value + 
"&amp;year=" + currentYear;
+       
+       window.location.replace(requestUrl);
+}
 
-                       var oArgs = 
{menuaction:'controller.uicalendar.view_calendar_for_year'};
-                       var baseUrl = phpGWLink('index.php', oArgs, false);
-                       var requestUrl = baseUrl +  "&amp;location_code=" + 
value + "&amp;year=" + currentYear;
+</xsl:text>
 
-                       window.location.replace(requestUrl);
-                       }
-               </xsl:text>
-       </script>
+</script>
 
        <div id="main_content">
                <div id="control_plan">




reply via email to

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