#4 Missing Calender Sidebar

open
nobody
None
5
2014-08-17
2011-08-12
Anonymous
No

There was a bug with openrooms system - calendar on the left-hand-side does NOT show up in a consistent way. Sometimes, it shows up and sometimes it does not.

The problem was caused by an Ajax function pushes calendar html content to a placeholder that is not rendered yet.

in file modules/calendar.php, the div placeholder (id:calendarModule) was not rendered yet by the time of function ajaxFunction pushed calender content to it as innerhtml.

An easy fix was to render that div field before triggering the javascript function. (moving div from line 121 to line 6, please see the attachment for detail)

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-08-12
     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-08-12

    The bug was fixed at Georgia State University Library @ http://homer.gsu.edu/rooms

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-01

    I imagine this isn't restricted to calendar.php as I also did the same div re-jiggering on the following scripts:

    dayview.php
    login.php
    roomdetails.php

    Thanks for the heads up!

     
    Last edit: Anonymous 2014-11-07
  • Liz

    Liz - 2011-09-08

    Another issue I came across was not having the cal_days_in_month function available on my version of php (php 5.2.14). I included the following code starting at line 19 in calendarAJAX.php and made sure to place it before the cal_days_in_month function was called and now my calendar is displaying.

    //some older php versions don't have cal_days_in_month() - this code accounts for that
    if(!function_exists('cal_days_in_month')) {
    function cal_days_in_month ($calendar, $month, $year) {
    // $calendar just gets ignored, assume gregorian
    // calculate number of days in a month
    return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);
    }
    }

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks