Improving The Diary

Opus currently allows any article to be marked as a diary article and a location, date and, optionally a start and end time to be given to that article. These articles then appear in a pseudo-article with an article code of “diary”.

Jez and Denis have both asked for enhancements to this facility including the ability to span several days and to have repeating events. This page, and any more they care to add, will define how that should work.


My initial requirement is simply to add a “dateends” field to vp_article, to complement the existing datehappens, timestarts, timeends fields.

This would have implications for the following sources in Opus 2.27:

./adm/xfer.php → add dateends to fields processed

./bin/createdatabase.php → add dateends to fields processed

./bin/editarticle.php → New form field required (9 references to dateends)

./bin/reviewarticle.php → Minor tweak to show new field

./bin/updatearticle.php → Rework to support new field - (9 references to dateends) + make sure it's >= datehappens, or zero

./def/diarypage.inc → Currently, the time of the event is checked and the $timerange variable is setup with a “From” and “To” time range, as appropriate. In the context of a multi day event, this is either to be ignored, or will apply to all days. Perhaps an additional “timeflag” is required to determine whether times are valid or not on each article? Certainly a from and to date range needs to be added. It's worth bearing in mind that it's possible (and I have done) to drop a user defined diarypage.inc into the paper's directory (php/web etc).

./def/showdiary.php → Needs reworking, so that it would select any article where today is eithin the range of article dates

./inc/article_functions.inc → the update_article function needs to be updated (3 references) so that the new dateends field is saved. Ditto for the time flag, if we add one.


I would also like to make a change to diarypage.inc, so that $out_wsgc_article[“text”] is enclosed in a table. This stops articles that have an image in them from running into the <hr> tags between each month.


With regard to repeated events, the big issue here as far as I can see from the events diary page point of view, is that there is only one article, but it could appear many times, possibly without end. There would need to be a cut off after which the article is not repeated. Possibly the dateends field might be used for this purpose, or 6 months, whichever comes first. This implies that we'd need another switch to indicate that the article is a repeated diary event, and that the event is only ever one day long.

How we designate the repeat interval and how flexible that is requires further discussion, but I guess it could include a number of days, weeks or (calendar) months, a specific day/week of the month (2nd Tuesday of each month for example) and then maybe we might need to exclude bank holidays etc, (which probably calls for a separate table and maintenance routine to manage it)

The major changes would be in showdiary.php which I think would need to build a fake table of events, or use some other construct to fire the events one by one into diary_page_article() in diarypage.inc, but with additional arguments which would override the article date.


I'd also like to add a calendar object, which shows a month calendar with hyperlinks to the appropriate part of the main diary page (if more than one event on that day), or to the article itself (if just one). The effect is like the calendar seen at http://www.bbc.co.uk/blogs/tms/2008/06/ but without the previous month capability.

 
opus/improving_the_diary.txt · Last modified: 2008-07-06 12:02 by jez
 
The Hug Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki