[[PageOutline(2-5,Contents,pullout)]]
= Calendar view of Milestones and Tickets
{{{#!box warn
**Notice:** The code of this macro has been merged with WikiCalendarMacro for joined upstream development.
Development of the single-file macros is discontinued.
Make sure to change over to the packaged plugin code hosted within the [source:/wikicalendarmacro /wikicalendarmacro] domain to receive the latest improvements and bug fixes.
}}}
== Description
Macro for the Trac Wiki to display Milestones and Tickets from the Ticketing system in a calendar view. See screenshot (!WikiTicketCalendarMacro 1.2.0 & Trac 0.12) with different localizations (wikipage links and CSS style ticket tooltip) below:
[[Image(wikiticketcalendar_screenshot.gif)]]
A heavily modified version is used [https://wiki.ctdo.de/#DiesenMonatimCTDO here as event calendar], source unknown.
== Usage
The invocation for the screenshot above is `[[WikiTicketCalendar(*,*,true,Wochenberatung/%Y-%m-%d,true,Beratung)]]`.
Macro can be invoked in the following two basic ways:
A. "Simple"
{{{
[[WikiTicketCalendar([,,[,[,[,[,[,[,[]]]]]]]])]]
}}}
B. "Advanced"
{{{
[[WikiTicketCalendar([nav=(0|1)],[wiki=],
[cdate=(0|1)],[base=],[query=],
[short=],[width=[+]])]]
}}}
- equivalent keyword-argument available for all but first two arguments
- mixed use of keyword-arguments with simple arguments permitted,
but strict order of simple arguments (see above) still applies while
keyword-arguments in-between do not count for that positional mapping,
- query evaluates a valid TracQuery expression based on any ticket field
including multiple expressions grouped by 'and' and 'or'
=== Arguments
||'''Argument'''||'''Version'''||'''Description'''||'''Default'''||'''Example'''||
|| `year`|| || specifies the year to be shown, '*' current year || * || year=2011 ||
|| `month`|| || specifies the month to be shown, '*' current month || * || month=12 ||
|| `nav`|| || (1) show previous/next navigation or (0) not || 1 || nav=1 ||
|| `wiki`|| || strftime format for wiki pages to display as link (if exist, otherwise links to a create page) '*' for default. Supports any expression that strftime can handle || "%Y-%m-%d" || wiki="%Y-%m-%d" ||
|| `cdate`|| || (1) show ticket created / open dates [1,0] || 1 || cdate=1 ||
|| `base`|| ||wiki template tried to create new page || "" || base="" ||
|| `query`|| ||evaluates a valid TracQuery expression based on any ticket field including multiple expressions grouped by 'and' and 'or' || || query="id!=0" ||
|| `short`|| ||total ticket count per day, that'll have ticket list display condensed to just ticket no., 0 = never condense list. This feature looks like [attachment:wikiticketcalendar_screenshot_1-2-1.png this] [0,1,...] || 0 || short=0 ||
|| `width`|| ||set calendar table 'min-width', and optionally 'width' for surrounding div triggered by prepending '+' to value || 100% || width=100% ||
=== Examples
{{{
[[WikiTicketCalendar(2006,07)]]
[[WikiTicketCalendar(2006,07,false)]]
[[WikiTicketCalendar(*,*,true,Meeting-%Y-%m-%d)]]
[[WikiTicketCalendar(2006,07,false,Meeting-%Y-%m-%d)]]
[[WikiTicketCalendar(2006,07,true,*,true)]]
[[WikiTicketCalendar(2006,07,true,Meeting-%Y-%m-%d,true,Meeting)]]
[[WikiTicketCalendar(wiki=Talk-%Y-%m-%d,base=Talk)]]
equivalent to [[WikiTicketCalendar(*,*,true,Talk-%Y-%m-%d,true,Talk)]]
[[WikiTicketCalendar(wiki=Meeting-%Y-%m-%d,query=type=task&owner=wg1)]]
[[WikiTicketCalendar(wiki=Meeting_%Y/%m/%d,short=6)]]
[[WikiTicketCalendar(*,*,true,Meeting-%Y%m%d,width=+75%;)]]
}}}
'''Notes''':
1. All maintained versions of this macro support keyword arguments and mixed use of both - simple and keyword arguments - as well.
This could make macro invocations more readable and maybe even shorter than before, as long as you largely stick to the defaults and just want to change one or two values. So i.e. the 3rd example from above could be rewritten now as:
{{{
[[WikiTicketCalendar(wiki=Meeting-%Y-%m-%d)]]
}}}
2. The ''query'' keyword supports any expression supported by TracQuery. This is the single new ticket selection logic that can use custom field values as well for expressions chained by AND (OR since 0.12 only). An always-true expression was chosen on purpose to select and show all tickets by default. Use your own query expression to create per-developer or per-component ticket calendars,
or you could choose to display tickets only with high/highest priority, tickets with some special content in a custom field, etc.
== Bugs / Feature Requests
Existing bugs and feature requests for !WikiTicketCalendarMacro are
[query:status!=closed&component=WikiTicketCalendarMacro&order=priority here].
If you have any issue that is not found [query:component=WikiTicketCalendarMacro&order=priority there], create a
[/newticket?component=WikiTicketCalendarMacro new ticket].
Make sure to send feature requests for the macro bundle only, see WikiCalendarMacro.
[[TicketQuery(component=WikiCalendarMacro&group=type,format=progress)]]
[[Poll(What do you think of the WikiTicketCalendarMacro?; Great; Useful; Somewhat useful, but could be better; Useless; Horrible; Don't care/don't need such stuff)]]
== Source & Download
For the latest code see WikiCalendarMacro. Both macros have been merged.
=== Historic notes
These are the old instructions for enabling historic versions of the !WikiTicketCalendarMacro for Trac <= 0.11:
{{{#!ini
[components]
WikiTicketCalendarMacro.* = enabled
}}}
For Trac >= 0.12 and trunk branch with i18n support, which have a different code structure as a result of packaging:
{{{#!ini
[components]
wikiticketcalendar.* = enabled
}}}
The following configuration instructions apply only to the old code as well:
{{{#!ini
[wikiticketcalendar]
ticket.due_field.name = due_close
ticket.due_field.format = %y-%m-%d
}}}
* Note: these are the implicit default values to give backwards compatible behaviour.
* Real configuration examples:
* for a custom due date field named 'due-date' that holds US style date with 4-digit year:
{{{#!ini
[wikiticketcalendar]
ticket.due_field.name = due-date
ticket.due_field.format = %m/%d/%Y
}}}
* for a custom due date field named 'due_date' that holds true POSIX microsecond timestamps, see: [t:wiki:TracDev/Proposals/TracTicketsCustomTimeFields custom time fields proposal]:
{{{#!ini
[wikiticketcalendar]
ticket.due_field.name = due_date
ticket.due_field.format = ts
}}}
== Installation
Generic guidelines on installation and troubleshooting can be found at TracPlugins.
Steps to install and configure this plugin are:
1. '''Install'''
1. with `easy_install`:
{{{
#!sh
$ sudo easy_install https://trac-hacks.org/svn/wikicalendarmacro
}}}
1. '''Enable'''
* Update TracIni file (`..../trac.ini`) with:
{{{#!ini
[components]
wikicalendar.* = enabled
}}}
1. '''Configure'''
* The macro optionally makes use of an own configuration section, that could be placed into `trac.ini` as follows:
{{{#!ini
[wikicalendar]
ticket.due_field = due_close
ticket.due_field.format = %y-%m-%d
}}}
1. '''Restart''' web server:
{{{#!sh
$ sudo /etc/init.d/apache2 restart
}}}
The procedure above enables both, this macro as well as the WikiCalendarMacro.
Both macros are bundled in `wikicalendar-2.0.0` and later.
For historic versions the old instructions are preserved [#Historicnotes below].
== Recent Changes
[[ChangeLog(wikiticketcalendarmacro, 3)]]
== Author/Contributors
'''Author:''' [wiki:mcomb] [[BR]]
'''Maintainer:''' [[Maintainer]] [[BR]]
'''Contributors:''' Boris Savelev, [wiki:rjollos]