fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14043] fixing schedule


From: Saul
Subject: [Fmsystem-commits] [14043] fixing schedule
Date: Tue, 29 Sep 2015 00:45:59 +0000

Revision: 14043
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14043
Author:   psaul
Date:     2015-09-29 00:45:59 +0000 (Tue, 29 Sep 2015)
Log Message:
-----------
fixing schedule

Modified Paths:
--------------
    branches/dev-syncromind/booking/js/booking/schedule.js
    branches/dev-syncromind/booking/templates/base/building_schedule.xsl
    branches/dev-syncromind/booking/templates/base/massbooking_schedule.xsl
    branches/dev-syncromind/booking/templates/base/resource_schedule.xsl
    branches/dev-syncromind/booking/templates/base/season_wtemplate.xsl

Modified: branches/dev-syncromind/booking/js/booking/schedule.js
===================================================================
--- branches/dev-syncromind/booking/js/booking/schedule.js      2015-09-29 
00:37:55 UTC (rev 14042)
+++ branches/dev-syncromind/booking/js/booking/schedule.js      2015-09-29 
00:45:59 UTC (rev 14043)
@@ -27,7 +27,7 @@
         d.setDate(d.getDate() + i);
         var x = (i<6) ? i+1 : 0;
         schedule.dates[keys[x]] = d;
-        colDefs.push({key: keys[x], label: lang['WEEKDAYS_FULL'][x] + '<br>' + 
lang['MONTHS_LONG'][d.getMonth()] + ' ' + d.getDate(), formatter: 
'scheduleDateColumn', date: d});
+        colDefs.push({key: keys[x], label: lang['WEEKDAYS_FULL'][x] + '<br>' + 
lang['MONTHS_LONG'][d.getMonth()] + ' ' + d.getDate(), formatter: colFormatter, 
date: d});
     }
     var r = [{n: 'ResultSet'},{n: 'Result'}];
 //    createta d u c r cl
@@ -44,7 +44,6 @@
         changeYear: true,
         firstDay: 1,
         onSelect: function(a,e){
-            console.log(a);
             var date = new Date(a);
             schedule.updateSchedule(date);
         }
@@ -91,9 +90,7 @@
     date.setDate(date.getDate()+7);
     var url = self.location.href;
     url = url.substr(0, (url.indexOf("#date")));
-    console.log(url);
     url += '#date=' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 
date.getDate();
-    console.log(url);
     location.replace(url);
     location.reload();
 };

Modified: branches/dev-syncromind/booking/templates/base/building_schedule.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/building_schedule.xsl        
2015-09-29 00:37:55 UTC (rev 14042)
+++ branches/dev-syncromind/booking/templates/base/building_schedule.xsl        
2015-09-29 00:45:59 UTC (rev 14043)
@@ -58,7 +58,7 @@
             schedule.includeResource = true;
             var handleHistoryNavigation = function (state) {
                 schedule.date = parseISO8601(state);
-                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, schedule.backendScheduleColorFormatter, 
true);
+                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, 'backendScheduleDateColumn', true);
             };
 
             var initialRequest = getUrlData("date") || '<xsl:value-of 
select="building/date"/>';

Modified: 
branches/dev-syncromind/booking/templates/base/massbooking_schedule.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/massbooking_schedule.xsl     
2015-09-29 00:37:55 UTC (rev 14042)
+++ branches/dev-syncromind/booking/templates/base/massbooking_schedule.xsl     
2015-09-29 00:45:59 UTC (rev 14043)
@@ -1,9 +1,16 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
+    <style typ="text/css" rel="stylesheet">
+        #week-selector {list-style: outside none none;}
+        #week-selector li {display: inline-block;}
+        #cal_container {margin: 0 20px;}
+        #cal_container #datepicker {width: 2px;opacity: 0;position: 
absolute;display:none;}
+        #cal_container #numberWeek {width: 20px;display: inline-block;}
+    </style>
        <!--xsl:call-template name="yui_booking_i18n"/-->
        <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
        <input id="yui-history-field" type="hidden"/>
        
-    <div id="content">
+    <!--div id="content">
         <ul class="pathway">
             <li>
                 <a>
