]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 290631 - iCalendar export should include priority
authorbbaetz%acm.org <>
Thu, 14 May 2009 11:34:35 +0000 (11:34 +0000)
committerbbaetz%acm.org <>
Thu, 14 May 2009 11:34:35 +0000 (11:34 +0000)
r/a=mkanat

buglist.cgi
template/en/default/list/list.ics.tmpl

index c4f3eabf30aaad9998e9d28aa5525802e0f0f4c9..e2a468ea20635cf54a74e2a0608e1691e02bebe6 100755 (executable)
@@ -1204,6 +1204,17 @@ $vars->{'displaycolumns'} = \@displaycolumns;
 $vars->{'openstates'} = [BUG_STATE_OPEN];
 $vars->{'closedstates'} = [map {$_->name} closed_bug_statuses()];
 
+# The iCal file needs priorities ordered from 1 to 9 (highest to lowest)
+# If there are more than 9 values, just make all the lower ones 9
+if ($format->{'extension'} eq 'ics') {
+    my $n = 1;
+    $vars->{'ics_priorities'} = {};
+    my $priorities = get_legal_field_values('priority');
+    foreach my $p (@$priorities) {
+        $vars->{'ics_priorities'}->{$p} = ($n > 9) ? 9 : $n++;
+    }
+}
+
 # The list of query fields in URL query string format, used when creating
 # URLs to the same query results page with different parameters (such as
 # a different sort order or when taking some action on the set of query
index d30b0658cfb10b1e7813fa95f6dc82062f6f8ea4..3f9e2b881844479ca46d416ae033aafbe96159df 100644 (file)
@@ -30,6 +30,7 @@ BEGIN:VTODO
 [%+ PROCESS ics_url base_url=urlbase bug_id=bug.bug_id +%]
 [%+ PROCESS ics_status bug_status = bug.bug_status +%]
 [%+ PROCESS ics_dtstamp +%]
+[%+ ics_priorities.${bug.priority} FILTER ics('PRIORITY') +%]
 [% IF bug.changeddate %]
 [%+ bug.changedtime FILTER time("%Y%m%dT%H%M%SZ", "UTC") FILTER ics('LAST-MODIFIED') +%]
 [% END %]