issue69, fixed calendar matrix always starting with the current time
authorAndreas Unterkircher <unki@netshadow.at>
Sat, 28 Jul 2007 07:10:25 +0000 (07:10 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sat, 28 Jul 2007 07:10:25 +0000 (07:10 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@260 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.js
rpc.php

index 17cf1095e0b45f2f239918ae902e704013ccca9e..6671eb2cb1914a49a4da406cf0bd446055358038 100644 (file)
@@ -209,6 +209,8 @@ function getPhotoToShow()
 function showCalendar(date_box, click_obj)
 {
    var calendar = document.getElementById('calendar');
 function showCalendar(date_box, click_obj)
 {
    var calendar = document.getElementById('calendar');
+   var year = document.getElementById(date_box+'year').value;
+   var month = document.getElementById(date_box+'month').value;
    if(date_box == 'from') {
       var xpos = document.getElementById('frompic').offsetLeft;
       var ypos = document.getElementById('frompic').offsetTop;
    if(date_box == 'from') {
       var xpos = document.getElementById('frompic').offsetLeft;
       var ypos = document.getElementById('frompic').offsetTop;
@@ -225,7 +227,7 @@ function showCalendar(date_box, click_obj)
    if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
       calendar.style.visibility = 'visible';
       calendar.innerHTML = "Loading...";
    if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
       calendar.style.visibility = 'visible';
       calendar.innerHTML = "Loading...";
-      calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix'));
+      calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix&year=' + year + '&month=' + month));
       calendar_shown = 1;
    }
    else {
       calendar_shown = 1;
    }
    else {
diff --git a/rpc.php b/rpc.php
index 4ffae5f5fbddd3cc58884f25c3136e8abcd809e2..d0a6c1c9e088ea68c96153a30705fee9af1371a8 100644 (file)
--- a/rpc.php
+++ b/rpc.php
@@ -107,9 +107,9 @@ class PHPFSPOT_RPC {
             break;
 
          case 'get_calendar_matrix':
             break;
 
          case 'get_calendar_matrix':
-            if((is_numeric($_GET['year']) || $_GET['year'] == "") &&
-               (is_numeric($_GET['month']) || $_GET['month'] == "") &&
-               (is_numeric($_GET['day']) || $_GET['month'] == "")) {
+            if((is_numeric($_GET['year']) || !isset($_GET['year'])) &&
+               (is_numeric($_GET['month']) || !isset($_GET['month'])) &&
+               (is_numeric($_GET['day']) || !isset($_GET['day']))) {
                $fspot->get_calendar_matrix($_GET['year'], $_GET['month'], $_GET['day']);
             }
             break;
                $fspot->get_calendar_matrix($_GET['year'], $_GET['month'], $_GET['day']);
             }
             break;