@@ -28,29 +35,78 @@
                </ul>
 
         <div id="schedule_container"/>
-    </div>
+    </div-->
+    
+    
+    
+    <xsl:call-template name="msgbox"/>
+    <form action="" method="POST" id="form" class="pure-form 
pure-form-aligned" name="form">
+        <input type="hidden" name="tab" value="" />
+        <div id="tab-content">
+            <xsl:value-of disable-output-escaping="yes" select="building/tabs" 
/>
+            <div id="massbooking_schedule">
+                <ul id="week-selector">
+                    <li><span class="pure-button pure-button-primary" 
onclick="schedule.prevWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Previous week')"/></span></li>
+                    <li id="cal_container">
+                        <div>
+                            <span><xsl:value-of select="php:function('lang', 
'Week')" />: </span>
+                            <label id="numberWeek"></label>
+                            <input type="text" id="datepicker" />
+                            <img id="pickerImg" 
src="/portico/phpgwapi/templates/base/images/cal.png" />
+                        </div>
+                    </li>
+                    <li><span class="pure-button pure-button-primary" 
onclick="schedule.nextWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Next week')"/></span></li>
+                </ul>
+                <div id="schedule_container"></div>
+            </div>
+        </div>
+    </form>
 
-<script type="text/javascript">
-YAHOO.util.Event.addListener(window, "load", function() {
-       YAHOO.booking.setupWeekPicker('cal_container');
-       YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
-       YAHOO.booking.newApplicationUrl = '<xsl:value-of 
select="building/application_link"/>';
+    <script type="text/javascript">
+        $(window).load(function() {
+            schedule.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
+            schedule.newApplicationUrl = '<xsl:value-of 
select="building/application_link"/>';
+            schedule.includeResource = true;
+            var handleHistoryNavigation = function (state) {
+                schedule.date = parseISO8601(state);
+                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, 'frontendScheduleDateColumn', 
schedule.includeResource);
+            };
+            
+            var initialRequest = getUrlData("date") || '<xsl:value-of 
select="building/date"/>';
+            
+            var state = getUrlData("date") || initialRequest;
+            if (state){
+                handleHistoryNavigation(state);
+                schedule.week = $.datepicker.iso8601Week(schedule.date);
+                $('#cal_container #numberWeek').text(schedule.week);
+                $("#cal_container #datepicker").datepicker("setDate", 
parseISO8601(state));
+            }
+        });
 
-    var handleHistoryNavigation = function (state) {
-               YAHOO.booking.date = parseISO8601(state);
-               YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.frontendScheduleColorFormatter, true);
-    };
-    var initialRequest = YAHOO.util.History.getBookmarkedState("date") || 
'<xsl:value-of select="building/date"/>';
-    YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
-    YAHOO.util.History.onReady(function() {
-               var state = YAHOO.util.History.getBookmarkedState("date") || 
initialRequest;
-               if(state)
-                       handleHistoryNavigation(state);
-    });
-       YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");       
-});
-<xsl:if test="backend = 'true'">
-       YAHOO.util.Dom.setStyle(('header'), 'display', 'none');
-</xsl:if>
-</script>
+
+        /*
+        YAHOO.util.Event.addListener(window, "load", function() {
+                YAHOO.booking.setupWeekPicker('cal_container');
+                YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
+                YAHOO.booking.newApplicationUrl = '<xsl:value-of 
select="building/application_link"/>';
+
+            var handleHistoryNavigation = function (state) {
+                        YAHOO.booking.date = parseISO8601(state);
+                        YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.frontendScheduleColorFormatter, true);
+            };
+            var initialRequest = YAHOO.util.History.getBookmarkedState("date") 
|| '<xsl:value-of select="building/date"/>';
+            YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
+            YAHOO.util.History.onReady(function() {
+                        var state = 
YAHOO.util.History.getBookmarkedState("date") || initialRequest;
+                        if(state)
+                                handleHistoryNavigation(state);
+            });
+                YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");      
+        });
+        */
+        <xsl:if test="backend = 'true'">
+            $('#header').hide();
+                /*YAHOO.util.Dom.setStyle(('header'), 'display', 'none');*/
+        </xsl:if>
+    </script>
 </xsl:template>

