Forum .LRN Q&A: Re: Changing Schedule Properties

Collapse
Posted by Dirk Gomez on
Which version of DotLrn and/or calendar?

Which particular calendar-portlet or which calendar view is troubling you?

Collapse
Posted by Bruce Spear on
Hi!  Thanks for the reply.  I've installed the 1.0 version I downloaded about two weeks ago, the file dated September 10. I don't know how to find a more detailed version number.  Ditto the calendar-portlet: this was a straight-forward install, using only the applications that came with this distribution and no modules loaded separetely.  I've just installed this system and was sitting beside my client as she set up a class, successfully uploaded a syllabus and files, and then calendar entries for October and later.  The entries for October 24 and 29 appear in the Schedule module, but not for Octber 31.  The Schedule header says:
"Items from August 31, 2003 to October 30, 2003" and she would like to see all the entries until the end of the term, in February.  I suspect that there is a sql select statement somewhere deep in the belly of the .lrn beast, but until I learn more about the program I don't know where to find it.  In the meantime, I was hoping there was a parameter somewhere I might change and that someone might know where I might put my fingers on it.  I thought maybe in the admin/site-map, but I can't find anything there.  Thanks for the help!  Bruce
Collapse
Posted by Dirk Gomez on

You need to change that in the calendar-portlet files.

E.g. have a look at calendar-full-portlet.tcl, you'll find this code snippet:

if {$view == "list"} {
    set sort_by [ns_queryget sort_by]

    set thirty_days [expr 60*60*24*30]
    set start_date [ns_fmttime [expr [ns_time] - $thirty_days] "%Y-%m-%d 00:00"]
    set end_date [ns_fmttime [expr [ns_time] + $thirty_days] "%Y-%m-%d 00:00"]

    set cal_stuff [calendar::list_display \
            -item_template $item_template \
            -date $current_date \
            -start_date $start_date \
            -end_date $end_date \
            -calendar_id_list $list_of_calendar_ids \
            -sort_by $sort_by \
            -url_template "?view=list&sort_by=\$order_by&page_num=$page_num" \
            -url_stub_callback "calendar_portlet_display::get_url_stub" \
            -show_calendar_name_p $show_calendar_name_p]
}

Change the end_date creation to whatever you want.

In what is DotLrn alpha (or beta?) there's a field "Show the next xxx days" that lets you choose how many days you want. May make sense to store that as a calendar-portlet parameter - but that is more like 5.1.

Collapse
Posted by Dirk Gomez on
Forgot to add this: do this change consistently on all calendar-portlet files that call list_display.