list.ics.tmpl 2.61 KB
Newer Older
1 2 3
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
  #
5 6
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
7 8 9 10 11 12 13 14 15
  #%]
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
[%+ PROCESS ics_prodid +%]
VERSION:2.0
[% FOREACH bug = bugs %]
BEGIN:VTODO
[%+ PROCESS ics_dtstart +%]
[%+ PROCESS ics_summary +%]
16 17
[%+ PROCESS ics_uid base_url=urlbase bug_id=bug.bug_id +%]
[%+ PROCESS ics_url base_url=urlbase bug_id=bug.bug_id +%]
18 19
[%+ PROCESS ics_status bug_status = bug.bug_status +%]
[%+ PROCESS ics_dtstamp +%]
20
[%+ ics_priorities.${bug.priority} FILTER ics('PRIORITY') +%]
21
[% IF bug.changeddate %]
22
[%+ bug.changedtime FILTER time("%Y%m%dT%H%M%SZ", "UTC") FILTER ics('LAST-MODIFIED') +%]
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
[% END %]
[% IF bug.percentage_complete %]
[%+ bug.percentage_complete FILTER format('%d') FILTER ics('PERCENT-COMPLETE') +%]
[% END %]
[% IF bug.product %]
[%+ bug.product FILTER ics('X-BUGZILLA-PRODUCT') +%]
[% END %]
[% IF bug.component %]
[%+ bug.component FILTER ics('X-BUGZILLA-COMPONENT') +%]
[% END %]
[% IF bug.version %]
[%+ bug.version FILTER ics('X-BUGZILLA-VERSION') +%]
[% END %]
[% IF bug.keywords %]
[%+ bug.keywords FILTER ics('X-BUGZILLA-KEYWORDS') +%]
[% END %]
END:VTODO
[% END %]
END:VCALENDAR

[% BLOCK ics_prodid %]
44
  [% "-//Mozilla/Bugzilla $constants.BUGZILLA_VERSION//EN" FILTER ics('PRODID') %]
45 46 47
[% END %]

[% BLOCK ics_uid %]
48
  [% "${bug_id}@${base_url}" FILTER uri FILTER ics('UID') %]
49 50 51
[% END %]

[% BLOCK ics_url %]
52
  [% "${base_url}show_bug.cgi?id=${bug_id}" FILTER uri FILTER ics('URL;VALUE=URI') %]
53 54 55
[% END %]

[% BLOCK ics_dtstart %]
56
  [% bug.opentime FILTER time("%Y%m%dT%H%M%SZ", "UTC") FILTER ics('DTSTART') %]
57 58 59
[% END %]

[% BLOCK ics_dtstamp %]
60
  [% currenttime FILTER time("%Y%m%dT%H%M%SZ", "UTC") FILTER ics('DTSTAMP') %]
61 62 63 64 65 66 67 68 69 70 71
[% END %]

[% BLOCK ics_status %]
  [% status = "" %]
  [% FOREACH state = closedstates %]
    [% IF bug_status == state %]
      [% status = 'COMPLETED' %]
      [% LAST %]
    [% END %]
  [% END %]
  [% IF NOT status %]
72
    [% IF bug_status == 'IN_PROGRESS' || bug_status == 'ASSIGNED' %]
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
      [% status = 'IN-PROGRESS' %]
    [% ELSE %]
      [% status = 'NEEDS-ACTION' %]
    [% END %]
  [% END %]
  [% status FILTER ics('STATUS') %]
[% END %]

[% BLOCK ics_summary %]
  [% IF bug.short_desc %]
    [% summary = bug.short_desc %]
  [% ELSIF bug.short_short_desc %]
    [% summary = bug.short_short_desc %]
  [% ELSE %]
    [% summary = "$terms.Bug $bug.bug_id" %]
  [% END %]
  [% summary FILTER ics('SUMMARY') %]
[% END %]