Modified: branches/dev-syncromind/booking/templates/base/resource_schedule.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/resource_schedule.xsl        
2015-09-29 00:37:55 UTC (rev 14042)
+++ branches/dev-syncromind/booking/templates/base/resource_schedule.xsl        
2015-09-29 00:45:59 UTC (rev 14043)
@@ -64,7 +64,7 @@
             schedule.includeResource = false;
             var handleHistoryNavigation = function (state) {
                 schedule.date = parseISO8601(state);
-                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, schedule.backendScheduleColorFormatter, 
false);
+                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, 'backendScheduleDateColumn', 
schedule.includeResource);
             };
 
             var initialRequest = getUrlData("date") || '<xsl:value-of 
select="resource/date"/>';

Modified: branches/dev-syncromind/booking/templates/base/season_wtemplate.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/season_wtemplate.xsl 
2015-09-29 00:37:55 UTC (rev 14042)
+++ branches/dev-syncromind/booking/templates/base/season_wtemplate.xsl 
2015-09-29 00:45:59 UTC (rev 14043)
@@ -1,4 +1,11 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
+    <style typ="text/css" rel="stylesheet">
+        #week-selector {list-style: outside none none;}
+        #week-selector li {display: inline-block;}
+        #cal_container {margin: 0 20px;}
+        #cal_container #datepicker {width: 2px;opacity: 0;position: 
absolute;display:none;}
+        #cal_container #numberWeek {width: 20px;display: inline-block;}
+    </style>
     <!--div id="content">
         <ul class="pathway">
                 <li><a href="{season/buildings_link}"><xsl:value-of 
select="php:function('lang', 'Buildings')" /></a></li>
@@ -9,28 +16,64 @@
 
     <xsl:call-template name="msgbox"/>
     <!--xsl:call-template name="yui_booking_i18n"/-->
+    
+    <div class="pure-form">
+        <input type="hidden" name="tab" value="" />
+        <div id="tab-content">
+            <xsl:value-of disable-output-escaping="yes" select="season/tabs" />
+            <div id="season_wtemplate">
+                <fieldset>
+                    <div class="pure-g">
+                        <div class="pure-u-1">
+                            <div class="heading"></div>
+                            <div clas="pure-control-group">
+                                <!--ul id="week-selector">
+                                    <li><span class="pure-button 
pure-button-primary" onclick="schedule.prevWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Previous week')"/></span></li>
+                                    <li id="cal_container">
+                                        <div>
+                                            <span><xsl:value-of 
select="php:function('lang', 'Week')" />: </span>
+                                            <label id="numberWeek"></label>
+                                            <input type="text" id="datepicker" 
/>
+                                            <img id="pickerImg" 
src="/portico/phpgwapi/templates/base/images/cal.png" />
+                                        </div>
+                                    </li>
+                                    <li><span class="pure-button 
pure-button-primary" onclick="schedule.nextWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Next week')"/></span></li>
+                                </ul-->
+                                <div id="schedule_container"></div>
+                            </div>                            
 
-        <dl class="form">
-            <dt class="heading"><xsl:value-of select="php:function('lang', 
'Week Template')" /></dt>
-               </dl>
+                            <form action="" method="POST" id="form" 
class="pure-form pure-form-aligned" name="form"></form>
+                            
+                                
+                            
+                        </div>
+                    </div>
+                </fieldset>
+            </div>
+        </div>
+        <xsl:if test="season/permission/write">
+            <div class="pure-control-group">   
+                <div class="form-buttons">
+                    <button onclick="YAHOO.booking.dialog.newAllocation(); 
return false;"><xsl:value-of select="php:function('lang', 'New allocation')" 
/></button>
+                    <button>
+                        <xsl:attribute 
name="onclick">window.location.href="<xsl:value-of 
select="season/generate_url"/>"</xsl:attribute>
+                        <xsl:value-of select="php:function('lang', 'Generate 
allocations')" />
+                    </button>
+                    <a class="cancel">
+                        <xsl:attribute name="href"><xsl:value-of 
select="season/cancel_link"/></xsl:attribute>
+                        <xsl:value-of select="php:function('lang', 'Back to 
season')"/>
+                    </a>
+                </div>
+            </div>
+        </xsl:if>
+        
+    </div>
 
