1 <?xml version="1.0" encoding="UTF-8"?>
4 <!-- String selection from user input -->
5 <widget-family name="string-input" datatype="text">
6 <label>String matching from user input</label>
9 <label>Exactly match a user supplied string</label>
11 This widget filters a column based on an exact string
16 <widget name="multistring">
17 <label>Exactly match one of several user supplied strings</label>
19 This widget filters a column based on an set of strings.
23 <widget name="initial-substring">
24 <label>Match the begining of a string from user input</label>
26 This widget filters a column based on an initial substring
33 <!-- String selection from in-database data -->
34 <widget-family name="string-choose" datatype="text">
35 <label>String filter from known data</label>
37 <widget name="dropdown">
38 <label>Exactly match a string chosen from a dropdown</label>
40 This widget filters a column based on an exact string match.
44 <widget name="multiselect">
45 <label>Match multiple strings chosen from a multiselect box</label>
47 This widget filters a column based on multiple strings.
53 <!-- Specific time range selection family -->
54 <widget-family name="specific-timerange" datatype="timestamptz">
55 <label>Specific time-range widgets</label>
58 <label>User defined time range</label>
60 This widget allows the user to pick an arbitrary time range
66 <label>Choose a specific date</label>
68 This widget allows the user to pick a specific date on which
71 <filter-code type="perl">
72 $full_col = "DATE_TRUNC($full_col, 'day')";
73 $where_clause = "$full_col = CAST(? AS DATE)";
74 push @$bind_list, sprintf('%d/%02d/%02d', @$val{qw/year month day/});
79 <label>Choose a specific week of the year</label>
81 This widget allows the user to pick a specific week of the year
84 <filter-code type="perl">
85 $full_col = "EXTRACT('week' FROM $full_col)";
86 $where_clause = "$full_col = ?";
87 push @$bind_list, $val;
91 <widget name="multiweek">
92 <label>Choose a range of weeks of the year</label>
94 This widget allows the user to pick a range of weeks of the year
97 <filter-code type="perl">
99 "EXTRACT('year' FROM $full_col) = ? ".
100 "AND EXTRACT('week' FROM $full_col) ".
102 push @$bind_list, $$val{year}, $$val{start}, $$val{end};
106 <widget name="month">
107 <label>Choose a specific year and month</label>
109 This widget allows the user to pick a specific year and month
112 <filter-code type="perl">
114 "EXTRACT('year' FROM $full_col) = ? ".
115 "AND EXTRACT('month' FROM $full_col) = ?";
116 push @$bind_list, $$val{'start-year'}, $$val{'start-month'};
120 <widget name="multimonth">
121 <label>Choose a range of months</label>
123 This widget allows the user to pick a range of month on which to
126 <filter-code type="perl">
128 "DATE_TRUNC($full_col, 'month') ".
129 "BETWEEN CAST(? AS DATE) AND CAST(? AS DATE)";
131 sprintf('%d/%02d/01', @$val{qw/start-year start-month/}),
132 sprintf('%d/%02d/01', @$val{qw/end-year end-month/});
136 <widget name="quarter">
137 <label>Choose a specific year and quarter</label>
139 This widget allows the user to pick a specific year and
140 quarter on which to report.
144 <widget name="multiquarter">
145 <label>Choose a range of quarters</label>
147 This widget allows the user to pick a range of quarter on which
153 <label>Choose a specific year</label>
155 This widget allows the user to pick a specific year on which to
158 <filter-code type="perl">
159 $where_clause = "EXTRACT('year' FROM $full_col) = ?";
160 push @$bind_list, $val;
164 <widget name="multiyear">
165 <label>Choose a range of years</label>
167 This widget allows the user to pick a range of years on which to
170 <filter-code type="perl">
171 $where_clause = "EXTRACT('year' FROM $full_col) BETWEEN ? AND ?";
172 push @$bind_list, $$val{year}, $$val{year} + $$val{year-count};
177 <!-- Specific time range selection family -->
178 <widget-family name="relative-timerange" datatype="timestamptz">
179 <label>Relative time-range widgets</label>
182 <label>Choose a date relative to the report runtime</label>
184 This widget allows the user to pick a date relative to the
185 report runtime on which to report.
190 <label>Choose a week (sun-sat) relative to the report runtime</label>
192 This widget allows the user to pick a week (sun-sat) relative
193 to the report runtime on which to report.
197 <widget name="month">
198 <label>Choose a month relative to the report runtime</label>
200 This widget allows the user to pick a month relative to the
201 report runtime on which to report.
203 <filter-code type="perl">
205 "DATE_TRUNC($full_col, 'month') = ".
206 "DATE_TRUNC(now(), 'month') - CAST(? || ' months' AS INTERVAL);
207 push @$bind_list, $val;
211 <widget name="quarter">
212 <label>Choose a quarter relative to the report runtime</label>
214 This widget allows the user to pick a quarter relative to the
215 report runtime on which to report.
220 <label>Choose a year relative to the report runtime</label>
222 This widget allows the user to pick a year relative to the
223 report runtime on which to report.
228 <!-- Library selection from in-database data - special to OpenILS -->
229 <widget-family name="lib-choose" datatype="text">
230 <label>String filter from known data</label>
232 <widget name="dropdown">
233 <label>Exactly match a Library chosen from a dropdown</label>
235 This widget filters on an exact Library Name match.
239 <widget name="multiselect">
240 <label>Match multiple Libraries chosen from a multiselect box</label>
242 This widget filters based on multiple Library names.