-               <div id="schedule_container"/>
+
                
-               <xsl:if test="season/permission/write"> 
-                       <div class="form-buttons">
-                               <button 
onclick="YAHOO.booking.dialog.newAllocation(); return false;"><xsl:value-of 
select="php:function('lang', 'New allocation')" /></button>
-                               <button>
-                                       <xsl:attribute 
name="onclick">window.location.href="<xsl:value-of 
select="season/generate_url"/>"</xsl:attribute>
-                                       <xsl:value-of 
select="php:function('lang', 'Generate allocations')" />
-                               </button>
-                               <a class="cancel">
-                                       <xsl:attribute 
name="href"><xsl:value-of select="season/cancel_link"/></xsl:attribute>
-                                       <xsl:value-of 
select="php:function('lang', 'Back to season')"/>
-                               </a>
-                       </div>
-               </xsl:if>
                
-               <form id="panel1" method="POST">
+               
+               <!--form id="panel1" method="POST">
                        <xsl:attribute name="action"><xsl:value-of 
select="season/post_url"/></xsl:attribute>
                        <div class="hd"><xsl:value-of 
select="php:function('lang', 'Allocations')" /></div>
                        <div class="bd">
@@ -83,11 +126,34 @@
                                </dl>
                                <div class="clr"/>
                        </div>
-               </form>
+               </form-->
 
        <!--/div-->
 
-<script type="text/javascript">
+    <script type="text/javascript">
+        var season_id = <xsl:value-of select="season/id"/>;
+        var resource_ids = <xsl:value-of select="season/resources_json"/>;
+        var r = [{n: 'ResultSet'},{n: 'Result'}];
+        <![CDATA[
+            var weekUrl = 
'index.php?menuaction=booking.uiseason.wtemplate_json&id=' + season_id + 
'&phpgw_return_as=json&';
+        ]]>
+        $(window).load(function() {
+            var colDefs = [
+                {key: 'time', label: '<xsl:value-of 
select="php:function('lang', 'Time')" />'}, 
+                {key: 'resource', label: '<xsl:value-of 
select="php:function('lang', 'Resources')" />', formatter: 
'scheduleResourceColumn'},
+                {key: '1', label: '<xsl:value-of select="php:function('lang', 
'Monday')" />', formatter: 'scheduleDateColumn'},
+                {key: '2', label: '<xsl:value-of select="php:function('lang', 
'Tuesday')" />', formatter: 'scheduleDateColumn'},
+                {key: '3', label: '<xsl:value-of select="php:function('lang', 
'Wednesday')" />', formatter: 'scheduleDateColumn'},
+                {key: '4', label: '<xsl:value-of select="php:function('lang', 
'Thursday')" />', formatter: 'scheduleDateColumn'},
+                {key: '5', label: '<xsl:value-of select="php:function('lang', 
'Friday')" />', formatter: 'scheduleDateColumn'},
+                {key: '6', label: '<xsl:value-of select="php:function('lang', 
'Saturday')" />', formatter: 'scheduleDateColumn'},
+                {key: '7', label: '<xsl:value-of select="php:function('lang', 
'Sunday')" />', formatter: 'scheduleDateColumn'}
+            ];
+            createTableSchedule('schedule_container', weekUrl, colDefs, r, 
'pure-table' );
+        });
+    </script>
+
+<!--script type="text/javascript">
 var season_id = <xsl:value-of select="season/id"/>;
 var resource_ids = <xsl:value-of select="season/resources_json"/>;
 <![CDATA[
@@ -251,7 +317,7 @@
        YAHOO.booking.dialog = new YAHOO.booking.AllocationDialog('panel1');
        YAHOO.booking.updateSchedule();
 });
-</script>
+</script-->
 
 <xsl:if test="not(season/permission/write)">
        <script type="text/javascript">




reply via email to

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