]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP2045292 Color contrast for AngularJS patron bills
[Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77
78         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio"
79                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
80                    oils_persist:tablename="oai.biblio">
81                 <fields oils_persist:primary="rec_id">
82                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
83                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
84                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
85                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
86                 </fields>
87         </class>
88         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority"
89                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
90                    oils_persist:tablename="oai.authority">
91                 <fields oils_persist:primary="rec_id">
92                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
93                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
94                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
95                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
96                 </fields>
97         </class>
98
99         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
100                 <fields>
101                         <field name="usr" oils_persist:virtual="true" />
102                         <field name="forgive_payment" oils_persist:virtual="true" />
103                         <field name="work_payment" oils_persist:virtual="true" />
104                         <field name="credit_payment" oils_persist:virtual="true" />
105                         <field name="goods_payment" oils_persist:virtual="true" />
106                         <field name="account_adjustment" oils_persist:virtual="true" />
107                 </fields>
108                 <links>
109                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
110                 </links>
111         </class>
112
113         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
114                 <fields>
115                         <field name="workstation" oils_persist:virtual="true" />
116                         <field name="cash_payment" oils_persist:virtual="true" />
117                         <field name="check_payment" oils_persist:virtual="true" />
118                         <field name="credit_card_payment" oils_persist:virtual="true" />
119                         <field name="debit_card_payment" oils_persist:virtual="true" />
120                 </fields>
121                 <links>
122                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
123                 </links>
124         </class>
125
126         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
127                 <fields>
128                         <field name="id" oils_persist:virtual="true" />
129                         <field name="children" oils_persist:virtual="true" />
130                         <field name="owner_doc" oils_persist:virtual="true" />
131                         <field name="intra_doc_id" oils_persist:virtual="true" />
132                         <field name="parent_node" oils_persist:virtual="true" />
133                         <field name="node_type" oils_persist:virtual="true" />
134                         <field name="namespace_uri" oils_persist:virtual="true" />
135                         <field name="name" oils_persist:virtual="true" />
136                         <field name="value" oils_persist:virtual="true" />
137                 </fields>
138         </class>
139
140         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
141                 <fields>
142                         <field name="title" oils_persist:virtual="true" />
143                         <field name="author" oils_persist:virtual="true" />
144                         <field name="doc_id" oils_persist:virtual="true" />
145                         <field name="doc_type" oils_persist:virtual="true" />
146                         <field name="pubdate" oils_persist:virtual="true" />
147                         <field name="isbn" oils_persist:virtual="true" />
148                         <field name="publisher" oils_persist:virtual="true" />
149                         <field name="tcn" oils_persist:virtual="true" />
150                         <field name="subject" oils_persist:virtual="true" />
151                         <field name="types_of_resource" oils_persist:virtual="true" />
152                         <field name="call_numbers" oils_persist:virtual="true" />
153                         <field name="edition" oils_persist:virtual="true" />
154                         <field name="online_loc" oils_persist:virtual="true" />
155                         <field name="synopsis" oils_persist:virtual="true" />
156                         <field name="physical_description" oils_persist:virtual="true" />
157                         <field name="toc" oils_persist:virtual="true" />
158                         <field name="copy_count" oils_persist:virtual="true" />
159                         <field name="series" oils_persist:virtual="true" />
160                         <field name="serials" oils_persist:virtual="true" />
161                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
162                 </fields>
163         </class>
164
165         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
166                 <fields>
167                         <field name="err_msg" oils_persist:virtual="true" />
168                         <field name="type" oils_persist:virtual="true" />
169                 </fields>
170         </class>
171
172         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
173                 <fields>
174                         <field name="err_msg" oils_persist:virtual="true" />
175                         <field name="type" oils_persist:virtual="true" />
176                 </fields>
177         </class>
178
179         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
180                 <fields oils_persist:primary="matchpoint">
181                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
182                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
183                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
184                 </fields>
185                 <links>
186                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
187                 </links>
188         </class>
189
190         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
191         <!-- when the time is right, turn me into a view.  -->
192                 <fields>
193             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
194             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
195             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
196             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
197             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
198             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
199             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
200             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
201             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
202             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
203                 </fields>
204         </class>
205
206         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
207                 <fields>
208                         <field name="public_name" oils_persist:virtual="true" />
209                         <field name="target_url" oils_persist:virtual="true" />
210                         <field name="target_coverage" oils_persist:virtual="true" />
211                         <field name="target_embargo" oils_persist:virtual="true" />
212                 </fields>
213         </class>
214
215         <!-- Actually in the DB -->
216         <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
219                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
220                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
221                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
222                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
223                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
224                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
225                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
226                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
227                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
228                 </fields>
229                 <links>
230                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
231                 </links>
232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
233                         <actions>
234                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
235                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
236                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
237                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
238                         </actions>
239                 </permacrud>
240         </class>
241
242         <class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
243                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
244                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
245                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
246                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
247                 </fields>
248                 <links>
249                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
250                 </links>
251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
252                         <actions>
253                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
254                     <context link="grp" field="owner"/>
255                 </create>
256                                 <retrieve/>
257                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
258                     <context link="grp" field="owner"/>
259                 </update>
260                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
261                     <context link="grp" field="owner"/>
262                 </delete>
263                         </actions>
264                 </permacrud>
265         </class>
266
267         <class  id="rrbs" 
268             controller="open-ils.cstore open-ils.pcrud" 
269             oils_obj:fieldmapper="rating::record_badge_score" 
270             oils_persist:tablename="rating.record_badge_score" 
271             reporter:label="Statistical Popularity Badge">
272                 <fields oils_persist:primary="id" 
273                 oils_persist:sequence="rating.record_badge_score_id_seq">
274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
275                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
276                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
277                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
278                 </fields>
279         <links>
280             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
281             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
282         </links>
283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
284                         <actions>
285                                 <retrieve/>
286                         </actions>
287                 </permacrud>
288         </class>
289
290         <class  id="rp" 
291             controller="open-ils.cstore open-ils.pcrud" 
292             oils_obj:fieldmapper="rating::popularity_parameter" 
293             oils_persist:tablename="rating.popularity_parameter" 
294             reporter:label="Statistical Popularity Parameter">
295                 <fields oils_persist:primary="id" 
296                 oils_persist:sequence="rating.popularity_parameter_id_seq">
297                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
298                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
299                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
300                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
301                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
302                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
303                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
304                 </fields>
305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
306                         <actions>
307                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
308                                 <retrieve/>
309                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
310                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
311                         </actions>
312                 </permacrud>
313         </class>
314
315         <class  id="rb" 
316             controller="open-ils.cstore open-ils.pcrud" 
317             oils_obj:fieldmapper="rating::badge" 
318             oils_persist:tablename="rating.badge" 
319             reporter:label="Statistical Popularity Badge">
320                 <fields oils_persist:primary="id" 
321                 oils_persist:sequence="rating.badge_id_seq">
322                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
323                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
325                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
326                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
327                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
328                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
329                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
330                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
331                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
332                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
333                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
334                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
335                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
336                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
337                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
338                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
339                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
340                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
341                 </fields>
342                 <links>
343                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
344                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
345                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
346                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
347                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
348                 </links>
349                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
350                         <actions>
351                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
352                                 <retrieve/>
353                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
354                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
355                         </actions>
356                 </permacrud>
357         </class>
358
359         <class  id="vibtg" 
360             controller="open-ils.cstore open-ils.pcrud" 
361             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
362             oils_persist:tablename="vandelay.import_bib_trash_group" 
363             reporter:label="Import/Overlay Field Groups for Removal">
364                 <fields oils_persist:primary="id" 
365                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
366                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
367                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
368                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
369                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
370                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
371                 </fields>
372                 <links>
373                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
374                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
375                 </links>
376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
377                         <actions>
378                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
379                                 <retrieve/>
380                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
381                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
382                         </actions>
383                 </permacrud>
384         </class>
385
386
387         <class id="vii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item" oils_persist:tablename="vandelay.import_item" reporter:label="Import Item">
388                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
389                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
390                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
391                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
392                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
393                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
394                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
395                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
396                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
397                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
398                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
399                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
400                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
401                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
402                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
403                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
404                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
405                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
406                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
407                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
408                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
409                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
410                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
411                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
412                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
413                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
414                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
415                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
416                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
417                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
418                 </fields>
419                 <links>
420                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
421                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
422                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
423                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
424                 </links>
425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
426                         <actions>
427                                 <create permission="CREATE_IMPORT_ITEM">
428                     <context link="definition" field="owner"/>
429                                 </create>
430                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
431                     <context link="definition" field="owner"/>
432                                 </retrieve>
433                                 <update permission="UPDATE_IMPORT_ITEM">
434                     <context link="definition" field="owner"/>
435                                 </update>
436                                 <delete permission="DELETE_IMPORT_ITEM">
437                     <context link="definition" field="owner"/>
438                                 </delete>
439                         </actions>
440                 </permacrud>
441         </class>
442
443         <class id="viiad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item_attr_definition" oils_persist:tablename="vandelay.import_item_attr_definition" reporter:label="Import Item Attribute Definition">
444                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
445                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
446                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
448                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
449                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
450                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
451                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
452                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
453                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
454                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
455                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
456                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
457                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
458                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
459                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
460                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
461                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
462                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
463                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
464                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
465                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
466                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
467                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
468                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
469                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
470                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
471                 </fields>
472                 <links>
473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
474                 </links>
475                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
476                         <actions>
477                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
478                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
479                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
480                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
481                         </actions>
482                 </permacrud>
483         </class>
484
485         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
486                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
487                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
488                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
489                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
490                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
491                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
492                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
493                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
494                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
495                 </fields>
496                 <links>
497                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
498                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
499                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
500                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
501                 </links>
502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
503                         <actions>
504                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
505                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
506                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
507                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
508                         </actions>
509                 </permacrud>
510         </class>
511
512         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
513                 <fields oils_persist:primary="code">
514                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
515                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
516                 </fields>
517                 <links>
518                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
519                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
520                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
521                 </links>
522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
523                         <actions>
524                                 <retrieve/>
525                         </actions>
526                 </permacrud>
527         </class>
528
529         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
530                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
531                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
532                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
533                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
534                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
535                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
536                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
537                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
538                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
539                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
540                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
541                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
542                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
543                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
544                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
545                 </fields>
546                 <links>
547                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
548                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
549                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
550                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
551             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
552             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
553             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
554                 </links>
555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
556                         <actions>
557                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
558                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
559                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
560                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
561                         </actions>
562                 </permacrud>
563         </class>
564
565         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
566                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
567                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
568                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
569                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
570                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
571                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
572                 </fields>
573                 <links/>
574                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
575                         <actions>
576                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
577                 <retrieve/>
578                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
579                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
580                         </actions>
581                 </permacrud>
582         </class>
583
584         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
585                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
586                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
587                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
588                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
589                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
590                 </fields>
591                 <links>
592                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
593                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
594                 </links>
595                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
596                         <actions>
597                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
598                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
599                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
600                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
601                         </actions>
602                 </permacrud>
603         </class>
604
605         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
606                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
607                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
608                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
609                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
610                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
611                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
612                 </fields>
613                 <links>
614                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
615                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
616                 </links>
617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
618                         <actions>
619                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
620                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
621                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
622                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
623                         </actions>
624                 </permacrud>
625         </class>
626
627         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
628                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
629                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
630                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
631                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
632                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
633                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
634                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
635                 </fields>
636                 <links>
637                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
638                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
639                 </links>
640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
641                         <actions>
642                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
643                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
644                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
645                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
646                         </actions>
647                 </permacrud>
648         </class>
649
650         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
651                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
652                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
653                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
654                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
655                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
656                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
657                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
658                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
659                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
660                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
661                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
662                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
663                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
664                 </fields>
665                 <links>
666                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
667                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
668                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
669             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
670             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
671                 </links>
672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
673                         <actions>
674                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
675                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
676                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
677                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
678                         </actions>
679                 </permacrud>
680         </class>
681
682         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
683                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
685                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
686                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
687                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
688                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
689                 </fields>
690                 <links/>
691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
692                         <actions>
693                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
694                 <retrieve/>
695                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
696                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
697                         </actions>
698                 </permacrud>
699         </class>
700
701         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
702                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
703                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
704                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
705                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
706                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
707                 </fields>
708                 <links>
709                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
710                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
711                 </links>
712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
713                         <actions>
714                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
716                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
717                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
718                         </actions>
719                 </permacrud>
720         </class>
721
722         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
723                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
724                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
725                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
726                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
727                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
728                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
729                 </fields>
730                 <links>
731                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
732                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
733                 </links>
734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
735                         <actions>
736                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
737                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
738                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
739                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
740                         </actions>
741                 </permacrud>
742         </class>
743
744         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
745                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
746                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
747                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
748                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
749                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
750                 </fields>
751                 <links>
752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
753                 </links>
754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
755                         <actions>
756                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
757                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
758                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
759                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
760                         </actions>
761                 </permacrud>
762         </class>
763
764         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
765                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
766                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
767                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
768                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
769                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
770                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
771                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
772                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
773             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
774                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
775                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
776                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
777                 </fields>
778                 <links>
779                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
780                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
781                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
782                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
783                 </links>
784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
785                         <actions>
786                                 <create permission="ADMIN_IMPORT_MATCH_SET">
787                     <context link="match_set" field="owner"/>
788                                 </create>
789                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
790                     <context link="match_set" field="owner"/>
791                                 </retrieve>
792                                 <update permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </update>
795                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </delete>
798                         </actions>
799                 </permacrud>
800         </class>
801
802         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
803                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
804                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
805                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
806                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
807                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
808                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
809                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
810                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
811                 </fields>
812                 <links>
813                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
814                 </links>
815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
816                         <actions>
817                                 <create permission="ADMIN_IMPORT_MATCH_SET">
818                     <context link="match_set" field="owner"/>
819                                 </create>
820                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
821                     <context link="match_set" field="owner"/>
822                                 </retrieve>
823                                 <update permission="ADMIN_IMPORT_MATCH_SET">
824                     <context link="match_set" field="owner"/>
825                                 </update>
826                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
827                     <context link="match_set" field="owner"/>
828                                 </delete>
829                         </actions>
830                 </permacrud>
831         </class>
832
833         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
834                 oils_obj:fieldmapper="vandelay::session_tracker" 
835                 oils_persist:tablename="vandelay.session_tracker" 
836                 reporter:label="Vandelay Session Tracker">
837                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
838                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
839                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
840                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
841                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
842                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
843                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
844                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
845                                          queue or an auth queue and there's no IDL class for vandelay.queue .
846                                          parent table.
847                         -->
848                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
849                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
850                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
851                         <field reporter:label="State" name="state" reporter:datatype="text"/>
852                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
853                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
854                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
855                 </fields>
856                 <links>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
859                 </links>
860                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
861                         <actions>
862                                 <!-- created by the API -->
863                                 <retrieve global_required="true"
864                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
865                                 <update global_required="true"
866                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
867                                         <context link="workstation" field="owning_lib"/>
868                                 </update>
869                                 <delete 
870                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
871                                         <context link="workstation" field="owning_lib"/>
872                                 </delete>
873                         </actions>
874                 </permacrud>
875         </class>
876
877         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
878                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
879                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
880                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
881                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
882                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
883                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
884                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
885                 </fields>
886                 <links>
887                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
888                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
889                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
890                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
891                 </links>
892         </class>
893
894     <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
895         <fields oils_persist:primary="name">
896             <field reporter:label="Name" name="name" reporter:datatype="text"/>
897             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
898             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
899             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
900         </fields>
901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
902             <actions>
903                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
904                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
905                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
906                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
907             </actions>
908         </permacrud>
909     </class>
910
911     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
912         <fields oils_persist:primary="id">
913             <field reporter:label="ID" name="id" reporter:datatype="id"/>
914             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
915             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
916             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
917             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
918         </fields>
919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
920             <actions>
921                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
922                 <retrieve/>
923                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
924                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
925             </actions>
926         </permacrud>
927     </class>
928
929         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
930                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
932                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
933                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
934                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
935                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
936                 </fields>
937                 <links>
938                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
939                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
940                 </links>
941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
942             <actions>
943                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
944                 <retrieve/>
945                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
946                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
947             </actions>
948         </permacrud>
949         </class>
950
951         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
952                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
953                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
954                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
955                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
956         </fields>
957         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
958             <actions>
959                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
960                 <retrieve/>
961                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
962                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
963             </actions>
964         </permacrud>
965         </class>
966
967         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
968                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
969                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
970                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
971                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
972                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
973                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
974                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
975                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
976                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
977                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
978                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
979                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
980         </fields>
981                 <links>
982                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
983                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
984         </links>
985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
986             <actions>
987                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
988                 <retrieve/>
989                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
990                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
991             </actions>
992         </permacrud>
993         </class>
994
995         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:field_safe="true">
996                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
997                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
998                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
999                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
1001                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
1002                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1003                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
1004                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
1005                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
1006                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
1007         </fields>
1008                 <links>
1009                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
1010                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1011         </links>
1012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1013             <actions>
1014                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
1015                 <retrieve/>
1016                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
1017                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
1018             </actions>
1019         </permacrud>
1020         </class>
1021
1022         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
1023                 <fields oils_persist:primary="name">
1024                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1025                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1026                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1027                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1028                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1029                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1030                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1031                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1032                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1033                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1034                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1035                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1036                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1037                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1038                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1039                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1040                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1041                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1042                 </fields>
1043                 <links>
1044                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1045                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1046                 </links>
1047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1048             <actions>
1049                 <create permission="ADMIN_SVF" global_required="true"/>
1050                 <retrieve/>
1051                 <update permission="ADMIN_SVF" global_required="true"/>
1052                 <delete permission="ADMIN_SVF" global_required="true"/>
1053             </actions>
1054         </permacrud>
1055         </class>
1056
1057         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
1058                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1060                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1061                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1062             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1063                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1064                 </fields>
1065                 <links/>
1066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1067             <actions>
1068                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1069                 <retrieve/>
1070                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1071                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1072             </actions>
1073         </permacrud>
1074         </class>
1075
1076         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1077                 <fields oils_persist:primary="coded_value">
1078                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1079                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1087                 <retrieve/>
1088                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1089                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1090             </actions>
1091         </permacrud>
1092         </class>
1093
1094         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1095                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1096                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1097                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1098                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1099                 </fields>
1100                 <links>
1101                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1102                 </links>
1103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1104             <actions>
1105                 <retrieve/>
1106             </actions>
1107         </permacrud>
1108         </class>
1109
1110
1111         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1112                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1113                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1114                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1115                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1116                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1117                 </fields>
1118                 <links>
1119                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1120                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1121                 </links>
1122         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1123             <actions>
1124                 <retrieve/>
1125             </actions>
1126         </permacrud>
1127         </class>
1128
1129
1130         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1131                 <fields oils_persist:primary="source">
1132                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1133                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1134                 </fields>
1135                 <links>
1136                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1137                 </links>
1138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1139             <actions>
1140                 <retrieve/>
1141             </actions>
1142         </permacrud>
1143         </class>
1144
1145         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1146                 <fields>
1147                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1148                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1149                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1150                 </fields>
1151                 <links>
1152                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1153                 </links>
1154         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1155             <actions>
1156                 <retrieve/>
1157             </actions>
1158         </permacrud>
1159         </class>
1160
1161         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1162                 <fields oils_persist:primary="id">
1163                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1164                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1165                 </fields>
1166                 <links>
1167                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1168                 </links>
1169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1170             <actions>
1171                 <retrieve/>
1172             </actions>
1173         </permacrud>
1174         </class>
1175
1176         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
1177                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1178                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1179                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1180                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1181                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1182                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1183                 </fields>
1184                 <links>
1185                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1186                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1187                 </links>
1188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1189             <actions>
1190                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1191                 <retrieve/>
1192                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1193                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1194             </actions>
1195         </permacrud>
1196         </class>
1197
1198         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
1199                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1200                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1201                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1202                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1203                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1204                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1205                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1206                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1207             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1208             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1209             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1210                 </fields>
1211                 <links>
1212                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1213                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1214                 </links>
1215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1216             <actions>
1217                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1218                 <retrieve/>
1219                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1220                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1221             </actions>
1222         </permacrud>
1223         </class>
1224
1225         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
1226                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1227                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1228                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1229                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1230                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1231                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1232                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1233                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1234                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1235                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1236                 </fields>
1237                 <links>
1238                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1239                 </links>
1240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1241             <actions>
1242                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1243                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1244                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1245                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1246             </actions>
1247         </permacrud>
1248         </class>
1249
1250     <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1251         <fields oils_persist:primary="name">
1252             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1253             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1254             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1255             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1256             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1257             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1258             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1259             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1260             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
1261             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1262         </fields>
1263         <links>
1264             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1265             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1266         </links>
1267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1268             <actions>
1269                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1270                 <retrieve/>
1271                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1272                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1273             </actions>
1274         </permacrud>
1275     </class>
1276
1277     <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1278         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1279             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1280             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true"/>
1281             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1282             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1283             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1284             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1285             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1286         </fields>
1287         <links>
1288             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1289         </links>
1290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291             <actions>
1292                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1293                 <retrieve/>
1294                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1295                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1296             </actions>
1297         </permacrud>
1298     </class>
1299
1300     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1301                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1302                         oils_persist:tablename="config.z3950_index_field_map" 
1303                         reporter:label="Z39.50 Index Field Map">
1304         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1305             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1306             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1307             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1308             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1309             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1310             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1311         </fields>
1312         <links>
1313             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1314             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1315             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1316         </links>
1317         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1318             <actions>
1319                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1320                 <retrieve/>
1321                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1322                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1323             </actions>
1324         </permacrud>
1325     </class>
1326
1327
1328         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1329                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1330                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1331                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1332                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1333                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1334                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1335                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1336             <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1337                 </fields>
1338                 <links>
1339             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1340             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1341                 </links>
1342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1343                         <actions>
1344                                 <retrieve/>
1345                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1346                         </actions>
1347                 </permacrud>
1348         </class>
1349
1350         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1351                 <fields oils_persist:primary="key">
1352                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1353                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1354                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1355                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1356                 </fields>
1357                 <links/>
1358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1359                         <actions>
1360                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1361                                 <retrieve/>
1362                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1363                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1364                         </actions>
1365                 </permacrud>
1366         </class>
1367
1368         <class id="atcol" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1369                 <fields oils_persist:primary="module">
1370                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1371                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1372                 </fields>
1373                 <links/>
1374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1375                         <actions>
1376                                 <retrieve/>
1377                         </actions>
1378                 </permacrud>
1379         </class>
1380
1381         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1382                 <fields oils_persist:primary="module">
1383                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1384                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1385                 </fields>
1386                 <links/>
1387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1388                         <actions>
1389                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1390                                 <retrieve/>
1391                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1392                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1393                         </actions>
1394                 </permacrud>
1395         </class>
1396
1397         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1398                 <fields oils_persist:primary="module">
1399                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1400                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1401                 </fields>
1402                 <links/>
1403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1404                         <actions>
1405                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1406                                 <retrieve/>
1407                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1408                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1409                         </actions>
1410                 </permacrud>
1411         </class>
1412
1413         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1414                 <fields oils_persist:primary="module">
1415                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1416                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1417                 </fields>
1418                 <links/>
1419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1420                         <actions>
1421                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1422                                 <retrieve/>
1423                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1424                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1425                         </actions>
1426                 </permacrud>
1427         </class>
1428
1429         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1430                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1431                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1432                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1433                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1434                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1435                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1436                 </fields>
1437                 <links>
1438                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1439                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1440                 </links>
1441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1442                         <actions>
1443                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1444                     <context link="event_def" field="owner"/>
1445                 </create>
1446                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1447                     <context link="event_def" field="owner"/>
1448                 </retrieve>
1449                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1450                     <context link="event_def" field="owner"/>
1451                 </update>
1452                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1453                     <context link="event_def" field="owner"/>
1454                 </delete>
1455                         </actions>
1456                 </permacrud>
1457         </class>
1458
1459         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1460                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1461                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1462                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1463                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1464                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1465                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1466                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1467                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1468                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1469                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1470                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1471                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1472                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1473                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1474                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1475                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1476                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1477                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1478                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1479                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1480                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1481                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1482                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1483                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1484                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1485                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1486                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1487                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1488                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1489                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1490                 </fields>
1491                 <links>
1492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1493                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1494                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1495                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1496                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1497                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1498                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1499                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1500                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1501                 </links>
1502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1503                         <actions>
1504                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1505                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1508                         </actions>
1509                 </permacrud>
1510         </class>
1511
1512     <class id="atevalt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::alternate_template" oils_persist:tablename="action_trigger.alternate_template" reporter:label="Alternate Action Trigger Templates">
1513         <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1514             <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1515             <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1516             <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1517             <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1518             <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1519             <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1520             <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1521         </fields>
1522         <links>
1523             <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1524             <link field="locale" relteype="has_a" key="code" map="" class="i18n_l"/>
1525          </links>
1526          <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1527              <actions>
1528                  <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1529                      <context link="event_def" field="owner"/>
1530                  </create>
1531                  <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1532                      <context link="event_def" field="owner"/>
1533                  </retrieve>
1534                  <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1535                      <context link="event_def" field="owner"/>
1536                  </update>
1537                  <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1538                      <context link="event_def" field="owner"/>
1539                  </delete>
1540             </actions>
1541         </permacrud>
1542     </class>
1543
1544
1545         <class id="atevdefg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group" oils_persist:tablename="action_trigger.event_def_group" reporter:label="Trigger Event Definition Group" oils_persist:restrict_primary="100">
1546                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1547                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1548                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1549                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1550                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1551                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1552                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1553                 </fields>
1554                 <links>
1555                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1556                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1557                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1558                 </links>
1559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1560                         <actions>
1561                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1562                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1563                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1564                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1565                         </actions>
1566                 </permacrud>
1567         </class>
1568
1569         <class id="atevdefgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group_member" oils_persist:tablename="action_trigger.event_def_group_member" reporter:label="Trigger Event Definition Group Member">
1570                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1572                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1573                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1574                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1575                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1576                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1577                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1578                 </fields>
1579                 <links>
1580                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1581                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1582                 </links>
1583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1584                         <actions>
1585                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1586                     <context link="grp" field="owner"/>
1587                 </create>
1588                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1589                     <context link="grp" field="owner"/>
1590                 </retrieve>
1591                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1592                     <context link="grp" field="owner"/>
1593                 </update>
1594                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1595                     <context link="grp" field="owner"/>
1596                 </delete>
1597                         </actions>
1598                 </permacrud>
1599         </class>
1600
1601         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1602                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1603                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1604                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1605                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1606                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1607                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1608                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1609                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1610                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1611                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1612                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1613                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1614                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1615                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1616                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1617                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1618                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1619                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1620                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1621                 </fields>
1622                 <links>
1623                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1624                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1625                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1626                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1627                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1628                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1629                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1630                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1631                 </links>
1632         </class>
1633
1634         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1635                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1636                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1637                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1638                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1639                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1640                 </fields>
1641                 <links>
1642                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1643                 </links>
1644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1645                         <actions>
1646                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1647                     <context link="event_def" field="owner"/>
1648                 </create>
1649                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1650                     <context link="event_def" field="owner"/>
1651                 </retrieve>
1652                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1653                     <context link="event_def" field="owner"/>
1654                 </update>
1655                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1656                     <context link="event_def" field="owner"/>
1657                 </delete>
1658                         </actions>
1659                 </permacrud>
1660         </class>
1661
1662         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1663                 <oils_persist:source_definition><![CDATA[
1664                 SELECT  atevdef.hook,
1665                         atevdef.name,
1666                         atevdef.reactor,
1667                         atev.id,
1668                         atev.event_def,
1669                         atev.add_time,
1670                         atev.run_time,
1671                         atev.start_time,
1672                         atev.update_time,
1673                         atev.complete_time,
1674                         atev.update_process,
1675                         atev.state,
1676                         atev.user_data,
1677                         atev.template_output,
1678                         atev.error_output,
1679                         atev.async_output,
1680                         targ_circ.id AS target_circ,
1681                         targ_ahr.id AS target_hold,
1682                         COALESCE(
1683                                 targ_circ.circ_lib,
1684                                 targ_ahr.pickup_lib
1685                         ) AS perm_lib
1686                 FROM action_trigger.event atev
1687                 JOIN action_trigger.event_definition atevdef ON
1688                         (atevdef.id = atev.event_def)
1689                 JOIN action_trigger.hook ath ON
1690                         (ath.key = atevdef.hook)
1691                 LEFT JOIN action.circulation targ_circ ON
1692                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1693                 LEFT JOIN action.hold_request targ_ahr ON
1694                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1695                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1696                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1697                                 'circ.staff.max_visible_event_age',
1698                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1699                         ) UNION
1700                         SELECT '1000 YEARS'::INTERVAL AS value
1701                 ) ous)
1702                 ]]></oils_persist:source_definition>
1703                 <fields oils_persist:primary="id">
1704                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1705                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1706                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1707                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1708                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1709                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1710                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1711                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1712                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1713                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1714                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1715                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1716                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1717                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1718                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1719                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1720                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1721                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1722                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1723                 </fields>
1724                 <links>
1725                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1726                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1727                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1728                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1729                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1730                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1731                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1732                 </links>
1733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1734                         <actions>
1735                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1736                         </actions>
1737                 </permacrud>
1738         </class>
1739
1740         <class id="atoul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::optimized_user_log" reporter:label="Action Trigger Optimized User Log" oils_persist:readonly="true">
1741                 <oils_persist:source_definition><![CDATA[
1742                 SELECT  atevdef.hook,
1743                         atevdef.name,
1744                         atevdef.reactor,
1745                         atev.id,
1746                         atev.event_def,
1747                         atev.add_time,
1748                         atev.run_time,
1749                         atev.start_time,
1750                         atev.update_time,
1751                         atev.complete_time,
1752                         atev.update_process,
1753                         atev.state,
1754                         atev.user_data,
1755                         atev.template_output,
1756                         atev.error_output,
1757                         atev.async_output,
1758             atev.target,
1759                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1760                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1761             atev.context_user,
1762                         atev.context_library,
1763             atev.context_bib,
1764             atev.context_item,
1765             rssr.title,
1766             rssr.author
1767                 FROM action_trigger.event atev
1768                 JOIN action_trigger.event_definition atevdef ON
1769                         (atevdef.id = atev.event_def)
1770                 JOIN action_trigger.hook ath ON
1771                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1772         LEFT JOIN reporter.super_simple_record rssr ON
1773             (atev.context_bib = rssr.id)
1774                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1775                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1776                                 'circ.staff.max_visible_event_age',
1777                                 atev.context_library
1778                         ) UNION
1779                         SELECT '1000 YEARS'::INTERVAL AS value
1780                 ) ous)
1781                 ]]></oils_persist:source_definition>
1782                 <fields oils_persist:primary="id">
1783                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1784                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1785                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1786                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1787                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1788                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1789                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1790                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1791                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1792                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1793                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1794                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1795                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1796                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1797                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1798                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1799                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1800                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1801                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1802                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1803                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1804                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1805                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1806                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1807                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1808                 </fields>
1809                 <links>
1810                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1811                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1812                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1813                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1814                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1815                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1816                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1817                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1818                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1819                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1820                 </links>
1821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1822                         <actions>
1823                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1824                         </actions>
1825                 </permacrud>
1826         </class>
1827
1828         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1829                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1830                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1831                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1832                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1833                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1834                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1835                 </fields>
1836                 <links>
1837                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1838                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1839                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1840                 </links>
1841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1842                         <actions>
1843                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1844                         </actions>
1845                 </permacrud>
1846         </class>
1847
1848         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1849                 <fields oils_persist:primary="code">
1850                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1851                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1852                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1853                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1854                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1855                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1856                 </fields>
1857                 <links/>
1858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859             <actions>
1860                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1861                 <retrieve/>
1862                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1863                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1864             </actions>
1865         </permacrud>
1866         </class>
1867
1868         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1869                 <fields oils_persist:primary="code">
1870                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1871                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1872                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1873                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1874                 </fields>
1875                 <links/>
1876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1877             <actions>
1878                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1879                 <retrieve/>
1880                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1881                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1882             </actions>
1883         </permacrud>
1884         </class>
1885
1886         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1887                 <fields oils_persist:primary="code">
1888                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1889                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1890                 </fields>
1891                 <links/>
1892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1893             <actions>
1894                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1895                 <retrieve/>
1896                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1897                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1898             </actions>
1899         </permacrud>
1900         </class>
1901
1902         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1903                 <fields oils_persist:primary="code">
1904                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1905                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1906                 </fields>
1907                 <links/>
1908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1909             <actions>
1910                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1911                 <retrieve/>
1912                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1913                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1914             </actions>
1915         </permacrud>
1916         </class>
1917
1918         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1919                 <fields oils_persist:primary="code">
1920                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1921                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1922                 </fields>
1923                 <links/>
1924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1925             <actions>
1926                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1927                 <retrieve/>
1928                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1929                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1930             </actions>
1931         </permacrud>
1932         </class>
1933
1934         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1935                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1936                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1937                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1938                 </fields>
1939                 <links/>
1940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1941             <actions>
1942                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1943                 <retrieve/>
1944                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1945                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1946             </actions>
1947         </permacrud>
1948         </class>
1949
1950         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1951                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1952                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1953                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1954                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1955                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1956                 </fields>
1957         <links>
1958             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1959             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1960             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1961         </links>
1962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1963             <actions>
1964                 <create permission="UPDATE_COPY">
1965                     <context link="target_copy" field="circ_lib"/>
1966                 </create>
1967                 <retrieve/>
1968                 <update permission="UPDATE_COPY">
1969                     <context link="target_copy" field="circ_lib"/>
1970                 </update>
1971                 <delete permission="UPDATE_COPY">
1972                     <context link="target_copy" field="circ_lib"/>
1973                 </delete>
1974             </actions>
1975         </permacrud>
1976         </class>
1977
1978         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1979                 <fields oils_persist:primary="code">
1980                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1981                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1982                 </fields>
1983                 <links/>
1984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1985             <actions>
1986                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1987                 <retrieve/>
1988                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1989                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1990             </actions>
1991         </permacrud>
1992         </class>
1993
1994         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1995                 <fields oils_persist:primary="code">
1996                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1997                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1998                 </fields>
1999                 <links/>
2000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2001             <actions>
2002                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
2003                 <retrieve/>
2004                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
2005                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
2006             </actions>
2007         </permacrud>
2008         </class>
2009
2010         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
2011                 <fields oils_persist:primary="code">
2012                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
2013                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2014                 </fields>
2015                 <links/>
2016         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2017             <actions>
2018                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2019                 <retrieve/>
2020                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2021                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2022             </actions>
2023         </permacrud>
2024         </class>
2025
2026     <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
2027         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
2028             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2029             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2030             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
2031             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
2032             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
2033             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
2034             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
2035             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
2036             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
2037             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
2038             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
2039             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
2040             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
2041             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
2042             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
2043             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2044             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2045         </fields>
2046         <links/>
2047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2048             <actions>
2049                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2050                 <retrieve/>
2051                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2052                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2053             </actions>
2054         </permacrud>
2055     </class>
2056
2057     <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
2058         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2059             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2060             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2061             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2062             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2063             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2064             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2065             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2066             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2067             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2068             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2069             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2070             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2071             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2072             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2073             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2074             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2075             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2076             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2077             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2078         </fields>
2079         <links/>
2080         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2081             <actions>
2082                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2083                 <retrieve/>
2084                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2085                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2086             </actions>
2087         </permacrud>
2088     </class>
2089
2090     <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
2091         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2092             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2093             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2094             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2095             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2096             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2097         </fields>
2098         <links>
2099             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2100             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2101             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2102         </links>
2103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2104             <actions>
2105                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2106                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2107                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2108                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2109             </actions>
2110         </permacrud>
2111     </class>
2112
2113         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
2114                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2115                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2116                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2117                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2118                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2119                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2120                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2121                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2122                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2123                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2124                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2125                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2126                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2127                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2128                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2129                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2130                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2131             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2132                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2133                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2134                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2135                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2136                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2137                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2138                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2139                 </fields>
2140                 <links>
2141                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2142                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2143                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2144                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2147                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2148                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2149                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2150                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2151                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2152                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2153                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2154             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2155                 </links>
2156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2157             <actions>
2158                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2159                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2160                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2161                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2162             </actions>
2163         </permacrud>
2164         </class>
2165
2166         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
2167                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2168                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2169                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2170                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2172                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2173                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2174                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2175                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2176                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2177                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2178                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2179                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2180                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2181                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2182                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2183             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2184                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2185                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2186             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2187                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2188                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2189                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2190                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2191             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2192             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2193             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2194                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2195                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2196                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2197                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2198                 </fields>
2199                 <links>
2200                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2201                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2202                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2203                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2205                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2206                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2207                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2208                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2209                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2210                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2211                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2212                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2213                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2214             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2215                 </links>
2216         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2217             <actions>
2218                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2219                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2220                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2221                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222             </actions>
2223         </permacrud>
2224         </class>
2225
2226     <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
2227         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2228             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2229             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2230             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2231         </fields>
2232         <links/>
2233         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2234             <actions>
2235                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2236                 <retrieve/>
2237                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2238                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2239             </actions>
2240         </permacrud>
2241     </class>
2242
2243     <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
2244         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2245             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2246             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2247             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2248             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2249             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2250             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2251             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2252         </fields>
2253         <links>
2254             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2255         </links>
2256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2257             <actions>
2258                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2259                 <retrieve/>
2260                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2261                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2262             </actions>
2263         </permacrud>
2264     </class>
2265
2266     <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
2267         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2268             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2269             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2270             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2271             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2272             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2273         </fields>
2274         <links>
2275             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2276             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2277         </links>
2278         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2279             <actions>
2280                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2281                     <context link="matchpoint" field="org_unit"/>
2282                 </create>
2283                 <retrieve/>
2284                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2285                     <context link="matchpoint" field="org_unit"/>
2286                 </update>
2287                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2288                     <context link="matchpoint" field="org_unit"/>
2289                 </delete>
2290             </actions>
2291         </permacrud>
2292     </class>
2293
2294     <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
2295         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2296             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2297             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2298             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2299         </fields>
2300         <links>
2301             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2302             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2303         </links>
2304         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2305             <actions>
2306                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2307                     <context link="limit_set" field="owning_lib"/>
2308                 </create>
2309                 <retrieve/>
2310                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2311                     <context link="limit_set" field="owning_lib"/>
2312                 </update>
2313                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2314                     <context link="limit_set" field="owning_lib"/>
2315                 </delete>
2316             </actions>
2317         </permacrud>
2318     </class>
2319     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2320         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2321             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2322             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2323             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2324         </fields>
2325         <links>
2326             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2327             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2328         </links>
2329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2330             <actions>
2331                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                     <context link="limit_set" field="owning_lib"/>
2333                 </create>
2334                 <retrieve/>
2335                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2336                     <context link="limit_set" field="owning_lib"/>
2337                 </update>
2338                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2339                     <context link="limit_set" field="owning_lib"/>
2340                 </delete>
2341             </actions>
2342         </permacrud>
2343     </class>
2344
2345     <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
2346         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2347             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2348             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2349             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2350             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2351         </fields>
2352         <links>
2353             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2354             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2355         </links>
2356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2357             <actions>
2358                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2359                     <context link="limit_set" field="owning_lib"/>
2360                 </create>
2361                 <retrieve/>
2362                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2363                     <context link="limit_set" field="owning_lib"/>
2364                 </update>
2365                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2366                     <context link="limit_set" field="owning_lib"/>
2367                 </delete>
2368             </actions>
2369         </permacrud>
2370     </class>
2371
2372         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
2373                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2374                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2375                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2376                 </fields>
2377                 <links/>
2378         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2379             <actions>
2380                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2381                 <retrieve/>
2382                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2383                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2384             </actions>
2385         </permacrud>
2386         </class>
2387
2388         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
2389                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2390                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2391                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2392                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2393                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2394                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2395                 </fields>
2396                 <links>
2397                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2398                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2399                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2400                 </links>
2401         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2402             <actions>
2403                 <create permission="ADMIN_SURVEY">
2404                     <context link="survey" field="owner"/>
2405                 </create>
2406                 <retrieve/>
2407                 <update permission="ADMIN_SURVEY">
2408                     <context link="survey" field="owner"/>
2409                 </update>
2410                 <delete permission="ADMIN_SURVEY">
2411                     <context link="survey" field="owner"/>
2412                 </delete>
2413             </actions>
2414         </permacrud>
2415         </class>
2416         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2417                 <fields oils_persist:primary="id" oils_persist:sequence="">
2418                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2419                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2420                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2421                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2422                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2423                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2424                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2425                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2426                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2427                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2428                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2429                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2430                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2431                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2432                 </fields>
2433                 <links>
2434                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2435                 </links>
2436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2437                         <actions>
2438                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2439                                         <context link="usr" field="home_ou" />
2440                                 </retrieve>
2441                         </actions>
2442                 </permacrud>
2443         </class>
2444         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2445                 <fields oils_persist:primary="id" oils_persist:sequence="">
2446                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2447                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2448                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2449                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2450                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2451                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2452                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2453                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2454                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2455                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2456                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2457                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2458                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2459                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2460                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2461                 </fields>
2462                 <links>
2463                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2464                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2465                 </links>
2466         </class>
2467         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2468                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2469                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2470                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2471                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2472                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2473                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2474                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2475                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2476                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2477                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2478                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2479                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2480                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2481                 </fields>
2482                 <links>
2483                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2484                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2485                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2486                 </links>
2487                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2488                         <actions> <!-- created magically, so no create action -->
2489                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2490                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2491                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2492                         </actions>
2493                 </permacrud>
2494         </class>
2495         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2496                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2497                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2498                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2499                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2500                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2501                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2502                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2503                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2504                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2505                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2506                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2507                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2508                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2509                 </fields>
2510                 <links>
2511                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2512                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2513                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2514                 </links>
2515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2516                         <actions> <!-- created magically, so no create action -->
2517                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2518                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2519                         </actions>
2520                 </permacrud>
2521         </class>
2522         <class id="aump" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_penalty" oils_persist:tablename="actor.usr_message_penalty" reporter:label="User Message Penalty">
2523         <fields oils_persist:primary="id">
2524                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2525                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2526                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2527                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2528                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2530                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2531                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2532                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2533                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2534                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2535                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2536                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2537                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2538                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2539                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2540                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2541                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2542                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2543                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2544                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2545                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2546                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2547                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2548                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2549                 </fields>
2550                 <links>
2551                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2552                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2553                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2554                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2555                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2556                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2559                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2560                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2561                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2562                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2563                 </links>
2564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2565                         <actions> <!-- created magically, so no create action -->
2566                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2567                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2568                         </actions>
2569                 </permacrud>
2570         </class>
2571
2572         <class id="aupw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_privacy_waiver" oils_persist:tablename="actor.usr_privacy_waiver" reporter:label="Privacy Waiver">
2573                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2574                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2575                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2576                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2577                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2578                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2579                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2580                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2581                 </fields>
2582                 <links>
2583                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2584                 </links>
2585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2586                         <actions>
2587                                 <create permission="UPDATE_USER">
2588                                         <context link="usr" field="home_ou"/>
2589                                 </create>
2590                                 <retrieve permission="VIEW_USER">
2591                                         <context link="usr" field="home_ou"/>
2592                                 </retrieve>
2593                                 <update permission="UPDATE_USER">
2594                                         <context link="usr" field="home_ou"/>
2595                                 </update>
2596                                 <delete permission="UPDATE_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </delete>
2599                         </actions>
2600                 </permacrud>
2601         </class>
2602         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2603                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2604                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2605                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2606                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2607                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2608                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2609                 </fields>
2610                 <links>
2611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2612                 </links>
2613         </class>
2614         <class id="aus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2616                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2617                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2618                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2619                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2620                 </fields>
2621                 <links>
2622                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2623                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2624                 </links>
2625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2626                         <actions>
2627                                 <retrieve permission="VIEW_USER">
2628                                         <context link="usr" field="home_ou" />
2629                                 </retrieve>
2630                         </actions>
2631                 </permacrud>
2632         </class>
2633         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2634                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2635                         <field name="field" reporter:datatype="link"/>
2636                         <field name="id" reporter:datatype="id" />
2637                         <field name="source" reporter:datatype="link"/>
2638                         <field name="value" reporter:datatype="text"/>
2639                 </fields>
2640                 <links>
2641                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2642                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2643                 </links>
2644         </class>
2645         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2646                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2647                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2648                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2649                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2650                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2651                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2652                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2653                 </fields>
2654                 <links>
2655                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2656                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2657                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2658                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2659                 </links>
2660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2661                         <actions>
2662                                 <retrieve/>
2663                         </actions>
2664                 </permacrud>
2665         </class>
2666         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2667                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2668                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2669                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2670                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2671                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2672                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2673                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2674                 </fields>
2675                 <links>
2676                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2677                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2678                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2679                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2680                 </links>
2681                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2682                         <actions>
2683                                 <retrieve/>
2684                         </actions>
2685                 </permacrud>
2686         </class>
2687         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2688                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2689                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2690                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2691                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2692                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2693                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2694                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2695                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2696                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2697                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2698                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2699                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2700                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2701                 </fields>
2702                 <links>
2703                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2704                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2705                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2706                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2707                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2709                 </links>
2710         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2711             <actions>
2712                 <create permission="TRANSIT_COPY" context_field="owner">
2713                     <context link="target_copy" field="circ_lib"/>
2714                 </create>
2715                 <retrieve/>
2716                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2717                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2718             </actions>
2719         </permacrud>
2720         </class>
2721         <class id="asvr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_response" oils_persist:tablename="action.survey_response" reporter:label="Survey Response">
2722                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2723                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2724                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2725                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2726                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2727                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2728                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2729                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2730                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2731                 </fields>
2732                 <links>
2733                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2734                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2735                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2736                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2737                 </links>
2738         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2739             <actions>
2740                 <create permission="ADMIN_SURVEY">
2741                     <context link="survey" field="owner"/>
2742                 </create>
2743                 <retrieve permission="VIEW_USER">
2744                     <context link="usr" field="home_ou"/>
2745                 </retrieve>
2746                 <update permission="ADMIN_SURVEY">
2747                     <context link="survey" field="owner"/>
2748                 </update>
2749                 <delete permission="ADMIN_SURVEY">
2750                     <context link="survey" field="owner"/>
2751                 </delete>
2752             </actions>
2753         </permacrud>
2754         </class>
2755         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2756                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2757                         <field name="bucket" reporter:datatype="link"/>
2758                         <field name="id" reporter:datatype="id" />
2759                         <field name="target_copy" reporter:datatype="link"/>
2760                         <field name="create_time" reporter:datatype="timestamp" />
2761                         <field name="pos" reporter:datatype="int" />
2762                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2763                 </fields>
2764                 <links>
2765                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2766                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2767             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2768                 </links>
2769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2770                         <actions>
2771                                 <retrieve permission="ADMIN_COPY_BUCKET">
2772                     <context link="bucket" field="owning_lib"/>
2773                 </retrieve>
2774             </actions>
2775         </permacrud>
2776         </class>
2777         <class id="ccbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item_note" oils_persist:tablename="container.copy_bucket_item_note" reporter:label="Copy Bucket Item Note">
2778                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2779                         <field name="id" reporter:datatype="id" />
2780                         <field name="item" reporter:datatype="link"/>
2781                         <field name="note" reporter:datatype="text" />
2782                 </fields>
2783                 <links>
2784                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2785                 </links>
2786         </class>
2787
2788         <class id="acs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set" oils_persist:tablename="authority.control_set" reporter:label="Authority Control Set" oils_persist:field_safe="true">
2789                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2790                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2791                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2792                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2793                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2794                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2795                 </fields>
2796                 <links>
2797                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2798                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2799                 </links>
2800                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2801                         <actions>
2802                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2803                                 <retrieve/>
2804                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2805                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2806                         </actions>
2807                 </permacrud>
2808         </class>
2809
2810         <class id="acsaf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_authority_field" oils_persist:tablename="authority.control_set_authority_field" reporter:label="Authority Control Set Authority Field" oils_persist:field_safe="true">
2811                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2812                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2813                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2814                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2815                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2816                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2817                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2818                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2819                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2820                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2821                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2822                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2823                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2824                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2825                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2827                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2828                 </fields>
2829                 <links>
2830                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2831                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2832                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2833                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2834                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2835                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2836                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2837                 </links>
2838                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2839                         <actions>
2840                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2841                                 <retrieve/>
2842                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2843                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2844                         </actions>
2845                 </permacrud>
2846         </class>
2847
2848         <class id="acsbf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field" oils_persist:tablename="authority.control_set_bib_field" reporter:label="Authority Control Set Bib Field" oils_persist:field_safe="true">
2849                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2850                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2851                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2852                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2853                 </fields>
2854                 <links>
2855                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2856                 </links>
2857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2858                         <actions>
2859                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2860                                 <retrieve/>
2861                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2862                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2863                         </actions>
2864                 </permacrud>
2865         </class>
2866
2867         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2868                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2869                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2870                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2871                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2872                 </fields>
2873                 <links>
2874                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2875                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2876                 </links>
2877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2878                         <actions>
2879                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2880                                 <retrieve/>
2881                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2882                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2883                         </actions>
2884                 </permacrud>
2885         </class>
2886
2887         <class id="at" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::thesaurus" oils_persist:tablename="authority.thesaurus" reporter:label="Authority Thesaurus" oils_persist:field_safe="true">
2888                 <fields oils_persist:primary="code">
2889                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2890                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2891                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2892                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2893                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2894                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2895                 </fields>
2896                 <links>
2897                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2898                 </links>
2899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2900                         <actions>
2901                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2902                                 <retrieve/>
2903                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2904                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2905                         </actions>
2906                 </permacrud>
2907         </class>
2908
2909         <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis" oils_persist:field_safe="true">
2910                 <fields oils_persist:primary="code">
2911                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2912                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2913                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2914                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2915                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2916                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2917                 </fields>
2918                 <links>
2919                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2920                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2921                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2922                 </links>
2923                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2924                         <actions>
2925                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2926                                 <retrieve/>
2927                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2928                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2929                         </actions>
2930                 </permacrud>
2931         </class>
2932
2933     <class id="abaafm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis_authority_field_map" oils_persist:tablename="authority.browse_axis_authority_field_map" reporter:label="Authority Browse Axis Field Map" oils_persist:field_safe="true">
2934         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2935             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2936             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2937             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2938         </fields>
2939         <links>
2940             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2941             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2942         </links>
2943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2944             <actions>
2945                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2946                 <retrieve/>
2947                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2948                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2949             </actions>
2950         </permacrud>
2951     </class>
2952
2953         <class id="are" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_entry" oils_persist:tablename="authority.record_entry" reporter:label="Authority Record Entry">
2954                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2955                         <field name="active" reporter:datatype="bool"/>
2956                         <field name="create_date" reporter:datatype="timestamp"/>
2957                         <field name="creator" />
2958                         <field name="deleted" reporter:datatype="bool"/>
2959                         <field name="edit_date" reporter:datatype="timestamp"/>
2960                         <field name="editor" />
2961                         <field name="id" reporter:datatype="id" />
2962                         <field name="last_xact_id" />
2963                         <field name="marc" />
2964                         <field name="source" />
2965                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2966                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2967                         <field name="heading" />
2968                         <field name="simple_heading" />
2969                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2970                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2971                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2972                 </fields>
2973                 <links>
2974                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2975                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2976                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2977                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2978                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2979                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2980                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2981                 </links>
2982                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2983                         <actions>
2984                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2985                                 <retrieve/>
2986                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2987                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2988                         </actions>
2989                 </permacrud>
2990         </class>
2991         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2992                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2993                         <field name="char_encoding" />
2994                         <field name="id" />
2995                         <field name="record" />
2996                         <field name="record_status" />
2997                         <field name="thesaurus" />
2998                 </fields>
2999                 <links>
3000                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3001                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3002                 </links>
3003         </class>
3004         <class id="abl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
3005                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3006                         <field name="id" reporter:datatype="id" />
3007                         <field name="bib" reporter:datatype="link" />
3008                         <field name="authority" reporter:datatype="link" />
3009                 </fields>
3010                 <links>
3011                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3012                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3013                 </links>
3014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3015                         <actions>
3016                                 <retrieve/>
3017                         </actions>
3018                 </permacrud>
3019         </class>
3020         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3021                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3022                         <field name="id" reporter:datatype="id" />
3023                         <field name="record" reporter:datatype="link" />
3024                         <field name="atag" reporter:datatype="link" />
3025                         <field name="value" reporter:datatype="text" />
3026                         <field name="thesaurus" reporter:datatype="text" />
3027                 </fields>
3028                 <links>
3029                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3030                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3031                 </links>
3032         </class>
3033
3034         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
3035                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3036                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3037                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3038                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3039                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3040                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3041                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3042                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3043                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3044                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3045                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3046                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3047                 </fields>
3048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3049                         <actions>
3050                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3051                                 <retrieve/>
3052                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3053                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3054                         </actions>
3055                 </permacrud>
3056         </class>
3057
3058         <class id="clm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::language_map" oils_persist:tablename="config.language_map" reporter:label="Language Map" oils_persist:field_safe="true">
3059                 <fields oils_persist:primary="code" oils_persist:sequence="">
3060                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3061                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3062                 </fields>
3063                 <links/>
3064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3065             <actions>
3066                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3067                 <retrieve/>
3068                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3069                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3070             </actions>
3071         </permacrud>
3072         </class>
3073         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
3074                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3075                         <field name="accepting_usr" />
3076                         <field name="amount" reporter:datatype="money" />
3077                         <field name="amount_collected" reporter:datatype="money" />
3078                         <field name="approval_code" reporter:datatype="text"/>
3079                         <field name="cash_drawer" reporter:datatype="link"/>
3080                         <field name="cc_number" reporter:datatype="text"/>
3081                         <field name="cc_order_number" reporter:datatype="text"/>
3082                         <field name="cc_processor" reporter:datatype="text"/>
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="note" reporter:datatype="text"/>
3085                         <field name="payment_ts" reporter:datatype="timestamp"/>
3086                         <field name="xact" reporter:datatype="link"/>
3087                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3088                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3089                 </fields>
3090                 <links>
3091                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3092                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3093                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3094                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3095                 </links>
3096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3097             <actions>
3098                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3099                     <context link="xact" jump="usr" field="home_ou"/>
3100                 </retrieve>
3101                         </actions>
3102                 </permacrud>
3103         </class>
3104         <class id="cxt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::xml_transform" oils_persist:tablename="config.xml_transform" reporter:label="XML/XSLT Transform Definition" oils_persist:field_safe="true">
3105                 <fields oils_persist:primary="name">
3106                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3107                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3108                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3109                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3110                 </fields>
3111                 <links/>
3112         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3113             <actions>
3114                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3115                 <retrieve/>
3116                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3117                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3118             </actions>
3119         </permacrud>
3120         </class>
3121
3122         <class id="cmsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_search_alias" oils_persist:tablename="config.metabib_search_alias" reporter:label="Metabib Search Alias" oils_persist:field_safe="true">
3123                 <fields oils_persist:primary="alias">
3124                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3125                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3126                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3127                 </fields>
3128                 <links>
3129                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3130                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3131                 </links>
3132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3133             <actions>
3134                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3135                 <retrieve/>
3136                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3137                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3138             </actions>
3139         </permacrud>
3140         </class>
3141
3142         <class id="cmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class" oils_persist:tablename="config.metabib_class" reporter:label="Metabib Class" oils_persist:field_safe="true">
3143                 <fields oils_persist:primary="name">
3144                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3145                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3146                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3147                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3148                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3149                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3150                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3151                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3152                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3153                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3154                 </fields>
3155                 <links>
3156                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3157                 </links>
3158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3159             <actions>
3160                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3161                 <retrieve/>
3162                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3163                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3164             </actions>
3165         </permacrud>
3166         </class>
3167
3168         <class id="cmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field" oils_persist:tablename="config.metabib_field" reporter:label="Metabib Field" oils_persist:field_safe="true">
3169                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3170                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3171                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3172                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3173                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3174                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3175                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3176                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3177                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3178                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3179                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3180                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3181                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3182                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3183                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3184                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3185                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3186                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3187                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3188                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3189                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3190                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3191                 </fields>
3192                 <links>
3193                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3194                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3195                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3196                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3197                 </links>
3198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3199             <actions>
3200                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3201                 <retrieve/>
3202                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3203                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3204             </actions>
3205         </permacrud>
3206         </class>
3207
3208         <class id="cmfvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_virtual_map" oils_persist:tablename="config.metabib_field_virtual_map" reporter:label="Metabib Field Virtual Map" oils_persist:field_safe="true">
3209                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3210                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3211                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3212                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3213                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3214                 </fields>
3215                 <links>
3216                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3217                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3218                 </links>
3219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3220             <actions>
3221                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3222                 <retrieve/>
3223                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3224                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3225             </actions>
3226         </permacrud>
3227         </class>
3228
3229         <class id="cbho" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::best_hold_order" oils_persist:tablename="config.best_hold_order" reporter:label="Best-Hold Sort Order">
3230                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3231                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3232                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3233                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3234                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3235                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3236                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3237                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3238                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3239                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3240                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3241                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3242                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3243                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3244                 </fields>
3245                 <links>
3246                 </links>
3247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3248                         <actions>
3249                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3250                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3251                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3252                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3253                         </actions>
3254                 </permacrud>
3255         </class>
3256         <class id="cbfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::biblio_fingerprint" oils_persist:tablename="config.biblio_fingerprint" reporter:label="Fingerprint Definition">
3257                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3258                         <field name="id" reporter:datatype="id" />
3259                         <field name="name" reporter:datatype="text"/>
3260                         <field name="xpath" reporter:datatype="text"/>
3261                         <field name="format" reporter:datatype="link"/>
3262                         <field name="first_word" reporter:datatype="bool" />
3263                 </fields>
3264                 <links/>
3265         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3266             <actions>
3267                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3268                 <retrieve/>
3269                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3270                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3271             </actions>
3272         </permacrud>
3273         </class>
3274         <class id="cam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::audience_map" oils_persist:tablename="config.audience_map" reporter:label="Audience Map" oils_persist:field_safe="true">
3275                 <fields oils_persist:primary="code" oils_persist:sequence="">
3276                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3277                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3278                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3279                 </fields>
3280                 <links/>
3281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3282             <actions>
3283                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3284                 <retrieve/>
3285                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3286                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3287             </actions>
3288         </permacrud>
3289         </class>
3290         <class id="cifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_form_map" oils_persist:tablename="config.item_form_map" reporter:label="Item Form Map" oils_persist:field_safe="true">
3291                 <fields oils_persist:primary="code" oils_persist:sequence="">
3292                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3293                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3294                 </fields>
3295                 <links/>
3296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3297             <actions>
3298                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3299                 <retrieve/>
3300                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3301                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3302             </actions>
3303         </permacrud>
3304         </class>
3305     <class id="acmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course" oils_persist:tablename="asset.course_module_course" reporter:label="Course">
3306         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3307             <field reporter:label="ID" name="id" reporter:datatype="id" />
3308             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3309             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3310             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3311             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3312             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3313             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3314             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3315                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3316         </fields>
3317         <links>
3318             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3319             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3320             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3321                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3322         </links>
3323         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3324             <actions>
3325                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3326                 <retrieve/>
3327                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3328                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3329             </actions>
3330         </permacrud>
3331     </class>
3332     <class id="acmcu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_users" oils_persist:tablename="asset.course_module_course_users" reporter:label="Course Users">
3333         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3334             <field reporter:label="ID" name="id" reporter:datatype="id" />
3335             <field reporter:label="Course" name="course" reporter:datatype="link" />
3336             <field reporter:label="User" name="usr" reporter:datatype="link" />
3337             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3338         </fields>
3339         <links>
3340             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3341             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3342             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3343         </links>
3344         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3345             <actions>
3346                 <create permission="MANAGE_RESERVES">
3347                                         <context link="course" field="owning_lib" />
3348                 </create>
3349                 <retrieve/>
3350                 <update permission="MANAGE_RESERVES">
3351                                         <context link="course" field="owning_lib" />
3352                 </update>
3353                 <delete permission="MANAGE_RESERVES">
3354                                         <context link="course" field="owning_lib" />
3355                 </delete>
3356             </actions>
3357         </permacrud>
3358     </class>
3359     <class id="acmcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_materials" oils_persist:tablename="asset.course_module_course_materials" reporter:label="Course Materials" oils_persist:field_safe="true">
3360         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3361             <field reporter:label="ID" name="id" reporter:datatype="id" />
3362             <field reporter:label="Course" name="course" reporter:datatype="link" />
3363             <field reporter:label="Item" name="item" reporter:datatype="link" />
3364             <field reporter:label="Record" name="record" reporter:datatype="link" />
3365             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3366             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3367             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3368             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3369             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3370             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3371         </fields>
3372         <links>
3373             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3374             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3375             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3376             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3377             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3378             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3379             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3380         </links>
3381         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3382             <actions>
3383                 <create permission="MANAGE_RESERVES">
3384                                         <context link="course" field="owning_lib" />
3385                 </create>
3386                 <retrieve/>
3387                 <update permission="MANAGE_RESERVES">
3388                                         <context link="course" field="owning_lib" />
3389                 </update>
3390                 <delete permission="MANAGE_RESERVES">
3391                                         <context link="course" field="owning_lib" />
3392                 </delete>
3393             </actions>
3394         </permacrud>
3395     </class>
3396         <class id="acmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_term" oils_persist:tablename="asset.course_module_term" reporter:label="Term" oils_persist:field_safe="true">
3397                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3398                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3399                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3400             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3401                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3402                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3403                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3404                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3405                 </fields>
3406                 <links>
3407             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3408                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3409                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3410                 </links>
3411                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3412                         <actions>
3413                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3414                                 <retrieve/>
3415                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3416                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3417                         </actions>
3418                 </permacrud>
3419         </class>
3420     <class id="acmtcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_term_course_map" oils_persist:tablename="asset.course_module_term_course_map" reporter:label="Course Term Map" oils_persist:field_safe="true">
3421         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3422             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3423             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3424             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3425         </fields>
3426         <links>
3427             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3428             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3429         </links>
3430         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3431             <actions>
3432                 <create permission="MANAGE_RESERVES">
3433                                         <context link="course" field="owning_lib" />
3434                 </create>
3435                 <retrieve/>
3436                 <update permission="MANAGE_RESERVES">
3437                                         <context link="course" field="owning_lib" />
3438                 </update>
3439                 <delete permission="MANAGE_RESERVES">
3440                                         <context link="course" field="owning_lib" />
3441                 </delete>
3442             </actions>
3443         </permacrud>
3444     </class>
3445         <class id="acmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_role" oils_persist:tablename="asset.course_module_role" reporter:label="Course Role" oils_persist:field_safe="true">
3446                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3447                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3448                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3449             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3450                 </fields>
3451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3452                         <actions>
3453                                 <create permission="MANAGE_RESERVES" global_required="true" />
3454                                 <retrieve/>
3455                                 <update permission="MANAGE_RESERVES" global_required="true" />
3456                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3457                         </actions>
3458                 </permacrud>
3459         </class>
3460         
3461     <class id="acnc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_class" oils_persist:tablename="asset.call_number_class" reporter:label="Call number classification scheme">
3462         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3463             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3464             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3465             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3466             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3467         </fields>
3468         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3469             <actions>
3470                 <retrieve/>
3471             </actions>
3472         </permacrud>
3473     </class>
3474         <class id="acns" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_suffix" oils_persist:tablename="asset.call_number_suffix" reporter:label="Call Number/Volume Suffix">
3475                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3476                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3477                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3478                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3479                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3480                 </fields>
3481                 <links>
3482                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3483                 </links>
3484         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3485             <actions>
3486                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3487                 <retrieve/>
3488                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3489                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3490             </actions>
3491         </permacrud>
3492         </class>
3493         <class id="acnp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_prefix" oils_persist:tablename="asset.call_number_prefix" reporter:label="Call Number/Volume Prefix">
3494                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3495                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3496                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3497                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3498                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3499                 </fields>
3500                 <links>
3501                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3502                 </links>
3503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3504             <actions>
3505                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3506                 <retrieve/>
3507                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3508                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3509             </actions>
3510         </permacrud>
3511         </class>
3512         <class id="acn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number" oils_persist:tablename="asset.call_number" reporter:label="Call Number/Volume">
3513                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3514                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3515                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3516                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3517                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3518                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3519                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3520                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3521                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3522                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3523                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3524                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3525                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3526                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3527                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3528                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3529                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3530                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3531                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3532                 </fields>
3533                 <links>
3534                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3535                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3536                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3537                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3538                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3539                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3540                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3541                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3542                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3543                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3544                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3545                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3546                 </links>
3547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3548             <actions>
3549                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3550                 <retrieve/>
3551                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3552                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3553             </actions>
3554         </permacrud>
3555         </class>
3556         <class id="racnd" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="reporter::asset_call_number_dewey" oils_persist:tablename="reporter.asset_call_number_dewey" reporter:label="Dewey Classification">
3557                 <fields oils_persist:primary="call_number">
3558                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3559                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3560                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3561                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3562                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3563                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3564                 </fields>
3565                 <links>
3566                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3567                 </links>
3568         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3569             <actions>
3570                 <retrieve/>
3571             </actions>
3572         </permacrud>
3573         </class>
3574         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3575                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3576                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3577                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3578                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3579                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3580                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3581                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3582                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3583                 </fields>
3584                 <links>
3585                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3586                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3587         </links>
3588         </class>
3589         <class id="auricnm" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri_call_number_map" oils_persist:tablename="asset.uri_call_number_map" reporter:label="Electronic Access URI to Call Number Map">
3590                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3591                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3592                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3593                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3594                 </fields>
3595                 <links>
3596                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3597                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3598                 </links>
3599         </class>
3600         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3601                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3602                         <field name="id" reporter:datatype="id" />
3603                         <field name="value" oils_persist:i18n="true" />
3604                 </fields>
3605                 <links/>
3606         </class>
3607         <class id="mous" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_user_summary" oils_persist:tablename="money.open_usr_summary" reporter:label="Open User Summary">
3608                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3609                         <field name="balance_owed" reporter:datatype="money" />
3610                         <field name="total_owed" reporter:datatype="money" />
3611                         <field name="total_paid" reporter:datatype="money" />
3612                         <field name="usr" reporter:datatype="link"/>
3613                 </fields>
3614                 <links>
3615                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3616         </links>
3617         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3618             <actions>
3619                 <retrieve permission="VIEW_USER">
3620                     <context link="usr" field="home_ou"/>
3621                 </retrieve>
3622             </actions>
3623         </permacrud>
3624         </class>
3625         <class id="mowbus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_with_balance_user_summary" oils_persist:tablename="money.open_with_balance_usr_summary" reporter:label="Open User Summary for transactions with balances">
3626                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3627                         <field name="balance_owed" reporter:datatype="money" />
3628                         <field name="total_owed" reporter:datatype="money" />
3629                         <field name="total_paid" reporter:datatype="money" />
3630                         <field name="usr" reporter:datatype="link"/>
3631                 </fields>
3632                 <links>
3633                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3634         </links>
3635         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3636             <actions>
3637                 <retrieve permission="VIEW_USER">
3638                     <context link="usr" field="home_ou"/>
3639                 </retrieve>
3640             </actions>
3641         </permacrud>
3642         </class>
3643         <class id="mct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::collections_tracker" oils_persist:tablename="money.collections_tracker" reporter:label="Collections Tracker">
3644                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3645                         <field name="collector" />
3646                         <field name="enter_time" reporter:datatype="timestamp"/>
3647                         <field name="id" reporter:datatype="id" />
3648                         <field name="location" reporter:datatype="link"/>
3649                         <field name="usr" reporter:datatype="link"/>
3650                 </fields>
3651                 <links>
3652                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3653                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3654                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3655                 </links>
3656         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3657             <actions>
3658                 <create permission="money.collections_tracker.create" context_field="location"/>
3659                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3660                 <delete permission="money.collections_tracker.create" context_field="location"/>
3661             </actions>
3662         </permacrud>
3663         </class>
3664         <class id="bre" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_entry" oils_persist:tablename="biblio.record_entry" reporter:core="true" reporter:label="Bibliographic Record">
3665                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3666                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3667                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3668                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3669                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3670                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3671                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3672                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3673                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3674                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3675                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3676                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3677                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3678                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3679                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3680                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3681                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3682                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3683                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3684                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3685                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3686                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3687                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3688                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3689                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3690                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3691                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3692                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3693                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3694                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3695                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3696                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3697                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3698                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3699                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3700                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3701                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3704                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3705                 </fields>
3706                 <links>
3707                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3708                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3709                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3710                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3711                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3712                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3713                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3714                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3715                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3716                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3717                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3718                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3719                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3720                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3721                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3722                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3723                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3724                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3725                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3726                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3727                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3728                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3729                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3730                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3731                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3732                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3733                 </links>
3734         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3735             <actions>
3736                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3737                 <retrieve/>
3738                 <update permission="UPDATE_MARC" global_required="true"/>
3739                 <!-- WARNING: Deleting records via PCRUD does NOT check that any prerequisite conditions have been handled first. It is your responsibility to check for those conditions before deleting bib records. -->
3740                 <delete permission="DELETE_RECORD" global_required="true"/>
3741             </actions>
3742         </permacrud>
3743         </class>
3744         <class id="aouhoo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::hours_of_operation" oils_persist:tablename="actor.hours_of_operation" reporter:label="Hours of Operation">
3745                 <fields oils_persist:primary="id">
3746                         <field name="dow_0_close" />
3747                         <field name="dow_0_open" />
3748                         <field name="dow_1_close" />
3749                         <field name="dow_1_open" />
3750                         <field name="dow_2_close" />
3751                         <field name="dow_2_open" />
3752                         <field name="dow_3_close" />
3753                         <field name="dow_3_open" />
3754                         <field name="dow_4_close" />
3755                         <field name="dow_4_open" />
3756                         <field name="dow_5_close" />
3757                         <field name="dow_5_open" />
3758                         <field name="dow_6_close" />
3759                         <field name="dow_6_open" />
3760                         <field name="id" reporter:datatype="id" />
3761                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3762                 </fields>
3763                 <links>
3764                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3765                 </links>
3766         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3767             <actions>
3768                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3769                 <retrieve/>
3770                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3771                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3772             </actions>
3773         </permacrud>
3774         </class>
3775         <class id="bmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::monograph_part" oils_persist:tablename="biblio.monograph_part" reporter:label="Monograph Parts" oils_persist:field_safe="true">
3776                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3777                         <field name="id" reporter:datatype="id" />
3778                         <field name="record" reporter:datatype="link"/>
3779                         <field name="label" reporter:datatype="text"/>
3780                         <field name="label_sortkey" reporter:datatype="text"/>
3781                         <field name="deleted" reporter:datatype="bool"/>
3782                 </fields>
3783                 <links>
3784                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3785                 </links>
3786         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3787             <actions>
3788                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3789                 <retrieve/>
3790                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3791                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3792             </actions>
3793         </permacrud>
3794         </class>
3795         <class id="acpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_part_map" oils_persist:tablename="asset.copy_part_map" reporter:label="Copy Monograph Part Map">
3796                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3797                         <field name="id" reporter:datatype="id" />
3798                         <field name="target_copy" reporter:datatype="link" />
3799                         <field name="part" reporter:datatype="link"/>
3800                 </fields>
3801                 <links>
3802                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3803                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3804                 </links>
3805         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3806             <actions>
3807                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3808                 <retrieve/>
3809                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3810                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3811             </actions>
3812         </permacrud>
3813         </class>
3814     <class  id="aecc"
3815             controller="open-ils.cstore open-ils.pcrud"
3816             oils_obj:fieldmapper="action::emergency_closing_circulation"
3817             oils_persist:tablename="action.emergency_closing_circulation"
3818             reporter:label="Emergency Closing Circulation Entry"
3819             oils_persist:readonly="true"
3820     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3821         <fields oils_persist:primary="id">
3822             <field name="id" reporter:datatype="id" />
3823             <field name="circulation" reporter:datatype="link" />
3824                         <field name="emergency_closing" reporter:datatype="link"/>
3825             <field name="original_due_date" reporter:datatype="timestamp" />
3826             <field name="process_time" reporter:datatype="timestamp" />
3827         </fields>
3828         <links>
3829             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3830             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3831         </links>
3832         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3833             <actions>
3834                 <retrieve/>
3835             </actions>
3836         </permacrud>
3837     </class>
3838     <class  id="aecr"
3839             controller="open-ils.cstore open-ils.pcrud"
3840             oils_obj:fieldmapper="action::emergency_closing_reservation"
3841             oils_persist:tablename="action.emergency_closing_reservation"
3842             reporter:label="Emergency Closing Reservation Entry"
3843             oils_persist:readonly="true"
3844     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3845         <fields oils_persist:primary="id">
3846             <field name="id" reporter:datatype="id" />
3847             <field name="reservation" reporter:datatype="link" />
3848                         <field name="emergency_closing" reporter:datatype="link"/>
3849             <field name="original_end_time" reporter:datatype="timestamp" />
3850             <field name="process_time" reporter:datatype="timestamp" />
3851         </fields>
3852         <links>
3853             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3854             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3855         </links>
3856         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3857             <actions>
3858                 <retrieve/>
3859             </actions>
3860         </permacrud>
3861     </class>
3862     <class  id="aech"
3863             controller="open-ils.cstore open-ils.pcrud"
3864             oils_obj:fieldmapper="action::emergency_closing_hold"
3865             oils_persist:tablename="action.emergency_closing_hold"
3866             reporter:label="Emergency Closing Hold Entry"
3867             oils_persist:readonly="true"
3868     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3869         <fields oils_persist:primary="id">
3870             <field name="id" reporter:datatype="id" />
3871             <field name="hold" reporter:datatype="link" />
3872                         <field name="emergency_closing" reporter:datatype="link"/>
3873             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3874             <field name="process_time" reporter:datatype="timestamp" />
3875         </fields>
3876         <links>
3877             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3878             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3879         </links>
3880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3881             <actions>
3882                 <retrieve/>
3883             </actions>
3884         </permacrud>
3885     </class>
3886     <class  id="aecs"
3887             controller="open-ils.cstore open-ils.pcrud"
3888             oils_obj:fieldmapper="action::emergency_closing_status"
3889             oils_persist:tablename="action.emergency_closing_status"
3890             reporter:label="Emergency Closing Status"
3891             oils_persist:readonly="true"
3892     >
3893         <fields oils_persist:primary="id">
3894             <field name="id" reporter:datatype="id" />
3895             <field name="creator" reporter:datatype="link" />
3896             <field name="create_time" reporter:datatype="timestamp" />
3897             <field name="process_start_time" reporter:datatype="timestamp" />
3898             <field name="process_end_time" reporter:datatype="timestamp" />
3899             <field name="last_update_time" reporter:datatype="timestamp" />
3900             <field name="circulations" reporter:datatype="int" />
3901             <field name="circulations_complete" reporter:datatype="int" />
3902             <field name="reservations" reporter:datatype="int" />
3903             <field name="reservations_complete" reporter:datatype="int" />
3904             <field name="holds" reporter:datatype="int" />
3905             <field name="holds_complete" reporter:datatype="int" />
3906         </fields>
3907         <links>
3908             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3909         </links>
3910         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3911             <actions>
3912                 <retrieve/>
3913             </actions>
3914         </permacrud>
3915     </class>
3916     <class id="aec" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing" oils_persist:tablename="action.emergency_closing" reporter:label="Emergency Closing">
3917         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3918             <field name="id" reporter:datatype="id" />
3919             <field name="creator" reporter:datatype="link" />
3920             <field name="create_time" reporter:datatype="timestamp" />
3921             <field name="process_start_time" reporter:datatype="timestamp" />
3922             <field name="process_end_time" reporter:datatype="timestamp" />
3923             <field name="last_update_time" reporter:datatype="timestamp" />
3924             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3925             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3926             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3927             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3928             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3929         </fields>
3930         <links>
3931             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3932             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3933             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3934             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3935             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3936             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3937         </links>
3938         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3939             <actions>
3940                 <create permission="EMERGENCY_CLOSING">
3941                     <context link="closing" field="org_unit" />
3942                 </create>
3943                 <retrieve/>
3944                 <update permission="EMERGENCY_CLOSING">
3945                     <context link="closing" field="org_unit" />
3946                 </update>
3947                 <delete permission="EMERGENCY_CLOSING">
3948                     <context link="closing" field="org_unit" />
3949                 </delete>
3950             </actions>
3951         </permacrud>
3952     </class>
3953         <class id="aoucd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::closed_date" oils_persist:tablename="actor.org_unit_closed" reporter:label="Closed Dates">
3954                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3955                         <field name="close_end" reporter:datatype="timestamp" />
3956                         <field name="close_start" reporter:datatype="timestamp" />
3957                         <field name="id" reporter:datatype="id" />
3958                         <field name="org_unit" reporter:datatype="org_unit"/>
3959                         <field name="reason" reporter:datatype="text"/>
3960                         <field name="full_day" reporter:datatype="bool"/>
3961                         <field name="multi_day" reporter:datatype="bool"/>
3962                         <field name="emergency_closing" reporter:datatype="link"/>
3963                 </fields>
3964                 <links>
3965                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3966                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3967                 </links>
3968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3969             <actions>
3970                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3971                 <retrieve/>
3972                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3973                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3974             </actions>
3975         </permacrud>
3976         </class>
3977         <class id="crcd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::circ_duration" oils_persist:tablename="config.rule_circ_duration" reporter:label="Circulation Duration Rule">
3978                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3979                         <field name="extended" reporter:datatype="interval"/>
3980                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3981                         <field name="max_renewals" reporter:datatype="int" />
3982                         <field name="name" reporter:datatype="text"/>
3983                         <field name="normal" reporter:datatype="interval"/>
3984                         <field name="shrt" reporter:datatype="interval"/>
3985                         <field name="max_auto_renewals" reporter:datatype="int" />
3986                 </fields>
3987                 <links>
3988                 </links>
3989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3990             <actions>
3991                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3992                 <retrieve/>
3993                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3994                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3995             </actions>
3996         </permacrud>
3997         </class>
3998
3999         <class id="chdd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date" oils_persist:tablename="config.hard_due_date" reporter:label="Hard Due Date">
4000                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4001                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4002                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4003             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4004                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4005             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4006                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4007                                 reporter:datatype="link" config_field="true"/>
4008                 </fields>
4009                 <links>
4010             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4011                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4012                 </links>
4013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4014             <actions>
4015                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4016                 <retrieve/>
4017                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4018                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4019             </actions>
4020                 </permacrud>
4021         </class>
4022
4023         <class id="chddv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date_values" oils_persist:tablename="config.hard_due_date_values" reporter:label="Hard Due Date Values">
4024                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4025                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4026                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4027                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4028             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4029                 </fields>
4030                 <links>
4031                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4032                 </links>
4033                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4034             <actions>
4035                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4036                 <retrieve/>
4037                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4038                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4039             </actions>
4040                 </permacrud>
4041         </class>
4042
4043         <class id="mobts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_billable_transaction_summary" oils_persist:tablename="money.open_billable_xact_summary" reporter:label="Open Billable Transaction Summary">
4044                 <fields oils_persist:primary="id" oils_persist:sequence="">
4045                         <field name="balance_owed" reporter:datatype="money"/>
4046                         <field name="id" reporter:datatype="id" />
4047                         <field name="last_billing_note" reporter:datatype="text"/>
4048                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4049                         <field name="last_billing_type" reporter:datatype="text"/>
4050                         <field name="last_payment_note" reporter:datatype="text"/>
4051                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4052                         <field name="last_payment_type" reporter:datatype="text"/>
4053                         <field name="total_owed" reporter:datatype="money"/>
4054                         <field name="total_paid" reporter:datatype="money"/>
4055                         <field name="usr" reporter:datatype="link"/>
4056                         <field name="xact_finish" reporter:datatype="timestamp" />
4057                         <field name="xact_start" reporter:datatype="timestamp" />
4058                         <field name="xact_type" reporter:datatype="text"/>
4059                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4060                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4061                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4062                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4063                         <field name="billing_location" reporter:datatype="link"/>
4064                 </fields>
4065                 <links>
4066                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4067                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4068                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4069                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4070                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4071                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4072                 </links>
4073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4074                         <actions>
4075                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4076                                         <context link="usr" field="home_ou" />
4077                                 </retrieve>
4078                         </actions>
4079                 </permacrud>
4080         </class>
4081         <class id="au" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user" oils_persist:tablename="actor.usr" reporter:core="true" reporter:label="ILS User">
4082                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4083                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4084                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4085                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4086                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4087                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4088                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4089                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4090                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4091                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4092                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4093                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4094                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4095                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4096                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4097                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4098                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4099                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4100                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4101                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4102                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4103                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4104                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4105                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4106                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4107                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4108                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4109                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4110                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4111                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4112                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4113                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4114                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4115                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4116                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4117                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4118                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4119                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4120                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4121                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4122                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4123                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4124                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4125                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4126                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4127                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4128                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4129                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4130                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4131                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4132                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4133                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4134                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4135                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4136                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4137                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4138                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4139                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4140                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4141                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4142                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4143                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4144                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4145                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4146                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4147                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4148                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4149                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4150                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4151                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4152                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4153                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4154                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4155             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4156                 </fields>
4157                 <links>
4158                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4159                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4160                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4161                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4162                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4163                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4164                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4165                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4166                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4167                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4168                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4169                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4170                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4171                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4172                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4173                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4174                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4175                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4176                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4177                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4178                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4179                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4180                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4181                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4182                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4183                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4184                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4185                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4186                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4187                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4188                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4189                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4190             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4191                 </links>
4192                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4193                         <actions>
4194                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4195                         </actions>
4196                 </permacrud>
4197         </class>
4198         <class id="cuat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_activity_type" oils_persist:tablename="config.usr_activity_type" reporter:label="User Activity Type">
4199                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4200                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4201                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4202                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4203                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4204                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4205                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4206                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4207                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4208         </fields>
4209                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4210                         <actions>
4211                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4212                                 <retrieve/>
4213                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4214                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4215                         </actions>
4216                 </permacrud>
4217         </class>
4218         <class id="auact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_activity" oils_persist:tablename="actor.usr_activity" reporter:label="User Activity">
4219                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4220                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4221                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4222                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4223                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4224         </fields>
4225         <links>
4226                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4227                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4228                 </links>
4229                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4230                         <actions>
4231                                 <retrieve permission="RUN_REPORTS">
4232                                         <context link="usr" field="home_ou" />
4233                                 </retrieve>
4234                         </actions>
4235                 </permacrud>
4236         </class>
4237         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4238                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4239                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4240                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4241                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4242                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4243                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4244                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4245         </fields>
4246         <links>
4247                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4248                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4249                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4250                 </links>
4251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4252                         <actions>
4253                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4254                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4255                                         <context link="usr" field="home_ou" />
4256                                         <context link="ws" field="owning_lib" />
4257                                 </retrieve>
4258                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4259                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4260                         </actions>
4261                 </permacrud>
4262         </class>
4263         <class id="csg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::settings_group" oils_persist:tablename="config.settings_group" reporter:label="Settings Group">
4264                 <fields oils_persist:primary="name">
4265                         <field name="name" reporter:datatype="text"/>
4266                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4267                 </fields>
4268                 <links/>
4269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4270                         <actions>
4271                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4272                                 <retrieve/>
4273                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4274                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4275                         </actions>
4276                 </permacrud>
4277         </class>
4278         <class id="cust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_setting_type" oils_persist:tablename="config.usr_setting_type" reporter:label="User Setting Type">
4279                 <fields oils_persist:primary="name">
4280                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4281                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4282                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4283                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4284                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4285                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4286                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4287                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4288                 </fields>
4289                 <links>
4290                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4291                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4292                 </links>
4293                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4294                         <actions>
4295                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4296                                 <retrieve/>
4297                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4298                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4299                         </actions>
4300                 </permacrud>
4301         </class>
4302         <class id="coust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::org_unit_setting_type" oils_persist:tablename="config.org_unit_setting_type" reporter:label="Organizational Unit Setting Type">
4303                 <fields oils_persist:primary="name">
4304                         <field name="name" reporter:datatype="text"/>
4305                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4306                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4307                         <field name="datatype" reporter:datatype="text"/>
4308                         <field name="view_perm" reporter:datatype="link"/>
4309                         <field name="update_perm" reporter:datatype="link"/>
4310                         <field name="fm_class" reporter:datatype="text"/>
4311                         <field name="grp" reporter:datatype="link"/>
4312                 </fields>
4313                 <links>
4314                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4315                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4316                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4317                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4318                 </links>
4319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4320                         <actions>
4321                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4322                                 <retrieve/>
4323                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4324                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4325                         </actions>
4326                 </permacrud>
4327         </class>
4328         <class id="aous" controller="open-ils.cstore" oils_obj:fieldmapper="actor::org_unit_setting" oils_persist:tablename="actor.org_unit_setting" reporter:label="Organizational Unit Setting">
4329                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4330                         <field name="id" />
4331                         <field name="name"  reporter:datatype="text"/>
4332                         <field name="org_unit" reporter:datatype="org_unit"/>
4333                         <field name="value"  reporter:datatype="text"/>
4334                 </fields>
4335                 <links>
4336                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4337                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4338                 </links>
4339         </class>
4340         <class id="acpn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_note" oils_persist:tablename="asset.copy_note" reporter:label="Copy Note">
4341                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4342                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4343                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4344                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4345                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4346                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4347                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4348                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4349                 </fields>
4350                 <links>
4351                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4352                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4353                 </links>
4354         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4355             <actions>
4356                 <create permission="CREATE_COPY_NOTE">
4357                     <context link="owning_copy" field="circ_lib"/>
4358                 </create>
4359                 <retrieve permission="VIEW_COPY_NOTES">
4360                     <context link="owning_copy" field="circ_lib"/>
4361                 </retrieve>
4362                 <update permission="UPDATE_COPY_NOTE">
4363                     <context link="owning_copy" field="circ_lib"/>
4364                 </update>
4365                 <delete permission="DELETE_COPY_NOTE">
4366                     <context link="owning_copy" field="circ_lib"/>
4367                 </delete>
4368             </actions>
4369         </permacrud>
4370         </class>
4371         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4372                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4373                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4374                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4375                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4376                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4377                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4378                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4379                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4380                 </fields>
4381                 <links>
4382                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4383                 </links>
4384         </class>
4385         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4386                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4387                         <field name="fingerprint"  reporter:datatype="text"/>
4388                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4389                         <field name="master_record" reporter:datatype="link"/>
4390                         <field name="mods"  reporter:datatype="text"/>
4391                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4392                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4393                 </fields>
4394                 <links>
4395                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4396                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4397                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4398                 </links>
4399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4400                         <actions>
4401                                 <retrieve/>
4402                         </actions>
4403                 </permacrud>
4404         </class>
4405         <class id="cnal" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::net_access_level" oils_persist:tablename="config.net_access_level" reporter:label="Net Access Level">
4406                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4407                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4408                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4409                 </fields>
4410                 <links/>
4411         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4412             <actions>
4413                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4414                 <retrieve/>
4415                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4416                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4417             </actions>
4418         </permacrud>
4419         </class>
4420         <class id="ppl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::perm_list" oils_persist:tablename="permission.perm_list" reporter:label="Permission List">
4421                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4422                         <field name="code"  reporter:datatype="text"/>
4423                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4424                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4425                 </fields>
4426                 <links/>
4427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4428             <actions>
4429                 <create permission="CREATE_PERM" global_required="true"/>
4430                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4431                 <update permission="UPDATE_PERM" global_required="true"/>
4432                 <delete permission="DELETE_PERM" global_required="true"/>
4433             </actions>
4434         </permacrud>
4435         </class>
4436         <class id="mmrsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
4437                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4438                         <field name="id" reporter:datatype="id" />
4439                         <field name="metarecord" reporter:datatype="link"/>
4440                         <field name="source" reporter:datatype="link"/>
4441                 </fields>
4442                 <links>
4443                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4444                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4445                 </links>
4446                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4447                         <actions>
4448                                 <retrieve/>
4449                         </actions>
4450                 </permacrud>
4451         </class>
4452         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4453                         oils_obj:fieldmapper="metabib::display_entry" 
4454                         oils_persist:tablename="metabib.display_entry" 
4455                         oils_persist:field_safe="true"
4456                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4457                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4458                         <field name="id" reporter:datatype="id" />
4459                         <field name="field" reporter:datatype="link"/>
4460                         <field name="source" reporter:datatype="link"/>
4461                         <field name="value"  reporter:datatype="text"/>
4462                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4463                 </fields>
4464                 <links>
4465                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4466                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4467                 </links>
4468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4469                         <actions>
4470                                 <retrieve/>
4471                         </actions>
4472                 </permacrud>
4473         </class>
4474         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4475                 oils_persist:tablename="metabib.flat_display_entry"
4476                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4477                 oils_persist:field_safe="true"
4478                 reporter:label="Flat Display Entry" 
4479                 oils_persist:readonly="true">
4480                 <fields>
4481                         <field name="source" reporter:datatype="id" />
4482                         <field name="name" reporter:datatype="text"/>
4483                         <field name="multi" reporter:datatype="bool"/>
4484                         <field name="label" reporter:datatype="text"/>
4485                         <field name="field" reporter:datatype="link"/>
4486                         <field name="value" reporter:datatype="text"/>
4487                 </fields>
4488                 <links>
4489                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4490                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4491                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4492                 </links>
4493                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4494                         <actions>
4495                                 <retrieve/>
4496                         </actions>
4497                 </permacrud>
4498         </class>
4499         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4500                 oils_persist:tablename="metabib.compressed_display_entry"
4501                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4502                 oils_persist:field_safe="true"
4503                 reporter:label="Compressed Display Entry" 
4504                 oils_persist:readonly="true">
4505                 <fields>
4506                         <field name="source" reporter:datatype="id" />
4507                         <field name="name" reporter:datatype="text"/>
4508                         <field name="multi" reporter:datatype="bool"/>
4509                         <field name="label" reporter:datatype="text"/>
4510                         <field name="field" reporter:datatype="link"/>
4511                         <field name="value" reporter:datatype="text"/>
4512                 </fields>
4513                 <links>
4514                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4515                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4516                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4517                 </links>
4518                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4519                         <actions>
4520                                 <retrieve/>
4521                         </actions>
4522                 </permacrud>
4523         </class>
4524         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4525                 oils_persist:tablename="metabib.wide_display_entry"
4526                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4527                 oils_persist:field_safe="true"
4528                 reporter:label="Wide Display Entry" 
4529                 oils_persist:readonly="true">
4530                 <fields oils_persist:primary="source">
4531                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4532                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4533                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4534                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4535                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4536                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4537                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4538                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4539                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4540                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4541                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4542                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4543                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4544                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4545                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4546                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4547                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4548                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4549                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4550                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4551                 </fields>
4552                 <links>
4553                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4554                 </links>
4555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4556                         <actions>
4557                                 <retrieve/>
4558                         </actions>
4559                 </permacrud>
4560         </class>
4561
4562         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4563                 oils_persist:tablename="config.display_field_map"
4564                 oils_obj:fieldmapper="config::display_field_map"
4565                 oils_persist:field_safe="true"
4566                 reporter:label="Display Field Map">
4567                 <fields oils_persist:primary="name">
4568                         <field name="name" reporter:datatype="text"/>
4569                         <field name="field" reporter:datatype="link"/>
4570                         <field name="multi" reporter:datatype="bool"/>
4571                 </fields>
4572                 <links>
4573                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4574                 </links>
4575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4576                         <actions>
4577                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4578                                 <retrieve/>
4579                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4580                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4581                         </actions>
4582                 </permacrud>
4583         </class>
4584
4585         <class id="mfae" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::facet_entry" oils_persist:tablename="metabib.facet_entry" reporter:label="Combined Facet Entry" oils_persist:readonly="true">
4586                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4587                         <field name="id" reporter:datatype="id" />
4588                         <field name="field" reporter:datatype="link"/>
4589                         <field name="source" reporter:datatype="link"/>
4590                         <field name="value"  reporter:datatype="text"/>
4591                 </fields>
4592                 <links>
4593                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4594                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4595                 </links>
4596         </class>
4597         <class id="mbe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry" oils_persist:tablename="metabib.browse_entry" reporter:label="Combined Browse Entry" oils_persist:readonly="true">
4598                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4599                         <field name="id" reporter:datatype="id" />
4600                         <field name="value" reporter:datatype="text"/>
4601                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4602                 </fields>
4603                 <links>
4604                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4605                 </links>
4606                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4607                         <actions>
4608                                 <retrieve/>
4609                         </actions>
4610                 </permacrud>
4611         </class>
4612         <class id="mbedm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_def_map" oils_persist:tablename="metabib.browse_entry_def_map" reporter:label="Combined Browse Entry Definition Map" oils_persist:readonly="true">
4613                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4614                         <field name="id" reporter:datatype="id" />
4615                         <field name="entry" reporter:datatype="link"/>
4616                         <field name="def" reporter:datatype="link"/>
4617                         <field name="source" reporter:datatype="link"/>
4618                 </fields>
4619                 <links>
4620                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4621                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4622                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4623                 </links>
4624         </class>
4625         <class id="mbeshm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_simple_heading_map" oils_persist:tablename="metabib.browse_entry_simple_heading_map" reporter:label="Combined Browse Entry Simple Authority Heading Map" oils_persist:readonly="true">
4626                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4627                         <field name="id" reporter:datatype="id" />
4628                         <field name="entry" reporter:datatype="link"/>
4629                         <field name="simple_heading" reporter:datatype="link"/>
4630                 </fields>
4631                 <links>
4632                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4633                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4634                 </links>
4635         </class>
4636         <class id="mfe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::field_entry" reporter:label="Combined Field Entry View" oils_persist:readonly="true">
4637                 <oils_persist:source_definition><![CDATA[
4638                         SELECT * FROM metabib.author_field_entry
4639                                                 UNION ALL
4640                         SELECT * FROM metabib.keyword_field_entry
4641                                                 UNION ALL
4642                         SELECT * FROM metabib.identifier_field_entry
4643                                                 UNION ALL
4644                         SELECT * FROM metabib.title_field_entry
4645                                                 UNION ALL
4646                         SELECT * FROM metabib.subject_field_entry
4647                                                 UNION ALL
4648                         SELECT * FROM metabib.series_field_entry
4649                 ]]></oils_persist:source_definition>
4650                 <fields>
4651                         <field name="field" reporter:datatype="link"/>
4652                         <field name="id" reporter:datatype="id" />
4653                         <field name="source" reporter:datatype="link"/>
4654                         <field name="value"  reporter:datatype="text"/>
4655                 </fields>
4656                 <links>
4657                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4658                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4659                 </links>
4660         </class>
4661         <class id="mkfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::keyword_field_entry" oils_persist:tablename="metabib.keyword_field_entry" reporter:label="Keyword Field Entry">
4662                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4663                         <field name="field" reporter:datatype="link"/>
4664                         <field name="id" reporter:datatype="id" />
4665                         <field name="source" reporter:datatype="link"/>
4666                         <field name="value"  reporter:datatype="text"/>
4667                 </fields>
4668                 <links>
4669                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4670                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4671                 </links>
4672         </class>
4673         <class id="mcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::cash_payment" oils_persist:tablename="money.cash_payment" reporter:label="Cash Payment">
4674                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4675                         <field name="accepting_usr" reporter:datatype="link"/>
4676                         <field name="amount" reporter:datatype="money" />
4677                         <field name="amount_collected" reporter:datatype="money" />
4678                         <field name="cash_drawer" reporter:datatype="link"/>
4679                         <field name="id" reporter:datatype="id" />
4680                         <field name="note"  reporter:datatype="text"/>
4681                         <field name="payment_ts" reporter:datatype="timestamp"/>
4682                         <field name="xact" reporter:datatype="link"/>
4683                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4684                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4685                 </fields>
4686                 <links>
4687                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4688                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4689                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4690                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4691                 </links>
4692         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4693             <actions>
4694                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4695                     <context link="xact" jump="usr" field="home_ou"/>
4696                 </retrieve>
4697                         </actions>
4698                 </permacrud>
4699         </class>
4700         <class id="mfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::forgive_payment" oils_persist:tablename="money.forgive_payment" reporter:label="Forgive Payment">
4701                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4702                         <field name="accepting_usr" reporter:datatype="link"/>
4703                         <field name="amount" reporter:datatype="money" />
4704                         <field name="amount_collected" reporter:datatype="money" />
4705                         <field name="id" reporter:datatype="id" />
4706                         <field name="note"  reporter:datatype="text"/>
4707                         <field name="payment_ts" reporter:datatype="timestamp"/>
4708                         <field name="xact" reporter:datatype="link"/>
4709                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4710                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4711                 </fields>
4712                 <links>
4713                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4714                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4715                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4716                 </links>
4717         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4718             <actions>
4719                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4720                     <context link="xact" jump="usr" field="home_ou"/>
4721                 </retrieve>
4722                         </actions>
4723                 </permacrud>
4724         </class>
4725         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4726                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4727                         <field name="accepting_usr" reporter:datatype="link"/>
4728                         <field name="amount" reporter:datatype="money" />
4729                         <field name="amount_collected" reporter:datatype="money" />
4730                         <field name="id" reporter:datatype="id" />
4731                         <field name="note"  reporter:datatype="text"/>
4732                         <field name="payment_ts" reporter:datatype="timestamp"/>
4733                         <field name="xact" reporter:datatype="link"/>
4734                         <field name="billing" reporter:datatype="link"/>
4735                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4736                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4737                 </fields>
4738                 <links>
4739                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4740                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4741                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4742                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4743                 </links>
4744         </class>
4745         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4746                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4747                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4748                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4749                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4750                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4751                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4752                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4753                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4754                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4755                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4756                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4757                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4758                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4759                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4760                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4761                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4762                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4763                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4764                 </fields>
4765                 <links>
4766                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4767                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4768                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4769                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4770                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4771                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4772                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4773                 </links>
4774         </class>
4775
4776         <class id="csp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::standing_penalty" oils_persist:tablename="config.standing_penalty" reporter:label="Standing Penalty">
4777                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4778                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4779                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4780                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4781                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4782                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4783                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4784                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4785                 </fields>
4786                 <links/>
4787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4788             <actions>
4789                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4790                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4791                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4792                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4793             </actions>
4794         </permacrud>
4795         </class>
4796         <class id="pgpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_penalty_threshold" oils_persist:tablename="permission.grp_penalty_threshold" reporter:label="Group Penalty Threshold">
4797                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4798                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4799                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4800                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4801                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4802                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4803                 </fields>
4804                 <links>
4805                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4806                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4807                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4808         </links>
4809         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4810             <actions>
4811                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4812                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4813                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4814                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4815             </actions>
4816         </permacrud>
4817         </class>
4818         <class id="ccs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_status" oils_persist:tablename="config.copy_status" oils_persist:restrict_primary="100" reporter:label="Item Status" oils_persist:field_safe="true">
4819                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4820                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4821                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4822                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4823                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4824             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4825             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4826             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4827             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4828                 </fields>
4829                 <links/>
4830         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4831             <actions>
4832                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4833                 <retrieve/>
4834                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4835                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4836             </actions>
4837         </permacrud>
4838         </class>
4839         <class id="ausp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_standing_penalty" oils_persist:tablename="actor.usr_standing_penalty" oils_persist:restrict_primary="100" reporter:label="User Standing Penalty">
4840                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4841                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4842                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4843                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4844                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4845                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4846                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4847                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4848                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4849                 </fields>
4850                 <links>
4851                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4852                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4853                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4854                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4855                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4856                 </links>
4857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4858                         <actions>
4859                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4860                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4861                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4862                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4863                         </actions>
4864                 </permacrud>
4865         </class>
4866         <class id="aua" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
4867                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4868                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4869                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4870                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4871                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4872                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4873                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4874                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4875                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4876                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4877                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4878                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4879                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4880                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4881                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4882                 </fields>
4883                 <links>
4884                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4885                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4886                 </links>
4887                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4888                         <actions>
4889                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4890                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4891                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4892                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4893                         </actions>
4894                 </permacrud>
4895         </class>
4896         <class id="aal" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::address_alert" oils_persist:tablename="actor.address_alert" reporter:label="Address Alert">
4897                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4898                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4899                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4900                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4901                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4902                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4903                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4904                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4905                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4906                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4907                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4908                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4909                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4910                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4911                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4912                 </fields>
4913                 <links>
4914                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4915                 </links>
4916                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4917                         <actions>
4918                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4919                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4920                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4921                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4922                         </actions>
4923                 </permacrud>
4924         </class>
4925
4926
4927         <class id="auss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_saved_search" oils_persist:tablename="actor.usr_saved_search" reporter:label="User Saved Search">
4928                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4929                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4930                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4931                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4932                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4933                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4934                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4935                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4936                 </fields>
4937                 <links>
4938                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4939                 </links>
4940         </class>
4941
4942         <class id="acnn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_note" oils_persist:tablename="asset.call_number_note" reporter:label="Call Number Note">
4943                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4944                         <field name="call_number" />
4945                         <field name="create_date" reporter:datatype="timestamp"/>
4946                         <field name="creator" reporter:datatype="link"/>
4947                         <field name="id" reporter:datatype="id" />
4948                         <field name="pub" reporter:datatype="bool"/>
4949                         <field name="title"  reporter:datatype="text"/>
4950                         <field name="value"  reporter:datatype="text"/>
4951                 </fields>
4952                 <links>
4953                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4954                 </links>
4955         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4956             <actions>
4957                 <create permission="CREATE_VOLUME_NOTE">
4958                     <context link="call_number" field="owning_lib"/>
4959                 </create>
4960                 <retrieve permission="VIEW_VOLUME_NOTES">
4961                     <context link="call_number" field="owning_lib"/>
4962                 </retrieve>
4963                 <update permission="UPDATE_VOLUME_NOTE">
4964                     <context link="call_number" field="owning_lib"/>
4965                 </update>
4966                 <delete permission="DELETE_VOLUME_NOTE">
4967                     <context link="call_number" field="owning_lib"/>
4968                 </delete>
4969             </actions>
4970         </permacrud>
4971         </class>
4972         <class id="arn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_note" oils_persist:tablename="authority.record_note" reporter:label="Authority Record Note">
4973                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4974                         <field name="create_date" reporter:datatype="timestamp"/>
4975                         <field name="creator" reporter:datatype="link"/>
4976                         <field name="edit_date" reporter:datatype="timestamp"/>
4977                         <field name="editor" reporter:datatype="link"/>
4978                         <field name="id" reporter:datatype="id" />
4979                         <field name="record" reporter:datatype="link"/>
4980                         <field name="value" reporter:datatype="text"/>
4981                 </fields>
4982                 <links>
4983                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4984                 </links>
4985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4986             <actions>
4987                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4988                 <retrieve/>
4989                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4990                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4991             </actions>
4992         </permacrud>
4993         </class>
4994         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4995         <oils_persist:source_definition><![CDATA[
4996 SELECT  usr,
4997         SUM(
4998             CASE
4999                 WHEN (
5000                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5001                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5002                 ) THEN 1
5003                 ELSE 0
5004             END
5005         ) AS out,
5006
5007         SUM(
5008             CASE
5009                 WHEN (
5010                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5011                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5012                 ) THEN 1
5013                 ELSE 0
5014             END
5015         ) AS overdue,
5016
5017         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5018         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5019         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5020   FROM  action.circulation
5021   WHERE checkin_time IS NULL
5022   GROUP BY 1
5023         ]]></oils_persist:source_definition>
5024         <fields oils_persist:primary="usr">
5025             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5026             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5027             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5028             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5029             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5030             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5031         </fields>
5032         <links>
5033             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5034         </links>
5035         </class>
5036         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5037         <oils_persist:source_definition><![CDATA[
5038 SELECT  usr,
5039         STRING_AGG(
5040             CASE
5041                 WHEN (
5042                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5043                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5044                 ) THEN id::TEXT
5045                 ELSE '0'
5046             END
5047         ,',') AS out,
5048
5049         STRING_AGG(
5050             CASE
5051                 WHEN (
5052                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5053                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5054                 ) THEN id::TEXT
5055                 ELSE '0'
5056             END
5057         ,',') AS overdue,
5058
5059         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5060         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5061         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5062   FROM  action.circulation
5063   WHERE checkin_time IS NULL
5064   GROUP BY 1
5065         ]]></oils_persist:source_definition>
5066         <fields oils_persist:primary="usr">
5067             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5068             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5069             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5070             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5071             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5072             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5073         </fields>
5074         <links>
5075             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5076         </links>
5077         </class>
5078         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5079                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5080                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5081                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5082                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5083                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5084                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5085                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5086                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5087                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5088                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5089                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5090                 </fields>
5091                 <links>
5092                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5093                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5094                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5095                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5096                 </links>
5097         </class>
5098         <class id="circ" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circulation" oils_persist:tablename="action.circulation" reporter:core="true" reporter:label="Circulation">
5099                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5100                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5101                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5102                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5103                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5104                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5105                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5106                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5107                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5108                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5109                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5110                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5111                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5112                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5113                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5114                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5115                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5116                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5117                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5118                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5119                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5120                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5121                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5122                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5123                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5124                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5125                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5126                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5127                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5128                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5129                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5130                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5131                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5132                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5133                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5134                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5135                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5136                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5137                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5138                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5139                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5140                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5141                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5142                 </fields>
5143                 <links>
5144                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5145                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5146                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5147                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5148                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5149                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5150                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5151                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5152                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5153                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5154                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5155                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5156                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5157                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5158                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5159                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5160                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5161                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5162                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5163                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5164                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5165                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5166                 </links>
5167                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5168                         <actions>
5169                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5170                         </actions>
5171                 </permacrud>
5172         </class>
5173         <class id="aacct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_combined_types" oils_persist:tablename="action.all_circulation_combined_types" reporter:core="true" reporter:label="All Circulation Combined Types" oils_persist:readonly="true">
5174                 <fields>
5175                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5176                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5177                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5178                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5179                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5180                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5181                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5182                 </fields>
5183                 <links>
5184                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5185                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5186                 </links>
5187                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5188                         <actions>
5189                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5190                         </actions>
5191                 </permacrud>
5192         </class>
5193         <class id="aacs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_slim" oils_persist:tablename="action.all_circulation_slim" reporter:core="false" reporter:label="Combined Aged and Active Circulations (Slim Version)" oils_persist:readonly="true">
5194                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5195                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5196                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5197                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5198                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5199                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5200                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5201                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5202                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5203                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5204                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5205                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5206                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5207                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5208                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5209                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5210                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5211                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5212                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5213                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5214                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5215                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5216                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5217                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5218                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5219                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5220                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5221                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5222                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5223                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5224                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5225                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5226                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5227                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5228                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5229                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5230                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5231                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5232                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5233                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5234                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5235                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5236                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5237                 </fields>
5238                 <links>
5239                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5240                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5241                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5242                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5243                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5244                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5245                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5246                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5247                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5248                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5249                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5250                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5251                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5252                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5253                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5254                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5255                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5256                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5257                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5258                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5259                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5260                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5261                 </links>
5262                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5263                         <actions>
5264                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5265                         </actions>
5266                 </permacrud>
5267         </class>
5268
5269         <class id="combcirc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation" oils_persist:tablename="action.all_circulation" reporter:core="true" reporter:label="Combined Aged and Active Circulations" oils_persist:readonly="true">
5270                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5271                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5272                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5273                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5274                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5275                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5276                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5277                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5278                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5279                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5280                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5281                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5282                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5283                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5284                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5285                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5286                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5287                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5288                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5289                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5290                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5291                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5292                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5293                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5294                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5295                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5296                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5297                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5298                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5299                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5300                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5301                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5302                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5303                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5304                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5305                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5306                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5307                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5308                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5309                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5310                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5311                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5312                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5313                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5314                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5315                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5316                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5317                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5318                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5319                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5320                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5321                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5322                 </fields>
5323                 <links>
5324                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5325                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5326                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5327                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5328                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5329                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5330                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5331                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5332                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5333                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5334                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5335                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5336                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5337                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5338                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5339                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5340                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5341                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5342                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5343                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5344                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5345                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5346                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5347                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5348                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5349                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5350                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5351                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5352                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5353                 </links>
5354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5355                         <actions>
5356                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5357                         </actions>
5358                 </permacrud>
5359         </class>
5360         <class id="acirc" controller="open-ils.cstore" oils_obj:fieldmapper="action::aged_circulation" oils_persist:tablename="action.aged_circulation" reporter:core="true" reporter:label="Aged (patronless) Circulation">
5361                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5362                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5363                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5364                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5365                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5366                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5367                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5368                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5369                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5370                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5371                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5372                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5373                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5374                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5375                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5376                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5377                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5378                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5379                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5380                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5381                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5382                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5383                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5384                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5385                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5386                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5387                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5388                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5389                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5390                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5391                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5392                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5393                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5394                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5395                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5396                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5397                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5398                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5399                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5400                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5401                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5402                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5403                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5404                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5405                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5406                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5407                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5408                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5409                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5410                 </fields>
5411                 <links>
5412                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5413                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5414                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5415                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5416                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5417                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5418                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5419                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5420                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5421                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5422                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5423                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5424                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5425                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5426                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5427                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5428                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5429                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5430                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5431                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5432                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5433                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5434                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5435                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5436                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5437                 </links>
5438         </class>
5439         <class id="auch" 
5440                 controller="open-ils.cstore" 
5441                 oils_obj:fieldmapper="action::user_circ_history" 
5442                 oils_persist:tablename="action.usr_circ_history" 
5443                 reporter:label="User Checkout History">
5444                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5445                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5446                         <!-- prevent reporting on the user that owns the checkout history -->
5447                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5448                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5449                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5450                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5451                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5452                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5453                 </fields>
5454                 <links>
5455                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5456                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5457                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5458                 </links>
5459         </class>
5460         <class id="brt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_type" oils_persist:tablename="booking.resource_type" reporter:label="Resource Type">
5461                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5462                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5463                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5464                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5465                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5466                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5467                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5468                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5469                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5470                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5471                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5472                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5473                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5474                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5475                 </fields>
5476                 <links>
5477                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5478                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5479                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5480                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5481                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5482                 </links>
5483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5484                         <actions>
5485                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5486                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5487                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5488                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5489                         </actions>
5490                 </permacrud>
5491         </class>
5492
5493         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5494                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5495                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5496                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5497                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5498                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5499                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5500                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5501                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5502                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5503                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5504                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5505                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5506                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5507                 </fields>
5508                 <links>
5509                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5510                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5511                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5512                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5513                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5514                 </links>
5515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5516                         <actions>
5517                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5518                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5519                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5520                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5521                         </actions>
5522                 </permacrud>
5523         </class>
5524         
5525         <class id="bra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr" oils_persist:tablename="booking.resource_attr" reporter:label="Resource Attribute">
5526                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5527                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5528                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5529                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5530                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5531                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5532                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5533                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5534                 </fields>
5535                 <links>
5536                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5537                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5538                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5539                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5540                 </links>
5541                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5542                         <actions>
5543                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5544                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5545                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5546                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5547                         </actions>
5548                 </permacrud>
5549         </class>
5550         
5551         <class id="brav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_value" oils_persist:tablename="booking.resource_attr_value" reporter:label="Resource Attribute Value">
5552                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5553                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5554                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5555                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5556                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5557                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5558                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5559                 </fields>
5560                 <links>
5561                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5562                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5563                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5564                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5565                 </links>
5566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5567                         <actions>
5568                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5569                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5570                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5571                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5572                         </actions>
5573                 </permacrud>
5574         </class>
5575         
5576         <class id="bram" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_map" oils_persist:tablename="booking.resource_attr_map" reporter:label="Resource Attribute Map">
5577                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5578                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5579                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5580                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5581                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5582                 </fields>
5583                 <links>
5584                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5585                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5586                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5587                 </links>
5588                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5589                         <actions>
5590                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5591                     <context link="resource" field="owner" />
5592                 </create>
5593                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5594                     <context link="resource" field="owner" />
5595                 </retrieve>
5596                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5597                     <context link="resource" field="owner" />
5598                 </update>
5599                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5600                     <context link="resource" field="owner" />
5601                 </delete>
5602                         </actions>
5603                 </permacrud>
5604         </class>
5605         
5606         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5607                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5608                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5609                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5610                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5611                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5612                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5613                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5614                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5615                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5616                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5617                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5618                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5619                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5620                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5621                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5622                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5623                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5624                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5625                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5626                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5627                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5628                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5629                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5630                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5631                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5632                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5633                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5634                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5635                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5636                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5637                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5638                 </fields>
5639                 <links>
5640                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5641                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5642                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5643                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5644                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5645                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5646                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5647                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5648                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5649                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5650                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5651                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5652                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5653                 </links>
5654                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5655                         <actions>
5656                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5657                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5658                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5659                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5660                         </actions>
5661                 </permacrud>
5662         </class>
5663         
5664         <class id="bravm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation_attr_value_map" oils_persist:tablename="booking.reservation_attr_value_map" reporter:label="Reservation Attribute Value Map">
5665                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5666                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5667                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5668                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5669                 </fields>
5670                 <links>
5671                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5672                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5673                 </links>
5674                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5675                         <actions>
5676                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5677                                         <context link="reservation" field="pickup_lib"/>
5678                                 </create>
5679                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5680                                         <context link="reservation" field="pickup_lib"/>
5681                                 </retrieve>
5682                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5683                                         <context link="reservation" field="pickup_lib"/>
5684                                 </update>
5685                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5686                                         <context link="reservation" field="pickup_lib"/>
5687                                 </delete>
5688                         </actions>
5689                 </permacrud>
5690         </class>
5691
5692         <class id="ccnbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
5693                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5694                         <field name="bucket" reporter:datatype="link"/>
5695                         <field name="id" reporter:datatype="id" />
5696                         <field name="target_call_number" reporter:datatype="link" />
5697                         <field name="create_time" reporter:datatype="timestamp" />
5698                         <field name="pos" reporter:datatype="int" />
5699                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5700                 </fields>
5701                 <links>
5702                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5703                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5704             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5705                 </links>
5706                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5707                         <actions>
5708                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5709                     <context link="bucket" field="owning_lib"/>
5710                 </retrieve>
5711             </actions>
5712         </permacrud>
5713         </class>
5714         <class id="ccnbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_item_note" oils_persist:tablename="container.call_number_bucket_item_note" reporter:label="Call Number Bucket Item Note">
5715                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5716                         <field name="id" reporter:datatype="id" />
5717                         <field name="item" reporter:datatype="link"/>
5718                         <field name="note" reporter:datatype="text" />
5719                 </fields>
5720                 <links>
5721                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5722                 </links>
5723         </class>
5724         <class id="cbreb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
5725                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5726                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5727                         <field name="btype" reporter:datatype="text"/>
5728                         <field name="id" reporter:datatype="id" />
5729                         <field name="name" reporter:datatype="text"/>
5730                         <field name="description" reporter:datatype="text"/>
5731                         <field name="owner" reporter:datatype="link"/>
5732                         <field name="pub" reporter:datatype="bool"/>
5733                         <field name="create_time" reporter:datatype="timestamp" />
5734                         <field name="owning_lib" reporter:datatype="org_unit" />
5735                 </fields>
5736                 <links>
5737                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5738                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5739                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5740                 </links>
5741                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5742                         <actions>
5743                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5744                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5745                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5746                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5747                         </actions>
5748                 </permacrud>
5749         </class>
5750         <class id="cbrebn" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_note" oils_persist:tablename="container.biblio_record_entry_bucket_note" reporter:label="Bibliographic Record Entry Bucket Note">
5751                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5752                         <field name="id" reporter:datatype="id" />
5753                         <field name="bucket" reporter:datatype="link"/>
5754                         <field name="note" reporter:datatype="text" />
5755                 </fields>
5756                 <links>
5757                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5758                 </links>
5759         </class>
5760         <class id="ahcm" controller="open-ils.cstore" oils_obj:fieldmapper="action::hold_copy_map" oils_persist:tablename="action.hold_copy_map" reporter:label="Hold Copy Map">
5761                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5762                         <field name="hold" reporter:datatype="link"/>
5763                         <field name="id" reporter:datatype="id" />
5764                         <field name="target_copy" reporter:datatype="link"/>
5765                         <field name="proximity" reporter:datatype="number"/>
5766                 </fields>
5767                 <links>
5768                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5769                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5770                 </links>
5771         </class>
5772         <class id="ahn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_notification" oils_persist:tablename="action.hold_notification" reporter:label="Hold Notification">
5773                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5774                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5775                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5776                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5777                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5778                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5779                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5780                 </fields>
5781                 <links>
5782                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5783                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5784                 </links>
5785         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5786             <actions>
5787                 <create permission="CREATE_HOLD_NOTIFICATION">
5788                                         <context link="hold" jump="usr" field="home_ou" />
5789                                 </create>
5790                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5791                                         <context link="hold" jump="usr" field="home_ou" />
5792                                 </retrieve>
5793                 <update permission="CREATE_HOLD_NOTIFICATION">
5794                                         <context link="hold" jump="usr" field="home_ou" />
5795                                 </update>
5796                 <delete permission="CREATE_HOLD_NOTIFICATION">
5797                                         <context link="hold" jump="usr" field="home_ou" />
5798                                 </delete>
5799             </actions>
5800         </permacrud>
5801         </class>
5802         <class id="acpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location" oils_persist:tablename="asset.copy_location" reporter:label="Shelving Location"  oils_persist:field_safe="true">
5803                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5804                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5805                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5806                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5807                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5808                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5809                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5810                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5811                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5812                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5813                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5814                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5815                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5816                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5817                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5818                 </fields>
5819                 <links>
5820                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5821                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5822                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5823                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5824                 </links>
5825         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5826             <actions>
5827                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5828                 <retrieve/>
5829                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5830                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5831             </actions>
5832         </permacrud>
5833         </class>
5834         <class id="acplg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_group" oils_persist:tablename="asset.copy_location_group" reporter:label="Copy/Shelving Location Group">
5835                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5836                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5837                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5838                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5839                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5840             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5841             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5842             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5843                 </fields>
5844                 <links>
5845                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5846                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5847                 </links>
5848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5849             <actions>
5850                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5851                 <retrieve/>
5852                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5853                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5854             </actions>
5855         </permacrud>
5856         </class>
5857         <class id="acplgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_group_map" oils_persist:tablename="asset.copy_location_group_map" reporter:label="Copy/Shelving Location Group Map">
5858                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5859                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5860             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5861             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5862                 </fields>
5863                 <links>
5864                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5865                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5866                 </links>
5867         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5868             <actions>
5869                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5870                                         <context link="lgroup" field="owner" />
5871                 </create>
5872                 <retrieve/>
5873                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5874                                         <context link="lgroup" field="owner" />
5875                 </update>
5876                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5877                                         <context link="lgroup" field="owner" />
5878                 </delete>
5879             </actions>
5880         </permacrud>
5881         </class>
5882
5883     <class id="acplo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_order" oils_persist:tablename="asset.copy_location_order" reporter:label="Copy/Shelving Location Order">
5884         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5885             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5886             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5887             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5888             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5889         </fields>
5890         <links>
5891             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5892             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5893         </links>
5894         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5895             <actions>
5896                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5897                 <retrieve/>
5898                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5899                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5900             </actions>
5901         </permacrud>
5902     </class>
5903
5904         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5905                 <fields>
5906                         <field name="sre_id" oils_persist:virtual="true" />
5907                         <field name="location" oils_persist:virtual="true" />
5908                         <field name="owning_lib" oils_persist:virtual="true" />
5909                         <field name="basic_holdings" oils_persist:virtual="true" />
5910                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5911                         <field name="supplement_holdings" oils_persist:virtual="true" />
5912                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5913                         <field name="index_holdings" oils_persist:virtual="true" />
5914                         <field name="index_holdings_add" oils_persist:virtual="true" />
5915                         <field name="online" oils_persist:virtual="true" />
5916                         <field name="missing" oils_persist:virtual="true" />
5917                         <field name="incomplete" oils_persist:virtual="true" />
5918                 </fields>
5919         </class>
5920
5921         <class id="sre" controller="open-ils.pcrud open-ils.cstore" oils_obj:fieldmapper="serial::record_entry" oils_persist:tablename="serial.record_entry" reporter:label="Serial Record Entry">
5922                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5923                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5924                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5925                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5926                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5927                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5928                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5929                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5930                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5931                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5932                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5933                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5934                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5935                 </fields>
5936                 <links>
5937                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5938                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5939                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5940                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5941                 </links>
5942                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5943                         <actions>
5944                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5945                                 <retrieve/>
5946                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5947                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5948                         </actions>
5949                 </permacrud>
5950         </class>
5951
5952         <class id="scap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::caption_and_pattern" oils_persist:tablename="serial.caption_and_pattern" reporter:label="Caption and Pattern">
5953                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5954                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5955                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5956                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5957                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5958                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5959                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5960                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5961                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5962                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5963                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5964                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5965                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5966                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5967                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5968                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5969                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5970                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5971                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5972                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5973                 </fields>
5974                 <links>
5975                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5976                 </links>
5977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5978                         <actions>
5979                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5980                                         <context link="subscription" field="owning_lib" />
5981                                 </create>
5982                                 <retrieve />
5983                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5984                                         <context link="subscription" field="owning_lib" />
5985                                 </update>
5986                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5987                                         <context link="subscription" field="owning_lib" />
5988                                 </delete>
5989                         </actions>
5990                 </permacrud>
5991         </class>
5992
5993         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5994                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5995                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5996                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5997                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5998                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5999                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6000                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6001                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6002                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6003                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6004                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6005                 </fields>
6006                 <links>
6007                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6008                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6009                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6010                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6011                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6012                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6013                 </links>
6014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6015                         <actions>
6016                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6017                                 <retrieve />
6018                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6019                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6020                         </actions>
6021                 </permacrud>
6022         </class>
6023
6024         <class id="ssubn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
6025                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6026                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6027                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6028                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6029                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6030                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6031                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6032                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6033                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6034                 </fields>
6035                 <links>
6036                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6037                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6038                 </links>
6039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6040                         <actions>
6041                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6042                     <context link="subscription" field="owning_lib"/>
6043                 </create>
6044                                 <retrieve />
6045                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6046                     <context link="subscription" field="owning_lib"/>
6047                 </update>
6048                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6049                     <context link="subscription" field="owning_lib"/>
6050                 </delete>
6051                         </actions>
6052                 </permacrud>
6053         </class>
6054
6055         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6056                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6057                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6058                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6059                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6060                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6061                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6062                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6063                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6064                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6065                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6066                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6067                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6068                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6069                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6070                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6071                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6072                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6073                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6074                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6075                 </fields>
6076                 <links>
6077                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6078                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6079                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6080                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6081                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6082                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6083                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6084                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6085                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6086                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6087                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6088                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6089                 </links>
6090                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6091                         <actions>
6092                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6093                                 <retrieve />
6094                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6095                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6096                         </actions>
6097                 </permacrud>
6098         </class>
6099
6100         <class id="sdistn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution_note" oils_persist:tablename="serial.distribution_note" reporter:label="Distribution Note">
6101                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6102                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6103                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6104                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6105                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6106                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6107                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6108                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6109                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6110                 </fields>
6111                 <links>
6112                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6113                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6114                 </links>
6115                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6116                         <actions>
6117                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6118                                         <context link="distribution" field="holding_lib" />
6119                                 </create>
6120                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6121                                         <context link="distribution" field="holding_lib" />
6122                                 </retrieve>
6123                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6124                                         <context link="distribution" field="holding_lib" />
6125                                 </update>
6126                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6127                                         <context link="distribution" field="holding_lib" />
6128                                 </delete>
6129                         </actions>
6130                 </permacrud>
6131         </class>
6132
6133         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6134                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6135                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6136                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6137                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6138                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6139                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6140                 </fields>
6141                 <links>
6142                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6143                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6144                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6145                 </links>
6146                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6147                         <actions>
6148                                 <create permission="ADMIN_SERIAL_STREAM">
6149                                         <context link="distribution" field="holding_lib" />
6150                                 </create>
6151                                 <retrieve />
6152                                 <update permission="ADMIN_SERIAL_STREAM">
6153                                         <context link="distribution" field="holding_lib" />
6154                                 </update>
6155                                 <delete permission="ADMIN_SERIAL_STREAM">
6156                                         <context link="distribution" field="holding_lib" />
6157                                 </delete>
6158                         </actions>
6159                 </permacrud>
6160         </class>
6161
6162         <class id="srlu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::routing_list_user" oils_persist:tablename="serial.routing_list_user" reporter:label="Routing List User">
6163                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6164                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6165                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6166                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6167                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6168                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6169                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6170                 </fields>
6171                 <links>
6172                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6173                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6174                 </links>
6175                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6176                         <actions>
6177                                 <create permission="ADMIN_SERIAL_STREAM">
6178                                         <context link="stream" jump="distribution" field="holding_lib" />
6179                                 </create>
6180                                 <retrieve permission="RECEIVE_SERIAL">
6181                                         <context link="stream" jump="distribution" field="holding_lib" />
6182                                 </retrieve>
6183                                 <update permission="ADMIN_SERIAL_STREAM">
6184                                         <context link="stream" jump="distribution" field="holding_lib" />
6185                                 </update>
6186                                 <delete permission="ADMIN_SERIAL_STREAM">
6187                                         <context link="stream" jump="distribution" field="holding_lib" />
6188                                 </delete>
6189                         </actions>
6190                 </permacrud>
6191         </class>
6192
6193         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6194                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6195                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6196                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6197                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6198                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6199                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6200                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6201                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6202                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6203                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6204                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6205                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6206                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6207                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6208                 </fields>
6209                 <links>
6210                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6211                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6212                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6213                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6214                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6215                 </links>
6216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6217                         <actions>
6218                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6219                                         <context link="subscription" field="owning_lib" />
6220                                 </create>
6221                                 <retrieve/>
6222                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6223                                         <context link="subscription" field="owning_lib" />
6224                                 </update>
6225                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6226                                         <context link="subscription" field="owning_lib" />
6227                                 </delete>
6228                         </actions>
6229                 </permacrud>
6230         </class>
6231
6232         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6233                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6234                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6235                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6236                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6237                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6238                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6239                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6240                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6241                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6242                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6243                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6244                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6245                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6246                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6247                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6248                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6249                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6250                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6251                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6252                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6253                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6254                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6255                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6256                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6257                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6258                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6259                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6260                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6261                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6262                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6263                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6264                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6265                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6266                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6267                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6268                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6269                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6270                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6271                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6272                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6273                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6274                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6275                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6276                 </fields>
6277                 <links>
6278                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6279                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6280                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6281                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6282                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6283                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6284                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6285                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6286                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6287                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6288                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6289                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6290                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6291                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6292                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6293                 </links>
6294                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6295                         <actions>
6296                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6297                                 <retrieve/>
6298                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6299                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6300                         </actions>
6301                 </permacrud>
6302         </class>
6303
6304         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6305                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6306                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6307                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6308                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6309                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6310                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6311                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6312                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6313                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6314                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6315                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6316                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6317                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6318                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6319                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6320                 </fields>
6321                 <links>
6322                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6323                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6324                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6325                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6326                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6327                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6328                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6329                 </links>
6330                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6331                         <actions>
6332                                 <create permission="ADMIN_SERIAL_ITEM">
6333                                         <context link="stream" jump="distribution" field="holding_lib" />
6334                                 </create>
6335                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6336                                         <context link="stream" jump="distribution" field="holding_lib" />
6337                                 </retrieve>
6338                                 <update permission="ADMIN_SERIAL_ITEM">
6339                                         <context link="stream" jump="distribution" field="holding_lib" />
6340                                 </update>
6341                                 <delete permission="ADMIN_SERIAL_ITEM">
6342                                         <context link="stream" jump="distribution" field="holding_lib" />
6343                                 </delete>
6344                         </actions>
6345                 </permacrud>
6346         </class>
6347
6348         <class id="sin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
6349                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6350                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6351                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6352                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6353                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6354                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6355                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6356                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6357                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6358                 </fields>
6359                 <links>
6360                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6361                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6362                 </links>
6363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6364                         <actions>
6365                                 <create permission="ADMIN_SERIAL_ITEM">
6366                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6367                                 </create>
6368                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6369                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6370                                 </retrieve>
6371                                 <update permission="ADMIN_SERIAL_ITEM">
6372                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6373                                 </update>
6374                                 <delete permission="ADMIN_SERIAL_ITEM">
6375                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6376                                 </delete>
6377                         </actions>
6378                 </permacrud>
6379         </class>
6380         <class id="sasum" controller="open-ils.cstore" oils_obj:fieldmapper="serial::any_summary" oils_persist:tablename="serial.any_summary" reporter:label="All Issues' Summaries" oils_persist:readonly="true">
6381                 <fields>
6382                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6383                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6384                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6385                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6386                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6387                 </fields>
6388                 <links>
6389                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6390                 </links>
6391         </class>
6392         <class id="smhc" controller="open-ils.cstore" oils_obj:fieldmapper="serial::materialized_holding_code" oils_persist:tablename="serial.materialized_holding_code" reporter:label="Materialized Holding Code" oils_persist:readonly="true">
6393                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6394                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6395                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6396                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6397                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6398                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6399                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6400                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6401                 </fields>
6402                 <links>
6403                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6404                 </links>
6405         </class>
6406         <class id="sbsum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::basic_summary" oils_persist:tablename="serial.basic_summary" reporter:label="Basic Issue Summary">
6407                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6408                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6409                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6410                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6411                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6412                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6413                 </fields>
6414                 <links>
6415                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6416                 </links>
6417                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6418                         <actions>
6419                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6420                                         <context link="distribution" field="holding_lib" />
6421                                 </create>
6422                                 <retrieve/>
6423                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6424                                         <context link="distribution" field="holding_lib" />
6425                                 </update>
6426                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6427                                         <context link="distribution" field="holding_lib" />
6428                                 </delete>
6429                         </actions>
6430                 </permacrud>
6431         </class>
6432
6433         <class id="sssum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::supplement_summary" oils_persist:tablename="serial.supplement_summary" reporter:label="Supplemental Issue Summary">
6434                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6435                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6436                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6437                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6438                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6439                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6440                 </fields>
6441                 <links>
6442                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6443                 </links>
6444                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6445                         <actions>
6446                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6447                                         <context link="distribution" field="holding_lib" />
6448                                 </create>
6449                                 <retrieve/>
6450                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6451                                         <context link="distribution" field="holding_lib" />
6452                                 </update>
6453                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6454                                         <context link="distribution" field="holding_lib" />
6455                                 </delete>
6456                         </actions>
6457                 </permacrud>
6458         </class>
6459
6460         <class id="sisum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::index_summary" oils_persist:tablename="serial.index_summary" reporter:label="Index Issue Summary">
6461                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6462                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6463                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6464                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6465                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6466                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6467                 </fields>
6468                 <links>
6469                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6470                 </links>
6471                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6472                         <actions>
6473                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6474                                         <context link="distribution" field="holding_lib" />
6475                                 </create>
6476                                 <retrieve/>
6477                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6478                                         <context link="distribution" field="holding_lib" />
6479                                 </update>
6480                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6481                                         <context link="distribution" field="holding_lib" />
6482                                 </delete>
6483                         </actions>
6484                 </permacrud>
6485         </class>
6486
6487         <class id="spt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::pattern_template" oils_persist:tablename="serial.pattern_template" reporter:label="Prediction Pattern Template">
6488                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6489                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6490                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6491                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6492                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6493                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6494                 </fields>
6495                 <links>
6496                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6497                 </links>
6498                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6499                         <actions>
6500                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6501                                 <retrieve/>
6502                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6503                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6504                         </actions>
6505                 </permacrud>
6506         </class>
6507
6508         <class id="ascecm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry_copy_map" oils_persist:tablename="asset.stat_cat_entry_copy_map" reporter:label="Statistical Category Entry Copy Map">
6509                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6510                         <field name="id" reporter:datatype="id" />
6511                         <field name="owning_copy" reporter:datatype="link"/>
6512                         <field name="stat_cat" reporter:datatype="link"/>
6513                         <field name="stat_cat_entry" reporter:datatype="link"/>
6514                 </fields>
6515                 <links>
6516                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6517                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6518                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6519                 </links>
6520                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6521                         <actions>
6522                                 <retrieve/>
6523                         </actions>
6524                 </permacrud>
6525         </class>
6526         <class id="citm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_type_map" oils_persist:tablename="config.item_type_map" reporter:label="Item Type Map" oils_persist:field_safe="true">
6527                 <fields oils_persist:primary="code">
6528                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6529                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6530                 </fields>
6531                 <links/>
6532         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6533             <actions>
6534                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6535                 <retrieve/>
6536                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6537                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6538             </actions>
6539         </permacrud>
6540         </class>
6541         <class id="cblvl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_level_map" oils_persist:tablename="config.bib_level_map" reporter:label="Bib Level Map" oils_persist:field_safe="true">
6542                 <fields oils_persist:primary="code">
6543                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6544                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6545                 </fields>
6546                 <links/>
6547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6548             <actions>
6549                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6550                 <retrieve/>
6551                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6552                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6553             </actions>
6554         </permacrud>
6555         </class>
6556         <class id="sra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="search::relevance_adjustment" oils_persist:tablename="search.relevance_adjustment" reporter:label="Relevance Adjustment">
6557                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6558                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6559                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6560                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6561                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6562                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6563                 </fields>
6564                 <links>
6565             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6566         </links>
6567         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6568             <actions>
6569                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6570                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6571                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6572                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6573             </actions>
6574         </permacrud>
6575         </class>
6576         <class id="lasso" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso" oils_persist:tablename="actor.org_lasso" reporter:label="Library Group">
6577                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6578                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6579                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6580                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6581                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6582                 </fields>
6583                 <links>
6584                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6585         </links>
6586         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6587             <actions>
6588                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6589                 <retrieve/>
6590                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6591                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6592             </actions>
6593         </permacrud>
6594         </class>
6595         <class id="lmap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso_map" oils_persist:tablename="actor.org_lasso_map" reporter:label="Library Group Map">
6596                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6597                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6598                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6599                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6600                 </fields>
6601                 <links>
6602                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6603                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6604                 </links>
6605         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6606             <actions>
6607                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6608                 <retrieve/>
6609                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6610                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6611             </actions>
6612         </permacrud>
6613         </class>
6614         <class id="aoupa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_proximity_adjustment" oils_persist:tablename="actor.org_unit_proximity_adjustment" reporter:label="Org Unit Proximity Adjustment">
6615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6616                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6617                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6618                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6619                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6620                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6621                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6622                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6623                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6624                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6625                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6626                 </fields>
6627                 <links>
6628                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6629                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6630                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6631                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6632                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6633                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6634                 </links>
6635         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6636             <actions>
6637                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6638                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6639                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6640                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6641             </actions>
6642         </permacrud>
6643         </class>
6644         <class id="aoup" controller="open-ils.cstore" oils_obj:fieldmapper="actor::org_unit_proximity" oils_persist:tablename="actor.org_unit_proximity" reporter:label="Org Unit Proximity">
6645                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6646                         <field name="id" reporter:datatype="id" />
6647                         <field name="from_org" reporter:datatype="org_unit"/>
6648                         <field name="to_org" reporter:datatype="org_unit"/>
6649                         <field name="prox" reporter:datatype="int" />
6650                 </fields>
6651                 <links>
6652                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6653                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6654                 </links>
6655         </class>
6656         <class id="ssr" controller="open-ils.cstore" oils_obj:fieldmapper="search::search_result" oils_persist:tablename="search.search_result" oils_persist:readonly="true" reporter:label="Search Result">
6657                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6658                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6659                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6660                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6661                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6662                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6663                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6664                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6665                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6666                 </fields>
6667                 <links/>
6668         </class>
6669         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6670                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6671                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6672                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6673                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6674                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6675                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6676                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6677                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6678                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6679                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6680                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6681                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6682                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6683                 </fields>
6684                 <links>
6685                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6686                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6687                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6688                 </links>
6689         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6690             <actions>
6691                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6692                 <retrieve/>
6693                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6694                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6695             </actions>
6696         </permacrud>
6697         </class>
6698         <class id="aoa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_address" oils_persist:tablename="actor.org_address" reporter:label="Org Address">
6699                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6700                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6701                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6702                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6703                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6704                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6705                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6706                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6707                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6708                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6709                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6710                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6711                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6712                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6713                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6714                 </fields>
6715                 <links>
6716                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6717                 </links>
6718         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6719             <actions>
6720                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6721                 <retrieve/>
6722                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6723                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6724             </actions>
6725         </permacrud>
6726         </class>
6727         <class id="asq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_query" oils_persist:tablename="actor.search_query" reporter:label="Search Query" oils_persist:field_safe="true">
6728                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6729                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6730                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6731                         <field name="query_text" reporter:datatype="text"/>
6732                 </fields>
6733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6734             <actions>
6735                 <retrieve/>
6736             </actions>
6737         </permacrud>
6738         </class>
6739
6740         <class id="asfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_filter_group" oils_persist:tablename="actor.search_filter_group" reporter:label="Search Filter Group" oils_persist:field_safe="true">
6741                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6742                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6743                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6744                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6745                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6746                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6747                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6748                 </fields>
6749                 <links>
6750                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6751                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6752                 </links>
6753         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6754             <actions>
6755                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6756                 <retrieve/>
6757                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6758                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6759             </actions>
6760         </permacrud>
6761         </class>
6762         <class id="asfge" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_filter_group_entry" oils_persist:tablename="actor.search_filter_group_entry" reporter:label="Search Filter Group Entry" oils_persist:field_safe="true">
6763                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6764                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6765                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6766                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6767                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6768                 </fields>
6769                 <links>
6770                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6771                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6772                 </links>
6773         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6774             <actions>
6775                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6776                     <context link="grp" field="owner"/>
6777                 </create>
6778                 <retrieve/>
6779                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6780                     <context link="grp" field="owner"/>
6781                 </update>
6782                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6783                     <context link="grp" field="owner"/>
6784                 </delete>
6785             </actions>
6786         </permacrud>
6787         </class>
6788
6789         <!-- A note: Please update alhr and ahopl when updating ahr -->
6790         <class id="ahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
6791                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6792                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6793                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6794                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6795                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6796                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6797                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6798                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6799                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6800                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6801                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6802                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6803                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6804                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6805                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6806                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6807                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6808                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6809                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6810                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6811                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6812                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6813                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6814                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6815                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6816                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6817                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6818                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6819                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6820                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6821                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6822                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6823                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6824                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6825                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6826                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6827                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6828                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6829                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6830                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6831                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6832                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6833                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6834                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6835                 </fields>
6836                 <links>
6837                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6838                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6839                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6840                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6841                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6842                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6843                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6844                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6845                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6846                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6847                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6848                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6849                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6850                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6851                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6852                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6853                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6854                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6855                 </links>
6856                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6857                         <actions>
6858                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6859                         </actions>
6860                 </permacrud>
6861         </class>
6862         <class id="ahopl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_on_pull_list" reporter:label="Hold On Pull List" oils_persist:readonly="true">
6863                 <oils_persist:source_definition><![CDATA[
6864                 SELECT
6865                         ahr.*,
6866                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6867                                 copy_location_order_position,
6868                         CASE WHEN au.alias IS NOT NULL THEN
6869                                 au.alias
6870                         ELSE
6871                                 au.first_given_name
6872                         END AS usr_alias_or_first_given_name,
6873                         au.first_given_name AS usr_first_given_name,
6874                         au.second_given_name AS usr_second_given_name,
6875                         au.family_name AS usr_family_name,
6876                         au.prefix AS usr_prefix,
6877                         au.suffix AS usr_suffix,
6878                         au.alias AS usr_alias,
6879                         CASE WHEN au.alias IS NOT NULL THEN
6880                                 au.alias
6881                         ELSE
6882                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6883                                         COALESCE(au.family_name, ''),
6884                                         COALESCE(au.suffix, ''),
6885                                         ', ',
6886                                         COALESCE(au.prefix, ''),
6887                                         COALESCE(au.first_given_name, ''),
6888                                         COALESCE(au.second_given_name, '')
6889                                 ], ' '), E'\\s+,', ',')
6890                         END AS usr_alias_or_display_name,
6891                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6892                                 COALESCE(au.family_name, ''),
6893                                 COALESCE(au.suffix, ''),
6894                                 ', ',
6895                                 COALESCE(au.prefix, ''),
6896                                 COALESCE(au.first_given_name, ''),
6897                                 COALESCE(au.second_given_name, '')
6898                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6899                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6900                                 AS call_number_label,
6901                         siss.label AS issuance_label,
6902                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6903                         ahcm_1.copy_count AS potential_copies
6904                 FROM action.hold_request ahr
6905                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6906                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6907                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6908                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6909                 JOIN actor.usr au ON (au.id = ahr.usr)
6910                 JOIN (
6911                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6912                         FROM asset.copy_location
6913                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6914                 LEFT JOIN actor.usr_standing_penalty ausp 
6915                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6916                 LEFT JOIN config.standing_penalty csp
6917                         ON (
6918                                 csp.id = ausp.standing_penalty AND 
6919                                 csp.block_list LIKE '%CAPTURE%' AND (
6920                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6921                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6922                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6923                                         )
6924                                 )
6925                         )
6926                 JOIN (
6927                         SELECT COUNT(target_copy) AS copy_count, hold
6928                         FROM action.hold_copy_map
6929                         GROUP BY 2
6930                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6931                 LEFT JOIN serial.issuance siss
6932                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6933                 LEFT JOIN asset.copy_location_order acplo
6934                         ON (acp.location = acplo.location AND
6935                                 acp.circ_lib = acplo.org)
6936                 WHERE
6937                         ahr.capture_time IS NULL AND
6938                         ahr.cancel_time IS NULL AND
6939                         csp.id IS NULL AND
6940                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6941                         acp.status IN (0,7)
6942                 ]]></oils_persist:source_definition>
6943                 <fields oils_persist:primary="id">
6944                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6945                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6946                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6947                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6948                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6949                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6950                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6951                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6952                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6953                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6954                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6955                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6956                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6957                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6958                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6959                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6960                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6961                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6962                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6963                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6964                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6965                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6966                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6967                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6968                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6969                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6970                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6971                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6972                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6973                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6974                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6975                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6976                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6977                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6978                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6979                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6980                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6981                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6982                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6983                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6984                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6985                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6986                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6987                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6988                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6989                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6990                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6991                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6992                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6993                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6994                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6995                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6996                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6997                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6998                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6999                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7000                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7001                 </fields>
7002                 <links>
7003                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7004                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7005                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7006                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7007                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7008                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7009                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7010                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7011                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7012                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7013                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7014                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7015                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7016                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7017                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7018                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7019                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7020                 </links>
7021                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7022                         <actions>
7023                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7024                         </actions>
7025                 </permacrud>
7026         </class>
7027         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7028                 <oils_persist:source_definition><![CDATA[
7029                         SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL AND current_copy IS NOT NULL AND fulfillment_time IS NULL GROUP BY current_copy)x USING (current_copy, capture_time)
7030                 ]]></oils_persist:source_definition>
7031                 <fields oils_persist:primary="id">
7032                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7033                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7034                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7035                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7036                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7037                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7038                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7039                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7040                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7041                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7042                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7043                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7044                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7045                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7046                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7047                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7048                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7049                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7050                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7051                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7052                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7053                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7054                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7055                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7056                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7057                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7058                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7059                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7060                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7061                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7062                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7063                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7064                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7065                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7066                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7067                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7068                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7069                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7070                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7071                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7072                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7073                 </fields>
7074                 <links>
7075                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7076                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7077                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7078                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7079                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7080                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7081                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7082                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7083                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7084                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7085                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7086                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7087                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7088                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7089                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7090                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7091                 </links>
7092         </class>
7093
7094         <class id="ahrn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_note" oils_persist:tablename="action.hold_request_note" reporter:label="Hold Request Note">
7095                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7096                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7097                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7098                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7099                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7100                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7101                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7102                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7103                 </fields>
7104                 <links>
7105                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7106                 </links>
7107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7108                         <actions>
7109                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7110                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7111                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7112                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7113                         </actions>
7114                 </permacrud>
7115         </class>
7116         <class id="combahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_hold_request" oils_persist:tablename="action.all_hold_request" reporter:core="true" reporter:label="Combined (Active &amp; Aged) Hold Request">
7117                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7118                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7119                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7120                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7121                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7122                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7123                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7124                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7125                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7126                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7127                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7128                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7129                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7130                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7131                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7132                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7133                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7134                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7135                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7136                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7137                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7138                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7139                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7140                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7141                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7142                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7143                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7144                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7145                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7146                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7147                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7148                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7149                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7150                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7151                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7152                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7153                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7154                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7155                 </fields>
7156                 <links>
7157                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7158                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7159                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7160                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7161                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7162                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7163                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7164                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7165                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7166                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7167                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7168                 </links>
7169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7170                         <actions>
7171                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7172                         </actions>
7173                 </permacrud>
7174         </class>
7175         <class id="aahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::aged_hold_request" oils_persist:tablename="action.aged_hold_request" reporter:core="true" reporter:label="Aged Hold Request">
7176                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7177                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7178                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7179                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7180                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7181                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7182                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7183                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7184                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7185                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7186                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7187                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7188                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7189                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7190                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7191                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7192                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7193                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7194                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7195                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7196                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7197                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7198                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7199                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7200                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7201                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7202                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7203                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7205                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7206                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7207                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7208                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7209                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7210                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7211                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7212                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7213                 </fields>
7214                 <links>
7215                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7216                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7217                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7218                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7219                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7220                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7221                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7222                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7223                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7224                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7225                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7226                 </links>
7227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7228                         <actions>
7229                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7230                         </actions>
7231                 </permacrud>
7232         </class>
7233
7234         <class id="aou" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit" oils_persist:tablename="actor.org_unit" reporter:label="Organizational Unit" oils_persist:field_safe="true">
7235                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7236                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7237                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7238                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7239                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7240                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7241                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7242                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7243                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7244                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7245                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7246                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7247                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7248                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7249                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7250                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7251                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7252                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7253                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7254                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7255                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7256                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7257                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7258                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7259                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7260                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7261                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7262                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7263                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7264                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7265                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7266                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7267                 </fields>
7268                 <links>
7269                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7270                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7271                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7272                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7273                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7274                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7275                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7276                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7277                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7278                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7279                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7280                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7281                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7282                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7283                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7284                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7285                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7286                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7287                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7288                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7289                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7290                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7291                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7292                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7293                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7294                 </links>
7295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7296             <actions>
7297                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7298                 <retrieve />
7299                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7300                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7301             </actions>
7302         </permacrud>
7303         </class>
7304         <class id="aouct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree" oils_persist:tablename="actor.org_unit_custom_tree" reporter:label="Org Unit Custom Tree">
7305                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7306                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7307                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7308                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7309                 </fields>
7310                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7311                         <actions>
7312                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7313                                 <retrieve/>
7314                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7315                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7316                         </actions>
7317                 </permacrud>
7318         </class>
7319         <class id="aouctn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree_node" oils_persist:tablename="actor.org_unit_custom_tree_node" reporter:label="Org Unit Custom Tree Node">
7320                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7321                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7322                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7323                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7324                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7325                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7326                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7327                 </fields>
7328                 <links>
7329                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7330                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7331                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7332                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7333                 </links>
7334                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7335                         <actions>
7336                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7337                                 <retrieve/>
7338                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7339                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7340                         </actions>
7341                 </permacrud>
7342         </class>
7343         <class id="ccnb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
7344                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7345                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7346                         <field name="btype" reporter:datatype="text"/>
7347                         <field name="id" reporter:datatype="id" />
7348                         <field name="name"  reporter:datatype="text"/>
7349                         <field name="description" reporter:datatype="text"/>
7350                         <field name="owner" reporter:datatype="link"/>
7351                         <field name="pub" reporter:datatype="bool"/>
7352                         <field name="create_time" reporter:datatype="timestamp" />
7353                         <field name="owning_lib" reporter:datatype="org_unit" />
7354                 </fields>
7355                 <links>
7356                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7357                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7358                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7359                 </links>
7360                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7361                         <actions>
7362                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7363                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7364                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7365                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7366                         </actions>
7367                 </permacrud>
7368         </class>
7369         <class id="ccnbn" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_note" oils_persist:tablename="container.call_number_bucket_note" reporter:label="Call Number Bucket Note">
7370                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7371                         <field name="id" reporter:datatype="id" />
7372                         <field name="bucket" reporter:datatype="link"/>
7373                         <field name="note" reporter:datatype="text" />
7374                 </fields>
7375                 <links>
7376                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7377                 </links>
7378         </class>
7379         <class id="asc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
7380                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7381                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7382                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7383                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7384                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7385                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7386                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7387                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7388                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7389                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7390                 </fields>
7391                 <links>
7392                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7393                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7394                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7395                 </links>
7396                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7397                         <actions>
7398                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7399                         </actions>
7400                 </permacrud>
7401         </class>
7402         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7403                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7404                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7405                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7406                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7407                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7408                 </fields>
7409                 <links>
7410                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7411                 </links>
7412                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7413                         <actions>
7414                                 <retrieve permission="VIEW_USER user_request.view">
7415                                         <context link="usr" field="home_ou" />
7416                                 </retrieve>
7417                         </actions>
7418                 </permacrud>
7419         </class>
7420     <class id="actscsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_sip_fields" oils_persist:tablename="actor.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
7421         <fields oils_persist:primary="field">
7422             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7423             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7424             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7425         </fields>
7426         <links/>
7427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7428             <actions>
7429                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7430                 <retrieve />
7431                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7432                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7433             </actions>
7434         </permacrud>
7435     </class>
7436         <class id="actsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat" oils_persist:tablename="actor.stat_cat" reporter:label="User Statistical Category">
7437                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7438                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7439                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7440                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7441                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7442                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7443                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7444                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7445                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7446                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7447                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7448                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7449                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7450                 </fields>
7451                 <links>
7452                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7453                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7454                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7455                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7456                 </links>
7457         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7458             <actions>
7459                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7460                 <retrieve />
7461                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7462                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7463             </actions>
7464         </permacrud>
7465         </class>
7466         <class id="msefe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::series_field_entry" oils_persist:tablename="metabib.series_field_entry" reporter:label="Series Field Entry">
7467                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7468                         <field name="field" reporter:datatype="link"/>
7469                         <field name="id" reporter:datatype="id" />
7470                         <field name="source" reporter:datatype="link"/>
7471                         <field name="value"  reporter:datatype="text"/>
7472                 </fields>
7473                 <links>
7474                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7475                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7476                 </links>
7477         </class>
7478         <class id="cub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
7479                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7480                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7481                         <field name="btype" reporter:datatype="text"/>
7482                         <field name="id" reporter:datatype="id" />
7483                         <field name="name"  reporter:datatype="text"/>
7484                         <field name="description" reporter:datatype="text"/>
7485                         <field name="owner" reporter:datatype="link"/>
7486                         <field name="pub" reporter:datatype="bool"/>
7487                         <field name="create_time" reporter:datatype="timestamp" />
7488                         <field name="owning_lib" reporter:datatype="org_unit" />
7489                 </fields>
7490                 <links>
7491                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7492                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7493                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7494                 </links>
7495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7496                         <actions>
7497                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7498                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7499                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7500                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7501                         </actions>
7502                 </permacrud>
7503         </class>
7504         <class id="cubn" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_note" oils_persist:tablename="container.user_bucket_note" reporter:label="User Bucket Note">
7505                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7506                         <field name="id" reporter:datatype="id" />
7507                         <field name="bucket" reporter:datatype="link"/>
7508                         <field name="note" reporter:datatype="text" />
7509                 </fields>
7510                 <links>
7511                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7512                 </links>
7513         </class>
7514         <class id="mcrp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_payment" oils_persist:tablename="money.credit_payment" reporter:label="House Credit Payment">
7515                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7516                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7517                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7518                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7519                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7520                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7521                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7522                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7523                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7524                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7525                 </fields>
7526                 <links>
7527                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7528                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7529                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7530                 </links>
7531         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7532             <actions>
7533                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7534                     <context link="xact" jump="usr" field="home_ou"/>
7535                 </retrieve>
7536                         </actions>
7537                 </permacrud>
7538         </class>
7539         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7540                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7541                         <field name="id" reporter:datatype="id" />
7542                         <field name="ind1" />
7543                         <field name="ind2" />
7544                         <field name="record" />
7545                         <field name="subfield" />
7546                         <field name="tag" />
7547                         <field name="value" />
7548                 </fields>
7549                 <links>
7550                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7551                 </links>
7552         </class>
7553         <class id="aalink" controller="open-ils.cstore" oils_obj:fieldmapper="authority::authority_linking" oils_persist:tablename="authority.authority_linking" reporter:label="Authority to Authority Linking">
7554                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7555                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7556                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7557                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7558                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7559                 </fields>
7560                 <links>
7561                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7562                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7563                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7564                 </links>
7565         </class>
7566         <class id="cnct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::non_cataloged_type" oils_persist:tablename="config.non_cataloged_type" reporter:label="Non-cataloged Type">
7567                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7568                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7569                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7570                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7571                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7572                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7573                 </fields>
7574                 <links>
7575                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7576                 </links>
7577         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7578             <actions>
7579                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7580                 <retrieve/>
7581                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7582                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7583             </actions>
7584         </permacrud>
7585
7586         </class>
7587         <class id="aout" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_type" oils_persist:tablename="actor.org_unit_type" reporter:label="Organizational Unit Type" oils_persist:field_safe="true">
7588                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7589                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7590                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7591                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7592                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7593                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7594                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7595                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7596                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7597                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7598                 </fields>
7599                 <links>
7600                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7601                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7602                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7603                 </links>
7604         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7605             <actions>
7606                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7607                 <retrieve/>
7608                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7609                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7610             </actions>
7611         </permacrud>
7612         </class>
7613         <class id="bren" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note" oils_persist:field_safe="true">
7614                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7615                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7616                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7617                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7618                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7619                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7620                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7621                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7622                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7623                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7624                 </fields>
7625                 <links>
7626                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7627                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7628                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7629                 </links>
7630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7631                 <actions>
7632                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7633                     <retrieve/>
7634                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7635                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7636                 </actions>
7637              </permacrud>
7638         </class>
7639         <class id="mucs" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_circulation_summary" oils_persist:tablename="money.usr_circulation_summary" reporter:label="User Circulation Summary">
7640                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7641                         <field name="balance_owed" reporter:datatype="money" />
7642                         <field name="total_owed" reporter:datatype="money" />
7643                         <field name="total_paid" reporter:datatype="money" />
7644                         <field name="usr" reporter:datatype="link"/>
7645                 </fields>
7646                 <links>
7647                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7648                 </links>
7649         </class>
7650     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7651                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7652                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7653                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7654                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7655                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7656                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7657                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7658                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7659                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7660                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7661                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7662                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7663                 </fields>
7664                 <links>
7665                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7666                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7667                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7668                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7669                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7670                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7671                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7672                 </links>
7673         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7674             <actions>
7675                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7676             </actions>
7677         </permacrud>
7678         </class>
7679         <class id="cbs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_source" oils_persist:tablename="config.bib_source" reporter:label="Bib Source">
7680                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7681                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7682                         <field name="quality" reporter:datatype="int" />
7683                         <field name="source" reporter:datatype="text"/>
7684                         <field name="transcendant" reporter:datatype="bool"/>
7685                         <field name="can_have_copies" reporter:datatype="bool"/>
7686                 </fields>
7687                 <links/>
7688         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7689             <actions>
7690                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7691                 <retrieve/>
7692                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7693                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7694             </actions>
7695         </permacrud>
7696         </class>
7697         <class id="mbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction" oils_persist:tablename="money.billable_xact" reporter:label="Billable Transaction">
7698                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7699                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7700                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7701                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7702                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7703                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7704                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7705                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7706                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7707                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7708                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7709                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7710                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7711                 </fields>
7712                 <links>
7713                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7714                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7715                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7716                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7717                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7718                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7719                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7720                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7721                 </links>
7722                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7723                         <actions>
7724                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7725                                         <context link="usr" field="home_ou" />
7726                                 </retrieve>
7727                         </actions>
7728                 </permacrud>
7729         </class>
7730         <class id="actsce" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7731                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7732                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7733                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7734                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7735                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7736                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7737                 </fields>
7738                 <links>
7739                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7740                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7741                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7742                 </links>
7743         </class>
7744         <class id="actsced" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry_default" oils_persist:tablename="actor.stat_cat_entry_default" reporter:label="User Stat Cat Default Entry">
7745                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7746                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7747                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7748                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7749                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7750                 </fields>
7751                 <links>
7752                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7753                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7754                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7755                 </links>
7756         </class>
7757         <class id="cubi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
7758                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7759                         <field name="bucket" reporter:datatype="link"/>
7760                         <field name="id" reporter:datatype="id" />
7761                         <field name="target_user" reporter:datatype="link"/>
7762                         <field name="create_time" reporter:datatype="timestamp" />
7763                         <field name="pos" reporter:datatype="int" />
7764                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7765                 </fields>
7766                 <links>
7767                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7768                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7769             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7770                 </links>
7771                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7772                         <actions>
7773                                 <retrieve permission="ADMIN_USER_BUCKET">
7774                     <context link="bucket" field="owning_lib"/>
7775                 </retrieve>
7776             </actions>
7777         </permacrud>
7778         </class>
7779         <class id="abhe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::batch_hold_event" oils_persist:tablename="action.batch_hold_event" reporter:label="Hold Group Event">
7780                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7781                         <field name="id" reporter:datatype="id" />
7782                         <field name="staff" reporter:datatype="link"/>
7783                         <field name="bucket" reporter:datatype="link"/>
7784                         <field name="target" reporter:datatype="int" />
7785                         <field name="hold_type" reporter:datatype="text" />
7786                         <field name="run_date" reporter:datatype="timestamp" />
7787                         <field name="cancelled" reporter:datatype="timestamp" />
7788                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7789                 </fields>
7790                 <links>
7791                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7792                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7793                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7794                 </links>
7795                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7796                         <actions>
7797                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7798                 <retrieve/>
7799                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7800                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7801             </actions>
7802         </permacrud>
7803         </class>
7804         <class id="abhem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::batch_hold_event_map" oils_persist:tablename="action.batch_hold_event_map" reporter:label="Hold Group Event Map">
7805                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7806                         <field name="id" reporter:datatype="id" />
7807                         <field name="batch_hold_event" reporter:datatype="link"/>
7808                         <field name="hold" reporter:datatype="link"/>
7809                 </fields>
7810                 <links>
7811                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7812                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7813                 </links>
7814                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7815                         <actions>
7816                 <retrieve/>
7817             </actions>
7818         </permacrud>
7819         </class>
7820         <class id="cubin" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_item_note" oils_persist:tablename="container.user_bucket_item_note" reporter:label="User Bucket Item Note">
7821                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7822                         <field name="id" reporter:datatype="id" />
7823                         <field name="item" reporter:datatype="link"/>
7824                         <field name="note" reporter:datatype="text" />
7825                 </fields>
7826                 <links>
7827                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7828                 </links>
7829         </class>
7830         <class id="mus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7831                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7832                         <field name="balance_owed" reporter:datatype="money" />
7833                         <field name="total_owed" reporter:datatype="money" />
7834                         <field name="total_paid" reporter:datatype="money" />
7835                         <field name="usr" reporter:datatype="link"/>
7836                 </fields>
7837                 <links>
7838                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7839                 </links>
7840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7841                         <actions>
7842                                 <retrieve permission="VIEW_USER">
7843                                         <context link="usr" field="home_ou"/>
7844                                 </retrieve>
7845                         </actions>
7846                 </permacrud>
7847         </class>
7848         <class id="clfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::lit_form_map" oils_persist:tablename="config.lit_form_map" reporter:label="Literary Form" oils_persist:field_safe="true">
7849                 <fields oils_persist:primary="code" oils_persist:sequence="">
7850                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7851                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7852                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7853                 </fields>
7854                 <links/>
7855         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7856             <actions>
7857                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7858                 <retrieve/>
7859                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7860                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7861             </actions>
7862         </permacrud>
7863         </class>
7864         <class id="mwp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::work_payment" oils_persist:tablename="money.work_payment" reporter:label="Work Payment">
7865                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7866                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7867                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7868                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7869                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7870                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7871                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7872                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7873                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7874                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7875                 </fields>
7876                 <links>
7877                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7878                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7879                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7880                 </links>
7881         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7882             <actions>
7883                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7884                     <context link="xact" jump="usr" field="home_ou"/>
7885                 </retrieve>
7886                         </actions>
7887                 </permacrud>
7888         </class>
7889         <class id="mgp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::goods_payment" oils_persist:tablename="money.goods_payment" reporter:label="Goods Payment">
7890                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7891                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7892                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7893                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7894                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7895                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7896                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7897                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7898                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7899                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7900                 </fields>
7901                 <links>
7902                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7903                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7904                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7905                 </links>
7906         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7907             <actions>
7908                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7909                     <context link="xact" jump="usr" field="home_ou"/>
7910                 </retrieve>
7911                         </actions>
7912                 </permacrud>
7913         </class>
7914         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7915                 <fields oils_persist:primary="id" oils_persist:sequence="">
7916                         <field name="checkin_lib" reporter:datatype="link"/>
7917                         <field name="checkin_staff" reporter:datatype="link"/>
7918                         <field name="checkin_time" reporter:datatype="timestamp"/>
7919                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7920                         <field name="circ_staff" reporter:datatype="link"/>
7921                         <field name="desk_renewal" reporter:datatype="bool"/>
7922                         <field name="due_date" reporter:datatype="timestamp"/>
7923                         <field name="duration" reporter:datatype="interval"/>
7924                         <field name="duration_rule" reporter:datatype="link"/>
7925                         <field name="fine_interval" reporter:datatype="interval"/>
7926                         <field name="id" reporter:datatype="id" />
7927                         <field name="max_fine" reporter:datatype="money" />
7928                         <field name="max_fine_rule" reporter:datatype="link"/>
7929                         <field name="opac_renewal" reporter:datatype="bool"/>
7930                         <field name="phone_renewal" reporter:datatype="bool"/>
7931                         <field name="recurring_fine" reporter:datatype="money" />
7932                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7933                         <field name="renewal_remaining" reporter:datatype="int" />
7934             <field name="grace_period" reporter:datatype="interval" />
7935                         <field name="stop_fines" reporter:datatype="text"/>
7936                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7937                         <field name="target_copy" reporter:datatype="link"/>
7938                         <field name="usr" reporter:datatype="link"/>
7939                         <field name="xact_finish" reporter:datatype="timestamp" />
7940                         <field name="xact_start" reporter:datatype="timestamp" />
7941                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7942                         <field name="auto_renewal" reporter:datatype="bool"/>
7943                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7944                 </fields>
7945                 <links>
7946                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7947                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7948                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7949                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7950                 </links>
7951         </class>
7952         <class id="msfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::subject_field_entry" oils_persist:tablename="metabib.subject_field_entry" reporter:label="Subject Field Entry">
7953                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7954                         <field name="field" reporter:datatype="link"/>
7955                         <field name="id" reporter:datatype="id" />
7956                         <field name="source" reporter:datatype="link"/>
7957                         <field name="value" reporter:datatype="text"/>
7958                 </fields>
7959                 <links>
7960                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7961                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7962                 </links>
7963         </class>
7964         <class id="crrf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::recurring_fine" oils_persist:tablename="config.rule_recurring_fine" reporter:label="Recurring Fine Rule">
7965                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7966                         <field name="high" reporter:datatype="money" />
7967                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7968                         <field name="low" reporter:datatype="money" />
7969                         <field name="name" reporter:datatype="text"/>
7970                         <field name="normal" reporter:datatype="money" />
7971                         <field name="recurrence_interval" reporter:datatype="interval"/>
7972             <field name="grace_period" reporter:datatype="interval" />
7973                 </fields>
7974                 <links/>
7975         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7976             <actions>
7977                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7978                 <retrieve/>
7979                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7980                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7981             </actions>
7982         </permacrud>
7983         </class>
7984         <class id="mckp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::check_payment" oils_persist:tablename="money.check_payment" reporter:label="Check Payment">
7985                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7986                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7987                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7988                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7989                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7990                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7991                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7992                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7993                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7994                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7995                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7996                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7997                 </fields>
7998                 <links>
7999                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8000                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8001                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8002                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8003                 </links>
8004         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8005             <actions>
8006                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8007                     <context link="xact" jump="usr" field="home_ou"/>
8008                 </retrieve>
8009                         </actions>
8010                 </permacrud>
8011         </class>
8012         <class id="mdcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::debit_card_payment" oils_persist:tablename="money.debit_card_payment" reporter:label="Debit Card Payment">
8013                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8014                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8015                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8016                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8017                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8018                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8019                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8020                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8021                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8022                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8023                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8024                 </fields>
8025                 <links>
8026                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8027                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8028                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8029                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8030                 </links>
8031         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8032             <actions>
8033                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8034                     <context link="xact" jump="usr" field="home_ou"/>
8035                 </retrieve>
8036                         </actions>
8037                 </permacrud>
8038         </class>
8039         <class id="acp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy" oils_persist:tablename="asset.copy" reporter:core="true" reporter:label="Item">
8040                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8041                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8042                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8043                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8044                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8045                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8046                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8047                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8048                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8049                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8050                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8051                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8052                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8053                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8054                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8055                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8056                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8057                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8058                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8059                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8060                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8061                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8062                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8063                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8064                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8065                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8066                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8067                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8068                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8069                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8070                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8071                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8072                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8073                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8074                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8075                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8076                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8077                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8078                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8079                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8080                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8081                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8082                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8083                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8084                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8085                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8086                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8087                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8088                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8089                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8090                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8091                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8092                 </fields>
8093                 <links>
8094                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8095                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8096                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8097                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8098                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8099                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8100                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8101                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8102                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8103                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8104                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8105                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8106                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8107                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8108                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8109                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8110                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8111                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8112                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8113                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8114                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8115                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8116                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8117                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8118                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8119                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8120                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8121                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8122                 </links>
8123         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8124             <actions>
8125                 <create permission="CREATE_COPY">
8126                     <context link="call_number" field="owning_lib"/>
8127                 </create>
8128                 <retrieve/>
8129                 <update permission="UPDATE_COPY">
8130                     <context link="call_number" field="owning_lib"/>
8131                 </update>
8132                 <delete permission="DELETE_COPY">
8133                     <context link="call_number" field="owning_lib"/>
8134                 </delete>
8135             </actions>
8136         </permacrud>
8137         </class>
8138
8139         <class id="aci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_inventory" oils_persist:tablename="asset.copy_inventory" reporter:core="true" reporter:label="Copy Inventory">
8140                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8141                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8142                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8143                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8144                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8145                 </fields>
8146                 <links>
8147                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8148                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8149                 </links>
8150                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8151                         <actions>
8152                 <create permission="STAFF_LOGIN"/>
8153                 <retrieve/>
8154                 <update permission="STAFF_LOGIN"/>
8155                 <delete permission="STAFF_LOGIN"/>
8156                         </actions>
8157                 </permacrud>
8158         </class>
8159
8160         <class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::latest_inventory" oils_persist:tablename="asset.latest_inventory" reporter:core="true" reporter:label="Latest Inventory" oils_persist:readonly="true">
8161                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8162             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8163                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8164                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8165                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8166                 </fields>
8167                 <links>
8168                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8169                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8170                 </links>
8171         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8172             <actions>
8173                                 <retrieve/>
8174             </actions>
8175         </permacrud>
8176         </class>
8177
8178         <class id="ccat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_alert_type" oils_persist:tablename="config.copy_alert_type" reporter:label="Copy Alert Type" oils_persist:restrict_primary="100">
8179                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8180                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8181                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8182                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8183                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8184                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8185                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8186                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8187                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8188                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8189                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8190                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8191                 </fields>
8192                 <links>
8193                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8194                 </links>
8195         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8196             <actions>
8197                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8198                 <retrieve/>
8199                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8200                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8201             </actions>
8202         </permacrud>
8203         </class>
8204
8205         <class id="acas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::copy_alert_suppress" oils_persist:tablename="actor.copy_alert_suppress" reporter:label="Item Alert Suppression">
8206                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8207                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8208                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8209                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8210                 </fields>
8211                 <links>
8212                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8213                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8214                 </links>
8215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8216             <actions>
8217                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8218                 <retrieve/>
8219                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8220                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8221             </actions>
8222         </permacrud>
8223         </class>
8224
8225         <class id="aca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_alert" oils_persist:tablename="asset.copy_alert" reporter:label="Copy Alert">
8226                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8227                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8228                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8229                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8230                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8231                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8232                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8233                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8234                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8235                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8236                 </fields>
8237                 <links>
8238                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8239                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8240                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8241                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8242                 </links>
8243         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8244             <actions>
8245                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8246                     <context link="copy" field="circ_lib"/>
8247                 </create>
8248                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8249                     <context link="copy" field="circ_lib"/>
8250                                 </retrieve>
8251                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8252                     <context link="copy" field="circ_lib"/>
8253                                 </update>
8254                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8255                     <context link="copy" field="circ_lib"/>
8256                                 </delete>
8257             </actions>
8258         </permacrud>
8259         </class>
8260
8261         <class id="aaca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::active_copy_alert" oils_persist:tablename="asset.active_copy_alert" reporter:label="Active Copy Alert" oils_persist:readonly="true">
8262                 <fields oils_persist:primary="id">
8263                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8264                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8265                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8266                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8267                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8268                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8269                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8270                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8271                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8272                 </fields>
8273                 <links>
8274                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8275                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8276                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8277                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8278                 </links>
8279         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8280             <actions>
8281                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8282                     <context link="copy" field="circ_lib"/>
8283                 </create>
8284                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8285                     <context link="copy" field="circ_lib"/>
8286                                 </retrieve>
8287                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8288                     <context link="copy" field="circ_lib"/>
8289                                 </update>
8290                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8291                     <context link="copy" field="circ_lib"/>
8292                                 </delete>
8293             </actions>
8294         </permacrud>
8295         </class>
8296
8297         <class id="act" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_template" oils_persist:tablename="asset.copy_template" reporter:label="Asset Copy Template">
8298                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8299                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8300                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8301                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8302                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8303                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8304                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8305                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8306                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8307                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8308                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8309                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8310                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8311                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8312                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8313                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8314                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8315                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8316                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8317                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8318                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8319                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8320                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8321                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8322                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8323                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8324                 </fields>
8325                 <links>
8326                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8327                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8328                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8329                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8330                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8331                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8332                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8333                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8334                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8335                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8336                 </links>
8337                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8338                         <actions>
8339                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8340                                 <retrieve />
8341                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8342                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8343                         </actions>
8344                 </permacrud>
8345         </class>
8346
8347         <class id="crahp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::age_hold_protect" oils_persist:tablename="config.rule_age_hold_protect" reporter:label="Age Hold Protection Rule" oils_persist:field_safe="true">
8348                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8349                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8350                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8351                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8352                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8353                 </fields>
8354                 <links/>
8355         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8356             <actions>
8357                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8358                 <retrieve/>
8359                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8360                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8361             </actions>
8362         </permacrud>
8363         </class>
8364         <class id="crmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::max_fine" oils_persist:tablename="config.rule_max_fine" reporter:label="Max Fine Rule">
8365                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8366                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8367                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8368                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8369                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8370                 </fields>
8371                 <links/>
8372         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8373             <actions>
8374                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8375                 <retrieve/>
8376                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8377                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8378             </actions>
8379         </permacrud>
8380         </class>
8381         <class id="pgt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree" oils_persist:tablename="permission.grp_tree" reporter:label="Permission Group">
8382                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8383                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8384                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8385                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8386                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8387                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8388                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8389                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8390                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8391                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8392                 </fields>
8393                 <links>
8394                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8395                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8396                 </links>
8397         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8398             <actions>
8399                 <create permission="CREATE_PERM" global_required="true"/>
8400                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8401                 <update permission="UPDATE_PERM" global_required="true"/>
8402                 <delete permission="DELETE_PERM" global_required="true"/>
8403             </actions>
8404         </permacrud>
8405         </class>
8406         <class id="pgtde" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree_display_entry" oils_persist:tablename="permission.grp_tree_display_entry" reporter:label="Permission Group Tree Display Entry">
8407                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8408                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8409                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8410                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8411                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8412                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8413                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8414                 </fields>
8415                 <links>
8416                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8417                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8418                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8419                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8420                 </links>
8421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8422                         <actions>
8423                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8424                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8425                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8426                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8427                         </actions>
8428                 </permacrud>
8429         </class>
8430         <class id="asva" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_answer" oils_persist:tablename="action.survey_answer" reporter:label="Survey Answer">
8431                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8432                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8433                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8434                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8435                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8436                 </fields>
8437                 <links>
8438                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8439                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8440                 </links>
8441         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8442             <actions>
8443                 <create permission="ADMIN_SURVEY">
8444                     <context link="question" jump="survey" field="owner"/>
8445                 </create>
8446                 <retrieve/>
8447                 <update permission="ADMIN_SURVEY">
8448                     <context link="question" jump="survey" field="owner"/>
8449                 </update>
8450                 <delete permission="ADMIN_SURVEY">
8451                     <context link="question" jump="survey" field="owner"/>
8452                 </delete>
8453             </actions>
8454         </permacrud>
8455         </class>
8456         <class id="ancc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
8457                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8458                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8459                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8460                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8461                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8462                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8463                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8464                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8465                 </fields>
8466                 <links>
8467                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8468                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8469                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8470                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8471                 </links>
8472                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8473                         <actions>
8474                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8475                         </actions>
8476                 </permacrud>
8477         </class>
8478         <class id="moucs" controller="open-ils.cstore" oils_obj:fieldmapper="money::open_user_circulation_summary" oils_persist:tablename="money.open_usr_circulation_summary" reporter:label="Open User Circulation Summary">
8479                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8480                         <field name="balance_owed" reporter:datatype="money" />
8481                         <field name="total_owed" reporter:datatype="money" />
8482                         <field name="total_paid" reporter:datatype="money" />
8483                         <field name="usr" reporter:datatype="link"/>
8484                 </fields>
8485                 <links>
8486                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8487                 </links>
8488         </class>
8489         <class id="aufh" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_list" oils_persist:tablename="action.unfulfilled_hold_list" reporter:label="Unfulfilled Hold Targets">
8490                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8491                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8492                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8493                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8494                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8495                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8496                 </fields>
8497                 <links>
8498                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8499                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8500                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8501                 </links>
8502         </class>
8503         <class id="mife" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::identifier_field_entry" oils_persist:tablename="metabib.identifier_field_entry" reporter:label="Identifier Field Entry">
8504                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8505                         <field name="field" reporter:datatype="link"/>
8506                         <field name="id" reporter:datatype="id" />
8507                         <field name="source" reporter:datatype="link"/>
8508                         <field name="value" reporter:datatype="text"/>
8509                 </fields>
8510                 <links>
8511                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8512                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8513                 </links>
8514         </class>
8515         <class id="mtfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::title_field_entry" oils_persist:tablename="metabib.title_field_entry" reporter:label="Title Field Entry">
8516                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8517                         <field name="field" reporter:datatype="link"/>
8518                         <field name="id" reporter:datatype="id" />
8519                         <field name="source" reporter:datatype="link"/>
8520                         <field name="value" reporter:datatype="text"/>
8521                 </fields>
8522                 <links>
8523                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8524                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8525                 </links>
8526         </class>
8527         <class id="actscecm" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry_user_map" oils_persist:tablename="actor.stat_cat_entry_usr_map"  reporter:label="User Statistical Category Entry">
8528                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8529                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8530                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8531                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8532                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8533                 </fields>
8534                 <links>
8535                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8536                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8537                 </links>
8538         </class>
8539         <class id="pgpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_perm_map" oils_persist:tablename="permission.grp_perm_map" reporter:label="Group Permission Map">
8540                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8541                         <field name="depth" reporter:datatype="int" />
8542                         <field name="grantable" reporter:datatype="bool"/>
8543                         <field name="grp" reporter:datatype="link"/>
8544                         <field name="id" reporter:datatype="id" />
8545                         <field name="perm" reporter:datatype="link"/>
8546                 </fields>
8547                 <links>
8548                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8549                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8550                 </links>
8551         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8552             <actions>
8553                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8554                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8555                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8556                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8557             </actions>
8558         </permacrud>
8559         </class>
8560         <class id="ccb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
8561                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8562                         <field name="items" oils_persist:virtual="true" />
8563                         <field name="btype" reporter:datatype="text"/>
8564                         <field name="id" reporter:datatype="id" />
8565                         <field name="name" reporter:datatype="text"/>
8566                         <field name="description" reporter:datatype="text"/>
8567                         <field name="owner" reporter:datatype="link"/>
8568                         <field name="pub" reporter:datatype="bool"/>
8569                         <field name="create_time" reporter:datatype="timestamp" />
8570                         <field name="owning_lib" reporter:datatype="org_unit" />
8571                 </fields>
8572                 <links>
8573                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8574                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8575                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8576                 </links>
8577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8578                         <actions>
8579                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8580                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8581                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8582                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8583                         </actions>
8584                 </permacrud>
8585         </class>
8586         <class id="ccbn" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_note" oils_persist:tablename="container.copy_bucket_note" reporter:label="Copy Bucket Note">
8587                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8588                         <field name="id" reporter:datatype="id" />
8589                         <field name="bucket" reporter:datatype="link"/>
8590                         <field name="note" reporter:datatype="text" />
8591                 </fields>
8592                 <links>
8593                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8594                 </links>
8595         </class>
8596         <class id="puwoum" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_work_ou_map" oils_persist:tablename="permission.usr_work_ou_map" reporter:label="User Work Org Unit Map">
8597                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8598                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8599                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8600                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8601                 </fields>
8602                 <links>
8603                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8604                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8605                 </links>
8606         </class>
8607         <class id="pupm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_perm_map" oils_persist:tablename="permission.usr_perm_map" reporter:label="User Permission Map">
8608                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8609                         <field name="depth" reporter:datatype="int"/>
8610                         <field name="grantable" reporter:datatype="bool"/>
8611                         <field name="id" reporter:datatype="id" />
8612                         <field name="perm" reporter:datatype="link"/>
8613                         <field name="usr" reporter:datatype="link"/>
8614                 </fields>
8615                 <links>
8616                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8617                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8618                 </links>
8619         </class>
8620         <class id="puopm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_object_perm_map" oils_persist:tablename="permission.usr_object_perm_map" reporter:label="User Object Permission Map">
8621                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8622                         <field name="object_id" reporter:datatype="text"/>
8623                         <field name="grantable" reporter:datatype="bool"/>
8624                         <field name="id" reporter:datatype="id" />
8625                         <field name="perm" reporter:datatype="link"/>
8626                         <field name="usr" reporter:datatype="link"/>
8627                         <field name="object_type" reporter:datatype="text"/>
8628                 </fields>
8629                 <links>
8630                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8631                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8632                 </links>
8633         </class>
8634         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8635                 <fields oils_persist:primary="id" oils_persist:sequence="">
8636                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8637                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8638                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8639                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8640                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8641                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8642                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8643                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8644                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8645                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8646                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8647                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8648                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8649                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8650                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8651                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8652                 </fields>
8653                 <links>
8654                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8655                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8656                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8657                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8658                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8659                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8660                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8661                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8662                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8663                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8664                 </links>
8665         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8666             <actions>
8667                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8668                     <context link="xact" jump="usr" field="home_ou"/>
8669                 </retrieve>
8670                         </actions>
8671                 </permacrud>
8672         </class>
8673         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8674                 oils_obj:fieldmapper="money::aged_payment" 
8675                 oils_persist:tablename="money.aged_payment" 
8676                 reporter:label="Payments: Aged">
8677                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8678                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8679                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8680                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8681                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8682                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8683                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8684                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8685                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8686                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8687                         <field name="billing" reporter:datatype="link"/>
8688                 </fields>
8689                 <links>
8690                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8691                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8692                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8693                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8694                 </links>
8695                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8696                         <actions>
8697                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8698                                         <context link="xact" field="usr_home_ou"/>
8699                                 </retrieve>
8700                         </actions>
8701                 </permacrud>
8702         </class>
8703         <class id="mallp" controller="open-ils.cstore" 
8704                 oils_obj:fieldmapper="money::all_payments" 
8705                 oils_persist:tablename="money.all_payments" 
8706                 oils_persist:readonly="true" reporter:core="true"
8707                 reporter:label="Payments: All">
8708                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8709                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8710                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8711                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8712                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8713                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8714                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8715                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8716                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8717                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8718                         <field name="billing" reporter:datatype="link"/>
8719                 </fields>
8720                 <links>
8721                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8722                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8723                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8724                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8725                 </links>
8726         </class>
8727
8728         <class id="mbp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
8729                 <fields oils_persist:primary="id" oils_persist:sequence="">
8730                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8731                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8732                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8733                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8734                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8735                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8736                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8737                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8738                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8739                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8740                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8741                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8742                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8743                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8744                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8745                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8746                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8747                 </fields>
8748                 <links>
8749                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8750                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8751                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8752                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8753                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8754                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8755                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8756                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8757                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8758                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8759                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8760                 </links>
8761                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8762                         <actions>
8763                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8764                                         <context link="xact" jump="usr" field="home_ou"/>
8765                                 </retrieve>
8766                         </actions>
8767                 </permacrud>
8768         </class>
8769         <class id="mndp" controller="open-ils.reporter" oils_obj:fieldmapper="money::non_drawer_payment" oils_persist:tablename="money.non_drawer_payment_view" reporter:core="true" reporter:label="Payments: Non-drawer Staff">
8770                 <fields oils_persist:primary="id" oils_persist:sequence="">
8771                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8772                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8773                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8774                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8775                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8776                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8777                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8778                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8779                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8780                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8781                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8782                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8783                 </fields>
8784                 <links>
8785                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8786                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8787                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8788                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8789                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8790                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8791                 </links>
8792         </class>
8793         <class id="mdp" controller="open-ils.cstore" oils_obj:fieldmapper="money::desk_payment" oils_persist:tablename="money.desk_payment_view" reporter:core="true" reporter:label="Payments: Desk">
8794                 <fields oils_persist:primary="id" oils_persist:sequence="">
8795                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8796                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8797                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8798                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8799                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8800                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8801                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8802                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8803                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8804                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8805                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8806                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8807                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8808                 </fields>
8809                 <links>
8810                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8811                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8812                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8813                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8814                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8815                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8816                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8817                 </links>
8818         </class>
8819         <class id="cbrebi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item" oils_persist:tablename="container.biblio_record_entry_bucket_item" reporter:label="Biblio Record Entry Bucket Item">
8820                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8821                         <field name="bucket" reporter:datatype="link"/>
8822                         <field name="id" reporter:datatype="id" />
8823                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8824                         <field name="create_time" reporter:datatype="timestamp" />
8825                         <field name="pos" reporter:datatype="int" />
8826                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8827                 </fields>
8828                 <links>
8829                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8830                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8831             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8832                 </links>
8833                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8834                         <actions>
8835                                 <retrieve permission="ADMIN_COPY_BUCKET">
8836                     <context link="bucket" field="owning_lib"/>
8837                 </retrieve>
8838             </actions>
8839         </permacrud>
8840         </class>
8841         <class id="cbrebin" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item_note" oils_persist:tablename="container.biblio_record_entry_bucket_item_note" reporter:label="Biblio Record Entry Bucket Item Note">
8842                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8843                         <field name="id" reporter:datatype="id" />
8844                         <field name="item" reporter:datatype="link"/>
8845                         <field name="note" reporter:datatype="text" />
8846                 </fields>
8847                 <links>
8848                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8849                 </links>
8850         </class>
8851         <class id="asce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry" oils_persist:tablename="asset.stat_cat_entry" reporter:label="Item Stat Cat Entry">
8852                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8853                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8854                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8855                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8856                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8857                 </fields>
8858                 <links>
8859                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8860                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8861                 </links>
8862                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8863                         <actions>
8864                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8865                         </actions>
8866                 </permacrud>
8867         </class>
8868     <class id="ascsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_sip_fields" oils_persist:tablename="asset.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
8869         <fields oils_persist:primary="field">
8870             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8871             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8872             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8873         </fields>
8874         <links/>
8875         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8876             <actions>
8877                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8878                 <retrieve />
8879                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8880                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8881             </actions>
8882         </permacrud>
8883     </class>
8884         <class id="ahrcc" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_cancel_cause" oils_persist:tablename="action.hold_request_cancel_cause" oils_persist:restrict_primary="100" reporter:label="Hold Request Cancel Cause">
8885                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8886                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8887                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8888                 </fields>
8889                 <links/>
8890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8891             <actions>
8892                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8893                 <retrieve/>
8894                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8895                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8896             </actions>
8897         </permacrud>
8898         </class>
8899
8900
8901         <class id="artc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::reservation_transit_copy" oils_persist:tablename="action.reservation_transit_copy" reporter:core="true" reporter:label="Reservation Transit">
8902                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8903                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8904                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8905                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8906                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8907                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8908                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8909                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8910                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8911                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8912                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8913                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8914                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8915                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8916                 </fields>
8917                 <links>
8918                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8919                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8920                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8921                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8922                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8923                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8924                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8925                 </links>
8926         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8927             <actions>
8928                 <create permission="TRANSIT_COPY">
8929                     <context link="target_copy" field="owner"/>
8930                 </create>
8931                 <retrieve/>
8932                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8933                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8934             </actions>
8935         </permacrud>
8936         </class>
8937         <class id="ahtc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_transit_copy" oils_persist:tablename="action.hold_transit_copy" reporter:core="true" reporter:label="Hold Transit">
8938                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8939                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8940                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8941                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8942                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8943                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8944                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8945                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8946                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8947                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8948                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8949                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8950                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8951                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8952                 </fields>
8953                 <links>
8954                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8955                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8956                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8957                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8958                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8959                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8960                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8961                 </links>
8962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8963             <actions>
8964                 <create permission="TRANSIT_COPY" context_field="owner">
8965                     <context link="target_copy" field="circ_lib"/>
8966                 </create>
8967                 <retrieve/>
8968                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8969                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8970             </actions>
8971         </permacrud>
8972         </class>
8973         <class id="mb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="Billing Line Item">
8974                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8975                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8976                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8977                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8978                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8979                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8980                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8981                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8982                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8983                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8984                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8985                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8986                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8987                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8988                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8989                 </fields>
8990                 <links>
8991                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8992                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8993                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8994                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8995                 </links>
8996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8997             <actions>
8998                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8999                     <context link="xact" jump="usr" field="home_ou"/>
9000                 </retrieve>
9001                         </actions>
9002                 </permacrud>
9003         </class>
9004         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9005                 oils_obj:fieldmapper="money::aged_billing" 
9006                 oils_persist:tablename="money.aged_billing" 
9007                 reporter:label="Aged Billing Line Item">
9008                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9009                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9010                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9011                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9012                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9013                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9014                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9015                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9016                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9017                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9018                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9019                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9020                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9021                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9022                 </fields>
9023                 <links>
9024                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9025                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9026                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9027                 </links>
9028                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9029                         <actions>
9030                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9031                                         <context link="xact" field="usr_home_ou"/>
9032                                 </retrieve>
9033                         </actions>
9034                 </permacrud>
9035         </class>
9036         <class id="mallb" controller="open-ils.cstore" 
9037                 oils_obj:fieldmapper="money::all_billings" 
9038                 oils_persist:tablename="money.all_billings" 
9039                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9040                 <fields oils_persist:primary="id" oils_persist:sequence="">
9041                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9042                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9043                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9044                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9045                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9046                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9047                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9048                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9049                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9050                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9051                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9052                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9053                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9054                 </fields>
9055                 <links>
9056                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9057                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9058                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9059                 </links>
9060         </class>
9061         <class id="pugm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_grp_map" oils_persist:tablename="permission.usr_grp_map" reporter:label="User Group Map">
9062                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9063                         <field name="grp" />
9064                         <field name="id" reporter:datatype="id" />
9065                         <field name="usr" />
9066                 </fields>
9067                 <links>
9068                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9069                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9070                 </links>
9071         </class>
9072         <class id="i18n" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::i18n_core" oils_persist:tablename="config.i18n_core" oils_persist:field_safe="true" reporter:label="i18n Core">
9073                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9074                         <field name="id" reporter:datatype="id" />
9075                         <field name="fq_field" reporter:datatype="text"/>
9076                         <field name="identity_value" reporter:datatype="text"/>
9077                         <field name="translation" reporter:datatype="text"/>
9078                         <field name="string" reporter:datatype="text"/>
9079                 </fields>
9080                 <links>
9081                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9082                 </links>
9083         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9084             <actions>
9085                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9086                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9087                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9088                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9089             </actions>
9090         </permacrud>
9091         </class>
9092         <class id="fdoc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::idl_field_doc" oils_persist:tablename="config.idl_field_doc" oils_persist:field_safe="true" reporter:label="IDL Field Doc">
9093                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9094                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9095                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9096                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9097                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9098                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9099                 </fields>
9100                 <links>
9101                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9102                 </links>
9103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9104             <actions>
9105                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9106                 <retrieve/>
9107                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9108                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9109             </actions>
9110         </permacrud>
9111         </class>
9112         <class id="i18n_l" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::i18n_locale" oils_persist:tablename="config.i18n_locale" oils_persist:field_safe="true" reporter:label="Locale">
9113                 <fields oils_persist:primary="code">
9114                         <field name="code" reporter:datatype="id" />
9115                         <field name="marc_code" reporter:datatype="text"/>
9116                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9117                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9118                         <field name="rtl" reporter:datatype="bool"/>
9119                 </fields>
9120                 <links/>
9121         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9122             <actions>
9123                 <create permission="CREATE_LOCALE" global_required="true"/>
9124                 <retrieve/>
9125                 <update permission="UPDATE_LOCALE" global_required="true"/>
9126                 <delete permission="DELETE_LOCALE" global_required="true"/>
9127             </actions>
9128         </permacrud>
9129         </class>
9130         <class id="cbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::billing_type" oils_persist:tablename="config.billing_type" oils_persist:restrict_primary="100" reporter:label="Billing Type">
9131                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9132                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9133                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9134                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9135                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9136                 </fields>
9137                 <links>
9138                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9139                 </links>
9140         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9141             <actions>
9142                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9143                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9144                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9145                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9146             </actions>
9147         </permacrud>
9148         </class>
9149
9150         <class id="aurt" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_type" oils_persist:tablename="acq.user_request_type" reporter:label="User Purchase Request Type">
9151                 <fields oils_persist:primary="id">
9152                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9153                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9154                 </fields>
9155                 <links/>
9156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9157             <actions>
9158                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9159                 <retrieve/>
9160                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9161                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9162             </actions>
9163         </permacrud>
9164         </class>
9165
9166         <class id="aur" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request" oils_persist:tablename="acq.user_request" reporter:label="User Purchase Request">
9167                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9168                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9169                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9170                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9171                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9172                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9173                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9174                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9175                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9176                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9177                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9178                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9179                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9180                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9181                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9182                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9183                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9184                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9185                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9186                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9187                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9188                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9189                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9190                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9191                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9192                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9193                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9194                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9195                 </fields>
9196                 <links>
9197                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9198                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9199                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9200                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9201                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9202                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9203                 </links>
9204         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9205             <actions>
9206                 <create permission="user_request.create">
9207                     <context link="usr" field="home_ou"/>
9208                                 </create>
9209                 <retrieve permission="user_request.view">
9210                     <context link="usr" field="home_ou"/>
9211                                 </retrieve>
9212                 <update permission="user_request.update">
9213                     <context link="usr" field="home_ou"/>
9214                                 </update>
9215                 <delete permission="user_request.delete">
9216                     <context link="usr" field="home_ou"/>
9217                                 </delete>
9218             </actions>
9219         </permacrud>
9220         </class>
9221
9222         <class id="aurs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status" reporter:label="User Purchase Request with Status" oils_persist:readonly="true">
9223         <oils_persist:source_definition><![CDATA[
9224             SELECT r.*, CASE
9225                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9226                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9227                         WHEN l.state = 'received' THEN 5 -- Received
9228                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9229                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9230                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9231                         WHEN l.id IS NULL THEN 1 -- New
9232                         ELSE 0 -- Error
9233                     END AS request_status
9234                     ,u.home_ou
9235             FROM      acq.user_request r
9236             JOIN actor.usr u ON (r.usr = u.id)
9237             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9238             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9239             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9240         ]]></oils_persist:source_definition>
9241                 <fields oils_persist:primary="id">
9242                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9243                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9244                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9245                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9246                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9247                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9248                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9249                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9250                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9251                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9252                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9253                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9254                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9255                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9256                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9257                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9258                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9259                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9260                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9261                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9262                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9263                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9264                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9265                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9266                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9267                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9268                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9269                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9270                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9271                 </fields>
9272                 <links>
9273                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9274                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9275                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9276                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9277                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9278                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9279                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9280                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9281                 </links>
9282         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9283             <actions>
9284                 <retrieve permission="user_request.view">
9285                     <context link="usr" field="home_ou"/>
9286                                 </retrieve>
9287             </actions>
9288         </permacrud>
9289         </class>
9290
9291         <class id="aurst" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status_type" oils_persist:tablename="acq.user_request_status_type" reporter:label="Acquisition Patron Request Status Type">
9292                 <fields oils_persist:primary="id">
9293                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9294                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9295                 </fields>
9296                 <links/>
9297         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9298             <actions>
9299                 <retrieve/>
9300             </actions>
9301         </permacrud>
9302         </class>
9303
9304         <class id="acqct" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::currency_type" oils_persist:tablename="acq.currency_type" reporter:label="Currency Type">
9305                 <fields oils_persist:primary="code">
9306                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9307                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9308                 </fields>
9309                 <links/>
9310         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9311             <actions>
9312                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9313                 <retrieve/>
9314                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9315                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9316             </actions>
9317         </permacrud>
9318         </class>
9319
9320         <class id="acqexr" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::exchange_rate" oils_persist:tablename="acq.exchange_rate" reporter:label="Exchange Rate">
9321                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9322                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9323                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9324                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9325                         <field reporter:label="Ratio" name="ratio" />
9326                 </fields>
9327                 <links>
9328                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9329                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9330                 </links>
9331                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9332                         <actions>
9333                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9334                                 <retrieve/>
9335                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9336                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9337                         </actions>
9338                 </permacrud>
9339         </class>
9340
9341         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9342                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9343                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9344                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9345                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9346                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9347                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9348                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9349                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9350                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9351                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9352                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9353                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9354                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9355                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9356                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9357                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9358                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9359                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9360                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9361                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9362                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9363                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9364                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9365                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9366                 </fields>
9367                 <links>
9368                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9369                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9370                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9371                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9372                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9373                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9374                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9375                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9376                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9377                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9378                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9379                 </links>
9380         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9381             <actions>
9382                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9383                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9384                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9385                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9386             </actions>
9387         </permacrud>
9388         </class>
9389
9390         <class id="acqpron" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::provider_note" oils_persist:tablename="acq.provider_note" reporter:label="Provider Note">
9391                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9392                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9393                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9394                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9395                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9396                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9397                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9398                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9399                 </fields>
9400                 <links>
9401                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9402                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9403                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9404                 </links>
9405         </class>
9406
9407         <class id="acqipm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_payment_method" oils_persist:tablename="acq.invoice_payment_method" reporter:label="Invoice Payment Method">
9408                 <fields oils_persist:primary="code">
9409                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9410                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9411                 </fields>
9412                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9413             <actions>
9414                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9415                 <retrieve/>
9416                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9417                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9418             </actions>
9419                 </permacrud>
9420         </class>
9421
9422         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9423                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9424                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9425                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9426                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9427                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9428                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9429                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9430                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9431                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9432                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9433                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9434                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9435                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9436                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9437                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9438                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9439                 </fields>
9440                 <links>
9441                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9442                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9443                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9444                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9445                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9446                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9447                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9448                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9449                 </links>
9450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9451             <actions>
9452                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9453                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9454                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9455                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9456             </actions>
9457         </permacrud>
9458         </class>
9459
9460         <class id="acqie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_entry" oils_persist:tablename="acq.invoice_entry" reporter:label="Invoice Entry">
9461                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9462                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9463                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9464                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9465                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9466                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9467                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9468                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9469                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9470                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9471                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9472                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9473                 </fields>
9474                 <links>
9475                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9476                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9477                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9478                 </links>
9479         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9480             <actions>
9481                 <create   permission="ADMIN_INVOICE">
9482                                         <context link="invoice" field="receiver"/>
9483                                 </create>
9484                 <retrieve permission="ADMIN_INVOICE">
9485                                         <context link="invoice" field="receiver"/>
9486                                 </retrieve>
9487                 <update   permission="ADMIN_INVOICE">
9488                                         <context link="invoice" field="receiver"/>
9489                                 </update>
9490                                 <delete   permission="ADMIN_INVOICE">
9491                                         <context link="invoice" field="receiver"/>
9492                                 </delete>
9493             </actions>
9494         </permacrud>
9495         </class>
9496
9497         <class id="acqii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item" oils_persist:tablename="acq.invoice_item" reporter:label="Non-bibliographic Invoice Item">
9498                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9499                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9500                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9501                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9502                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9503                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9504                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9505                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9506                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9507                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9508                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9509                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9510                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9511                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9512                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9513                 </fields>
9514                 <links>
9515                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9516                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9517                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9518                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9519                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9520                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9521                 </links>
9522         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9523             <actions>
9524                 <create   permission="ADMIN_INVOICE">
9525                                         <context link="invoice" field="receiver"/>
9526                                 </create>
9527                 <retrieve permission="ADMIN_INVOICE">
9528                                         <context link="invoice" field="receiver"/>
9529                                 </retrieve>
9530                 <update   permission="ADMIN_INVOICE">
9531                                         <context link="invoice" field="receiver"/>
9532                                 </update>
9533                                 <delete   permission="ADMIN_INVOICE">
9534                                         <context link="invoice" field="receiver"/>
9535                                 </delete>
9536             </actions>
9537         </permacrud>
9538         </class>
9539
9540         <class id="acqpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_address" oils_persist:tablename="acq.provider_address" reporter:label="Provider Address">
9541                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9542                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9543                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9544                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9545                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9546                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9547                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9548                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9549                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9550                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9551                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9552                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9553                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9554                 </fields>
9555                 <links>
9556                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9557                 </links>
9558         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9559             <actions>
9560                 <create permission="ADMIN_PROVIDER">
9561                     <context link="provider" field="owner"/>
9562                 </create>
9563                 <retrieve permission="ADMIN_PROVIDER">
9564                     <context link="provider" field="owner"/>
9565                 </retrieve>
9566                 <update permission="ADMIN_PROVIDER">
9567                     <context link="provider" field="owner"/>
9568                 </update>
9569                 <delete permission="ADMIN_PROVIDER">
9570                     <context link="provider" field="owner"/>
9571                 </delete>
9572             </actions>
9573         </permacrud>
9574         </class>
9575
9576         <class id="acqpc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact" oils_persist:tablename="acq.provider_contact" reporter:label="Provider Contact">
9577                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9578                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9579                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9580                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9581                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9582                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9583                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9584                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9585         </fields>
9586                 <links>
9587                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9588                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9589                 </links>
9590         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9591             <actions>
9592                 <create permission="ADMIN_PROVIDER">
9593                     <context link="provider" field="owner"/>
9594                 </create>
9595                 <retrieve permission="ADMIN_PROVIDER">
9596                     <context link="provider" field="owner"/>
9597                 </retrieve>
9598                 <update permission="ADMIN_PROVIDER">
9599                     <context link="provider" field="owner"/>
9600                 </update>
9601                 <delete permission="ADMIN_PROVIDER">
9602                     <context link="provider" field="owner"/>
9603                 </delete>
9604             </actions>
9605         </permacrud>
9606     </class>
9607         <class id="acqpca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact_address" oils_persist:tablename="acq.provider_contact_address" reporter:label="Provider Contact Address">
9608                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9609                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9610                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9611                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9612                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9613                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9614                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9615                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9616                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9617                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9618                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9619                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9620                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9621                 </fields>
9622                 <links>
9623                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9624                 </links>
9625         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9626             <actions>
9627                 <create permission="ADMIN_PROVIDER">
9628                     <context link="contact" jump='provider' field="owner"/>
9629                 </create>
9630                 <retrieve permission="ADMIN_PROVIDER">
9631                     <context link="contact" jump='provider' field="owner"/>
9632                 </retrieve>
9633                 <update permission="ADMIN_PROVIDER">
9634                     <context link="contact" jump='provider' field="owner"/>
9635                 </update>
9636                 <delete permission="ADMIN_PROVIDER">
9637                     <context link="contact" jump='provider' field="owner"/>
9638                 </delete>
9639             </actions>
9640         </permacrud>
9641         </class>
9642
9643         <class id="acqftr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
9644                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9645                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9646                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9647                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9648                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9649                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9650                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9651                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9652                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9653                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9654                 </fields>
9655                 <links>
9656                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9657                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9658                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9659                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9660                 </links>
9661         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9662             <actions>
9663                 <create permission="ADMIN_ACQ_FUND">
9664                     <context link="src_fund" field="org"/>
9665                 </create>
9666                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9667                     <context link="src_fund" field="org"/>
9668                     <context link="dest_fund" field="org"/>
9669                 </retrieve>
9670                 <update permission="ADMIN_ACQ_FUND">
9671                     <context link="src_fund" field="org"/>
9672                 </update>
9673                 <delete permission="ADMIN_ACQ_FUND">
9674                     <context link="src_fund" field="org"/>
9675                 </delete>
9676             </actions>
9677         </permacrud>
9678         </class>
9679
9680         <class id="acqfc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_calendar" oils_persist:tablename="acq.fiscal_calendar" reporter:label="Fiscal Calendar">
9681                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9682                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9683                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9684                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9685                 </fields>
9686                 <links>
9687             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9688                 </links>
9689                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9690                         <actions>
9691                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9692                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9693                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9694                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9695                         </actions>
9696                 </permacrud>
9697         </class>
9698
9699         <class id="acqfy" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_year" oils_persist:tablename="acq.fiscal_year" reporter:label="Fiscal Year">
9700                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9701                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9702                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9703                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9704                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9705                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9706                 </fields>
9707                 <links>
9708                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9709                 </links>
9710                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9711                         <actions>
9712                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9713                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9714                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9715                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9716                         </actions>
9717                 </permacrud>
9718         </class>
9719
9720         <class id="acqfs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source" oils_persist:tablename="acq.funding_source" reporter:label="Funding Source">
9721                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9722                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9723                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9724                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9725                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9726                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9727                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9728                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9729                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9730                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9731                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9732                 </fields>
9733                 <links>
9734                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9735                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9736             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9737             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9738                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9739                 </links>
9740         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9741             <actions>
9742                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9743                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9744                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9745                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9746             </actions>
9747         </permacrud>
9748         </class>
9749
9750         <class id="acqfscred" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source_credit" oils_persist:tablename="acq.funding_source_credit" reporter:label="Credit to Funding Source">
9751                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9752                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9753                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9754                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9755                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9756                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9757                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9758                 </fields>
9759                 <links>
9760                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9761                 </links>
9762                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9763                         <actions>
9764                                 <create permission="ADMIN_FUNDING_SOURCE">
9765                     <context link="funding_source" field="owner"/>
9766                 </create>
9767                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9768                     <context link="funding_source" field="owner"/>
9769                 </retrieve>
9770                                 <update permission="ADMIN_FUNDING_SOURCE">
9771                     <context link="funding_source" field="owner"/>
9772                 </update>
9773                                 <delete permission="ADMIN_FUNDING_SOURCE">
9774                     <context link="funding_source" field="owner"/>
9775                 </delete>
9776                         </actions>
9777                 </permacrud>
9778         </class>
9779
9780         <class id="acqofscred" controller="open-ils.cstore" oils_obj:fieldmapper="acq::ordered_funding_source_credit" oils_persist:tablename="acq.ordered_funding_source_credit" reporter:label="Ordered Funding Source Credit">
9781                 <fields oils_persist:primary="id">
9782                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9783                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9784                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9785                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9786                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9787                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9788                 </fields>
9789                 <links>
9790                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9791                 </links>
9792         </class>
9793
9794         <class id="acqfdeb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_debit" oils_persist:tablename="acq.fund_debit" reporter:label="Debit From Fund">
9795                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9796                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9797                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9798                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9799                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9800                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9801                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9802                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9803                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9804                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9805                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9806                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9807                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9808                 </fields>
9809                 <links>
9810                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9811                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9812                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9813                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9814                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9815                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9816                 </links>
9817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9818                         <actions>
9819                                 <create permission="ADMIN_ACQ_FUND">
9820                     <context link="fund" field="org"/>
9821                 </create>
9822                                 <retrieve permission="ADMIN_ACQ_FUND">
9823                     <context link="fund" field="org"/>
9824                 </retrieve>
9825                                 <update permission="ADMIN_ACQ_FUND">
9826                     <context link="fund" field="org"/>
9827                 </update>
9828                                 <delete permission="ADMIN_ACQ_FUND">
9829                     <context link="fund" field="org"/>
9830                 </delete>
9831                         </actions>
9832                 </permacrud>
9833         </class>
9834
9835         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9836                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9837                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9838                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9839                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9840                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9841                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9842                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9843                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9844                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9845                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9846                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9847                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9848                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9849                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9850                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9851                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9852                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9853                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9854                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9855                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9856                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9857                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9858                 </fields>
9859                 <links>
9860                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9861                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9862             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9863             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9864             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9865             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9866             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9867             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9868             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9869             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9870             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9871                 </links>
9872         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9873             <actions>
9874                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9875                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9876                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9877                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9878             </actions>
9879         </permacrud>
9880         </class>
9881
9882         <class id="acqfat" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_allocation_total" reporter:label="Fund Allocation Total">
9883                 <fields oils_persist:primary="fund">
9884                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9885                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9886                 </fields>
9887                 <links>
9888                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9889                 </links>
9890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9891             <actions>
9892                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9893                                         <context link="fund" field="org" />
9894                 </retrieve>
9895             </actions>
9896         </permacrud>
9897         </class>
9898
9899         <class id="acqfdt" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_debit_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_debit_total" reporter:label="Total Debit from Fund">
9900                 <fields oils_persist:primary="fund">
9901                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9902                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9903                 </fields>
9904                 <links>
9905                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9906                 </links>
9907         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9908             <actions>
9909                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9910                                         <context link="fund" field="org" />
9911                 </retrieve>
9912             </actions>
9913         </permacrud>
9914         </class>
9915
9916         <class id="acqfet" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_encumbrance_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_encumbrance_total" reporter:label="Total Fund Encumbrance">
9917                 <fields oils_persist:primary="fund">
9918                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9919                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9920                 </fields>
9921                 <links>
9922                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9923                 </links>
9924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9925             <actions>
9926                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9927                                         <context link="fund" field="org" />
9928                 </retrieve>
9929             </actions>
9930         </permacrud>
9931         </class>
9932
9933         <class id="acqfst" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_spent_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_spent_total" reporter:label="Total Spent from Fund">
9934                 <fields oils_persist:primary="fund">
9935                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9936                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9937                 </fields>
9938                 <links>
9939                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9940                 </links>
9941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9942             <actions>
9943                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9944                                         <context link="fund" field="org" />
9945                 </retrieve>
9946             </actions>
9947         </permacrud>
9948         </class>
9949
9950         <class id="acqfcb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_combined_balance" oils_persist:readonly="true" oils_persist:tablename="acq.fund_combined_balance" reporter:label="Fund Combined Balance">
9951                 <fields oils_persist:primary="fund">
9952                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9953                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
9954                 </fields>
9955                 <links>
9956                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9957                 </links>
9958         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9959             <actions>
9960                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9961                                         <context link="fund" field="org" />
9962                 </retrieve>
9963             </actions>
9964         </permacrud>
9965         </class>
9966
9967    <class id="acqafat" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_allocation_total" reporter:label="All Fund Allocation Total">
9968         <fields oils_persist:primary="fund">
9969             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9970             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9971         </fields>
9972         <links>
9973             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9974         </links>
9975     </class>
9976
9977    <class id="acqafet" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_encumbrance_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_encumbrance_total" reporter:label="All Fund Encumbrance Total">
9978         <fields oils_persist:primary="fund">
9979             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9980             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
9981         </fields>
9982         <links>
9983             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9984         </links>
9985     </class>
9986
9987    <class id="acqafst" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_spent_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_spent_total" reporter:label="All Fund Spent Total">
9988         <fields oils_persist:primary="fund">
9989             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9990             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9991         </fields>
9992         <links>
9993             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9994         </links>
9995     </class>
9996
9997    <class id="acqafsb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_spent_balance" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_spent_balance" reporter:label="All Fund Spent Balance">
9998         <fields oils_persist:primary="fund">
9999             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10000             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10001         </fields>
10002         <links>
10003             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10004         </links>
10005     </class>
10006
10007    <class id="acqafcb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_combined_balance" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_combined_balance" reporter:label="All Fund Combined Total">
10008         <fields oils_persist:primary="fund">
10009             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10010             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10011         </fields>
10012         <links>
10013             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10014         </links>
10015     </class>
10016
10017         <class id="acqfsrcct" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_credit_total" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_credit_total" reporter:label="Total Credit to Funding Source">
10018                 <fields oils_persist:primary="funding_source">
10019                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10020                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10021                 </fields>
10022                 <links>
10023                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10024                 </links>
10025         </class>
10026
10027         <class id="acqfsrcat" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_allocation_total" reporter:label="Total Allocation to Funding Source">
10028                 <fields oils_persist:primary="funding_source">
10029                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10030                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10031                 </fields>
10032                 <links>
10033                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10034                 </links>
10035         </class>
10036
10037         <class id="acqfsrcb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_balance" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_balance" reporter:label="Funding Source Balance">
10038                 <fields oils_persist:primary="funding_source">
10039                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10040                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10041                 </fields>
10042                 <links>
10043                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10044                 </links>
10045         </class>
10046
10047         <class id="acqfsb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_spent_balance" oils_persist:readonly="true" oils_persist:tablename="acq.fund_spent_balance" reporter:label="Fund Spent Balance">
10048                 <fields oils_persist:primary="fund">
10049                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10050                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10051                 </fields>
10052                 <links>
10053                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10054                 </links>
10055         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10056             <actions>
10057                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10058                                         <context link="fund" field="org" />
10059                 </retrieve>
10060             </actions>
10061         </permacrud>
10062     </class>
10063     <class id="acqfsum" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_summary" reporter:label="Fund Summary" reporter:core="true" oils_persist:readonly="true">
10064         <oils_persist:source_definition><![CDATA[
10065             SELECT
10066                 acqf.*,
10067                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10068                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10069                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10070                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10071             FROM
10072                 acq.fund acqf
10073                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10074                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10075                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10076                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10077         ]]></oils_persist:source_definition>
10078         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10079             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10080             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10081             <field reporter:label="Name" name="name" reporter:datatype="text" />
10082             <field reporter:label="Year" name="year" reporter:datatype="int" />
10083             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10084             <field reporter:label="Code" name="code" reporter:datatype="text" />
10085             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10086             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10087             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10088             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10089             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10090
10091             <!-- non fund-native fields -->
10092             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10093             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10094             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10095             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10096         </fields>
10097         <links>
10098             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10099             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10100             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10101         </links>
10102         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10103             <actions>
10104                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10105             </actions>
10106         </permacrud>
10107         </class>
10108         <class id="acqfa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_allocation" oils_persist:tablename="acq.fund_allocation" reporter:label="Fund Allocation">
10109                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10110                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10111                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10112                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10113                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10114                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10115                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10116                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10117                 </fields>
10118                 <links>
10119                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10120                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10121                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10122                 </links>
10123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10124                         <actions>
10125                                 <create permission="ADMIN_ACQ_FUND">
10126                     <context link="fund" field="org"/>
10127                 </create>
10128                                 <retrieve permission="ADMIN_ACQ_FUND">
10129                     <context link="fund" field="org"/>
10130                 </retrieve>
10131                                 <update permission="ADMIN_ACQ_FUND">
10132                     <context link="fund" field="org"/>
10133                 </update>
10134                                 <delete permission="ADMIN_ACQ_FUND">
10135                     <context link="fund" field="org"/>
10136                 </delete>
10137                         </actions>
10138                 </permacrud>
10139         </class>
10140
10141     <class id="acqfap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_allocation_percent" oils_persist:tablename="acq.fund_allocation_percent" reporter:label="Fund Allocation Percent">
10142         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10143             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10144             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10145             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10146             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10147             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10148             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10149             <field reporter:label="Note" name="note" reporter:datatype="text" />
10150             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10151         </fields>
10152         <links>
10153             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10154             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10155             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10156         </links>
10157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10158                         <actions>
10159                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10160                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10161                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10162                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10163                         </actions>
10164                 </permacrud>
10165     </class>
10166
10167         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10168                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10169                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10170                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10172                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10173                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10174                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10175                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10176                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10177                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10178                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10179                 </fields>
10180                 <links>
10181                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10182                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10183                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10184                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10185                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10186                 </links>
10187                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10188                         <actions>
10189                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10190                         </actions>
10191                 </permacrud>
10192         </class>
10193
10194         <class id="acqcr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::cancel_reason" oils_persist:tablename="acq.cancel_reason" reporter:label="Cancel Reason">
10195                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10196                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10197                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10198                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10199                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10200                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10201                 </fields>
10202                 <links>
10203                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10204                 </links>
10205                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10206                         <actions>
10207                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10208                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10209                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10210                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10211                         </actions>
10212                 </permacrud>
10213         </class>
10214
10215         <class id="acqpo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::purchase_order" oils_persist:tablename="acq.purchase_order" reporter:label="Purchase Order">
10216                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10217                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10218                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10219                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10220                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10221                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10222                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10223                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10224                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10225                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10226                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10227                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10228                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10229                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10230                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10231                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10232                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10233                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10234                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10235                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10236                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10237                 </fields>
10238                 <links>
10239                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10240                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10241                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10242                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10243                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10244                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10245                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10246                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10247                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10248                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10249                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10250                 </links>
10251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10252                         <actions>
10253                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10254                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10255                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10256                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10257                         </actions>
10258                 </permacrud>
10259         </class>
10260
10261         <class id="acqpoh" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::acq_purchase_order_history" oils_persist:tablename="acq.acq_purchase_order_history" reporter:label="Purchase Order History">
10262                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10263                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10264                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10265                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10266                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10267                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10268                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10269                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10270                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10271                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10272                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10273                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10274                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10275                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10276                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10277                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10278                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10279                 </fields>
10280                 <links>
10281                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10282                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10283                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10284                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10285                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10286                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10287                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10288                 </links>
10289                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10290             <actions>
10291                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10292             </actions>
10293                 </permacrud>
10294         </class>
10295
10296         <class id="acqpon" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_note" oils_persist:tablename="acq.po_note" reporter:label="PO Note">
10297                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10298                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10299                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10300                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10301                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10302                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10303                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10304                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10305                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10306                 </fields>
10307                 <links>
10308                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10309                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10310                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10311                 </links>
10312                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10313             <actions>
10314                 <create permission="CREATE_PURCHASE_ORDER">
10315                     <context link="purchase_order" field="ordering_agency"/>
10316                 </create>
10317                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10318                     <context link="purchase_order" field="ordering_agency"/>
10319                 </retrieve>
10320                 <update permission="CREATE_PURCHASE_ORDER">
10321                     <context link="purchase_order" field="ordering_agency"/>
10322                 </update>
10323                 <delete permission="CREATE_PURCHASE_ORDER">
10324                     <context link="purchase_order" field="ordering_agency"/>
10325                 </delete>
10326             </actions>
10327                 </permacrud>
10328         </class>
10329
10330         <class id="acqpoi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_item" oils_persist:tablename="acq.po_item" reporter:label="Purchase Order Item">
10331                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10332                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10333                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10334                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10335                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10336                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10337                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10338                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10339                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10340                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10341                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10342                 </fields>
10343                 <links>
10344                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10345                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10346                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10347                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10348                 </links>
10349                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10350             <actions>
10351                 <create permission="CREATE_PURCHASE_ORDER">
10352                     <context link="purchase_order" field="ordering_agency"/>
10353                 </create>
10354                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10355                     <context link="purchase_order" field="ordering_agency"/>
10356                 </retrieve>
10357                 <update permission="CREATE_PURCHASE_ORDER">
10358                     <context link="purchase_order" field="ordering_agency"/>
10359                 </update>
10360                 <delete permission="CREATE_PURCHASE_ORDER">
10361                     <context link="purchase_order" field="ordering_agency"/>
10362                 </delete>
10363             </actions>
10364                 </permacrud>
10365         </class>
10366
10367         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10368                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10369                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10370                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10371                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10372                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10373                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10374                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10375                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10376                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10377                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10378                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10379                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10380                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10381                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10382                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10383                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10384                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10385                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10386                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10387                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10388                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10389                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10390                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10391                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10392                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10393                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10394                 </fields>
10395                 <links>
10396                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10397                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10398                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10399                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10400                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10401                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10402                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10403                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10404                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10405                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10406                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10407                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10408                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10409                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10410                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10411                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10412                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10413                 </links>
10414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10415                         <actions>
10416                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10417                                         <context link="purchase_order" field="ordering_agency"/>
10418                                         <context link="picklist" field="org_unit"/>
10419                                 </retrieve>
10420                         </actions>
10421                 </permacrud>
10422         </class>
10423
10424         <class id="acqlih" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::acq_lineitem_history" oils_persist:tablename="acq.acq_lineitem_history" reporter:label="Line Item History">
10425                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10426                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10427                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10428                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10429                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10430                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10431                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10432                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10433                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10434                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10435                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10436                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10437                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10438                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10439                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10440                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10441                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10442                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10443                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10444                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10445                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10446                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10447                 </fields>
10448                 <links>
10449                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10450                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10451                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10452                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10453                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10454                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10455                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10456                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10457                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10458                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10459                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10460                 </links>
10461                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10462                         <actions>
10463                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10464                                         <context link="purchase_order" field="ordering_agency"/>
10465                                         <context link="picklist" field="org_unit"/>
10466                                 </retrieve>
10467                         </actions>
10468                 </permacrud>
10469         </class>
10470
10471         <class id="acqliat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_alert_text" oils_persist:tablename="acq.lineitem_alert_text" reporter:label="Line Item Alert Text">
10472                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10473                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
10474                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10475                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10476                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10477                 </fields>
10478                 <links>
10479                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10480                 </links>
10481                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10482                         <actions>
10483                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10484                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10485                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10486                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10487                         </actions>
10488                 </permacrud>
10489         </class>
10490
10491         <class id="acqlin" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_note" oils_persist:tablename="acq.lineitem_note" reporter:label="Line Item Note">
10492                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10493                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10494                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10495                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10496                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10497                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10498                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10499                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10500                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10501                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10502                 </fields>
10503                 <links>
10504                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10505                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10506                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10507                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10508                 </links>
10509         </class>
10510
10511         <class id="acqlia" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_attr" oils_persist:tablename="acq.lineitem_attr" reporter:label="Line Item Attribute">
10512                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10513                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10514                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10515                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10516                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10517                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10518                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10519                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10520                 </fields>
10521                 <links>
10522                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10523                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10524                 </links>
10525         </class>
10526
10527         <class id="acqlid" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_detail" oils_persist:tablename="acq.lineitem_detail" reporter:label="Line Item Detail">
10528                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10529                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10530                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10531                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10532                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10533                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10534                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10535                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10536                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10537                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10538                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10539                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10540                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10541                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10542                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10543                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10544                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10545                 </fields>
10546                 <links>
10547                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10548                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10549                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10550                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10551                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10552                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10553                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10554                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10555                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10556                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10557                 </links>
10558         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10559             <actions>
10560                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10561                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10562                     <context link="lineitem" jump="picklist" field="org_unit"/>
10563                 </retrieve>
10564             </actions>
10565         </permacrud>
10566         </class>
10567
10568         <class id="acqliad" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_attr_definition" oils_persist:tablename="acq.lineitem_attr_definition" reporter:label="Line Item Attribute Definition">
10569                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10570                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10571                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10572                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10573                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10574                 </fields>
10575                 <links/>
10576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10577                         <actions>
10578                                 <retrieve />
10579                         </actions>
10580                 </permacrud>
10581         </class>
10582
10583         <class id="acqlimad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_marc_attr_definition" oils_persist:tablename="acq.lineitem_marc_attr_definition" reporter:label="Line Item MARC Attribute Definition">
10584                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10585                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10586                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10587                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10588                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10589                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10590             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10591                 </fields>
10592                 <links/>
10593         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10594             <actions>
10595                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10596                 <retrieve />
10597                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10598                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10599             </actions>
10600         </permacrud>
10601         </class>
10602
10603         <class id="acqligad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_generated_attr_definition" oils_persist:tablename="acq.lineitem_generated_attr_definition" reporter:label="Line Item Generated Attribute Definition">
10604                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10605                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10606                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10607                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10608                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10609                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10610                 </fields>
10611                 <links/>
10612         </class>
10613         <class id="acqliuad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_usr_attr_definition" oils_persist:tablename="acq.lineitem_usr_attr_definition" reporter:label="Line Item User Attribute Definition">
10614                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10615                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10616                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10617                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10618                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10619                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10620                 </fields>
10621                 <links>
10622                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10623                 </links>
10624         </class>
10625
10626         <class id="acqlipad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_provider_attr_definition" oils_persist:tablename="acq.lineitem_provider_attr_definition" reporter:label="Line Item Provider Attribute Definition">
10627             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10628                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10629                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10630                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10631                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10632                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10633                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10634         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10635
10636             </fields>
10637             <links>
10638                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10639             </links>
10640             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10641                 <actions>
10642                     <create permission="ADMIN_PROVIDER">
10643                         <context link="provider" field="owner"/>
10644                     </create>
10645                     <retrieve permission="ADMIN_PROVIDER">
10646                         <context link="provider" field="owner"/>
10647                     </retrieve>
10648                     <update permission="ADMIN_PROVIDER">
10649                         <context link="provider" field="owner"/>
10650                     </update>
10651                     <delete permission="ADMIN_PROVIDER">
10652                         <context link="provider" field="owner"/>
10653                     </delete>
10654                 </actions>
10655             </permacrud>
10656         </class>
10657         
10658         <class id="acqphsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_holding_subfield_map" oils_persist:tablename="acq.provider_holding_subfield_map" reporter:label="Provider Holding Subfield Map">
10659             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10660                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10661                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10662                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10663                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10664             </fields>
10665             <links>
10666                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10667             </links>
10668             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10669                 <actions>
10670                     <create permission="ADMIN_PROVIDER">
10671                         <context link="provider" field="owner"/>
10672                     </create>
10673                     <retrieve permission="ADMIN_PROVIDER">
10674                         <context link="provider" field="owner"/>
10675                     </retrieve>
10676                     <update permission="ADMIN_PROVIDER">
10677                         <context link="provider" field="owner"/>
10678                     </update>
10679                     <delete permission="ADMIN_PROVIDER">
10680                         <context link="provider" field="owner"/>
10681                     </delete>
10682                 </actions>
10683             </permacrud>
10684         </class>
10685         
10686         <class id="acqlilad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_local_attr_definition" oils_persist:tablename="acq.lineitem_local_attr_definition" reporter:label="Line Item Local Attribute Definition">
10687             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10688                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10689                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10690                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10691                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10692                 </fields>
10693                 <links/>
10694         </class>
10695
10696         <class id="acqedi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_account" oils_persist:tablename="acq.edi_account" reporter:label="EDI Account">
10697                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10698                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10699                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10700                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10701                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10702                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10703                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10704                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10705                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10706                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10707                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10708                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10709                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10710                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10711                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10712                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10713                 </fields>
10714                 <links>
10715                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10716                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10717                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10718                 </links>
10719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10720             <actions>
10721                 <create permission="ADMIN_PROVIDER">
10722                     <context link="provider" field="owner"/>
10723                 </create>
10724                 <retrieve permission="ADMIN_PROVIDER">
10725                     <context link="provider" field="owner"/>
10726                 </retrieve>
10727                 <update permission="ADMIN_PROVIDER">
10728                     <context link="provider" field="owner"/>
10729                 </update>
10730                 <delete permission="ADMIN_PROVIDER">
10731                     <context link="provider" field="owner"/>
10732                 </delete>
10733             </actions>
10734         </permacrud>
10735         </class>
10736
10737         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10738                 oils_obj:fieldmapper="acq::edi_attr" 
10739                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10740                 <fields oils_persist:primary="key">
10741                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10742                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10743                 </fields>
10744         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10745             <actions>
10746                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10747                 <retrieve/>
10748                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10749                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10750             </actions>
10751         </permacrud>
10752         </class>
10753         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10754                 oils_obj:fieldmapper="acq::edi_attr_set" 
10755                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10756                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10757                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10758                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10759                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10760                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10761                 </fields>
10762                 <links>
10763                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10764                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10765                 </links>
10766         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10767             <actions>
10768                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10769                 <retrieve/>
10770                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10771                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10772             </actions>
10773         </permacrud>
10774         </class>
10775         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10776                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10777                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10778                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10779                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10780                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10781                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10782                 </fields>
10783                 <links>
10784                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10785                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10786                 </links>
10787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10788             <actions>
10789                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10790                 <retrieve/>
10791                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10792                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10793             </actions>
10794         </permacrud>
10795         </class>
10796
10797
10798         <class id="acqedim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_message" oils_persist:tablename="acq.edi_message" reporter:label="EDI Message">
10799                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10800                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10801                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10802                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10803                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10804                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10805                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10806                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10807                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10808                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10809                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10810                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10811                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10812                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10813                 </fields>
10814                 <links>
10815                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10816                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10817                 </links>
10818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10819             <actions>
10820                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10821                     <context link="account" jump="provider" field="owner"/>
10822                 </retrieve>
10823                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10824                     <context link="account" jump="provider" field="owner"/>
10825                 </update>
10826                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10827                     <context link="account" jump="provider" field="owner"/>
10828                 </delete>
10829             </actions>
10830         </permacrud>
10831         </class>
10832
10833
10834         <class id="rof" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
10835                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10836                         <field name="id" reporter:datatype="id" />
10837                         <field name="parent" reporter:datatype="link"/>
10838                         <field name="owner" reporter:datatype="link"/>
10839                         <field name="create_time" reporter:datatype="timestamp"/>
10840                         <field name="name" reporter:datatype="text"/>
10841                         <field name="shared" reporter:datatype="bool"/>
10842                         <field name="share_with" reporter:datatype="link"/>
10843                         <field name="simple_reporter" reporter:datatype="bool"/>
10844                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10845                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10846                 </fields>
10847                 <links>
10848                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10849                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10850                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10851                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10852                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10853                 </links>
10854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10855             <actions>
10856                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10857                     <context link="owner" field="home_ou"/>
10858                 </create>
10859                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10860                     <context link="owner" field="home_ou"/>
10861                 </retrieve>
10862                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10863                     <context link="owner" field="home_ou"/>
10864                 </update>
10865                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10866                     <context link="owner" field="home_ou"/>
10867                 </delete>
10868             </actions>
10869         </permacrud>
10870         </class>
10871         <class id="rtf" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
10872                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10873                         <field name="id" reporter:datatype="id" />
10874                         <field name="parent" reporter:datatype="link"/>
10875                         <field name="owner" reporter:datatype="link"/>
10876                         <field name="create_time" reporter:datatype="timestamp"/>
10877                         <field name="name" reporter:datatype="text"/>
10878                         <field name="shared" reporter:datatype="bool"/>
10879                         <field name="share_with" reporter:datatype="link"/>
10880                         <field name="simple_reporter" reporter:datatype="bool"/>
10881                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10882                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10883                 </fields>
10884                 <links>
10885                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10886                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10887                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10888                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10889                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10890                 </links>
10891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10892             <actions>
10893                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10894                     <context link="owner" field="home_ou"/>
10895                 </create>
10896                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10897                     <context link="owner" field="home_ou"/>
10898                 </retrieve>
10899                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10900                     <context link="owner" field="home_ou"/>
10901                 </update>
10902                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10903                     <context link="owner" field="home_ou"/>
10904                 </delete>
10905             </actions>
10906         </permacrud>
10907         </class>
10908         <class id="rrf" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
10909                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10910                         <field name="id" reporter:datatype="id" />
10911                         <field name="parent" reporter:datatype="link"/>
10912                         <field name="owner" reporter:datatype="link"/>
10913                         <field name="create_time" reporter:datatype="timestamp"/>
10914                         <field name="name" reporter:datatype="text"/>
10915                         <field name="shared" reporter:datatype="bool"/>
10916                         <field name="share_with" reporter:datatype="link"/>
10917                         <field name="simple_reporter" reporter:datatype="bool"/>
10918                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10919                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10920                 </fields>
10921                 <links>
10922                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10923                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10924                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10925                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10926                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10927                 </links>
10928         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10929             <actions>
10930                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10931                     <context link="owner" field="home_ou"/>
10932                 </create>
10933                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10934                     <context link="owner" field="home_ou"/>
10935                 </retrieve>
10936                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10937                     <context link="owner" field="home_ou"/>
10938                 </update>
10939                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10940                     <context link="owner" field="home_ou"/>
10941                 </delete>
10942             </actions>
10943         </permacrud>
10944         </class>
10945         <class id="rt" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
10946                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10947                         <field name="id" reporter:datatype="id" />
10948                         <field name="owner" reporter:datatype="link"/>
10949                         <field name="create_time" reporter:datatype="timestamp"/>
10950                         <field name="name" reporter:datatype="text"/>
10951                         <field name="data" reporter:datatype="text"/>
10952                         <field name="folder" reporter:datatype="link"/>
10953                         <field name="description" reporter:datatype="text"/>
10954                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10955                 </fields>
10956                 <links>
10957                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10958                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10959                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10960                 </links>
10961         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10962             <actions>
10963                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10964                     <context link="owner" field="home_ou"/>
10965                 </create>
10966                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10967                     <context link="owner" field="home_ou"/>
10968                 </retrieve>
10969                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10970                     <context link="owner" field="home_ou"/>
10971                 </update>
10972                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10973                     <context link="owner" field="home_ou"/>
10974                 </delete>
10975             </actions>
10976         </permacrud>
10977         </class>
10978         <class id="rr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
10979                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
10980                         <field name="id" reporter:datatype="id" />
10981                         <field name="owner" reporter:datatype="link"/>
10982                         <field name="create_time" reporter:datatype="timestamp"/>
10983                         <field name="template" reporter:datatype="link"/>
10984                         <field name="data" reporter:datatype="text"/>
10985                         <field name="folder" reporter:datatype="link"/>
10986                         <field name="recur" reporter:datatype="bool"/>
10987                         <field name="recurrence" reporter:datatype="interval"/>
10988                         <field name="name" reporter:datatype="text"/>
10989                         <field name="description" reporter:datatype="text"/>
10990                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
10991                 </fields>
10992                 <links>
10993                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10994                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10995                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
10996                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
10997                 </links>
10998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10999             <actions>
11000                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11001                     <context link="owner" field="home_ou"/>
11002                 </create>
11003                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11004                     <context link="owner" field="home_ou"/>
11005                 </retrieve>
11006                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11007                     <context link="owner" field="home_ou"/>
11008                 </update>
11009                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11010                     <context link="owner" field="home_ou"/>
11011                 </delete>
11012             </actions>
11013         </permacrud>
11014         </class>
11015         <class id="rs" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
11016                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11017                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11018                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11019                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11020                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11021                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11022                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11023                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11024                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11025                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11026                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11027                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11028                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11029                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11030                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11031                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11032                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11033                 </fields>
11034                 <links>
11035                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11036                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11037                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11038                 </links>
11039         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11040             <actions>
11041                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11042                     <context link="runner" field="home_ou"/>
11043                 </create>
11044                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11045                     <context link="runner" field="home_ou"/>
11046                 </retrieve>
11047                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11048                     <context link="runner" field="home_ou"/>
11049                 </update>
11050                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11051                     <context link="runner" field="home_ou"/>
11052                 </delete>
11053             </actions>
11054         </permacrud>
11055         </class>
11056     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11057            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11058            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11059                 <fields oils_persist:primary="run">
11060             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11061             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11062             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11063             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11064             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11065             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11066             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11067             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11068             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11069             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11070             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11071             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11072             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11073             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11074             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11075             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11076                 </fields>
11077                 <links>
11078             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11079             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11080             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11081             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11082             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11083             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11084             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11085             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11086             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11087                 </links>
11088         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11089             <actions>
11090                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11091                     <context link="runner" field="home_ou"/>
11092                 </retrieve>
11093             </actions>
11094         </permacrud>
11095     </class>
11096         <class id="rmsr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::materialized_simple_record" oils_persist:tablename="reporter.materialized_simple_record" reporter:label="Fast Simple Record Extracts">
11097                 <fields oils_persist:primary="id">
11098                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11099                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11100                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11101                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11102                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11103                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11104                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11105                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11106                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11107                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11108                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11109                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11110                 </fields>
11111                 <links>
11112                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11113                 </links>
11114                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11115                         <actions>
11116                                 <retrieve />
11117                         </actions>
11118                 </permacrud>
11119         </class>
11120         <class id="rssr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::super_simple_record" oils_persist:tablename="reporter.super_simple_record" reporter:label="Simple Record Extracts">
11121                 <fields oils_persist:primary="id">
11122                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11123                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11124                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11125                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11126                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11127                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11128                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11129                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11130                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11131                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11132                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11133                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11134                 </fields>
11135                 <links>
11136                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11137                 </links>
11138         </class>
11139         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11140                 <fields oils_persist:primary="id">
11141                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11142                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11143                         <field reporter:label="Fingerprint" name="fingerprint" />
11144                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11145                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11146                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11147                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11148                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11149                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11150                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11151                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11152                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11153                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11154                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11155                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11156                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11157                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11158                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11159                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11160                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11161                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11162                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11163                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11164                 </fields>
11165                 <links>
11166                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11167                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11168                 </links>
11169         </class>
11170         <class id="rud" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::user_demographic" oils_persist:tablename="reporter.demographic" reporter:label="User Demographics">
11171                 <fields oils_persist:primary="id">
11172                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11173                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11174                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11175                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11176                 </fields>
11177                 <links>
11178                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11179                 </links>
11180         </class>
11181         <class id="rcirct" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::circulation_type" oils_persist:tablename="reporter.circ_type" reporter:label="Circulation Type">
11182                 <fields oils_persist:primary="id">
11183                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11184                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11185                 </fields>
11186                 <links>
11187                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11188                 </links>
11189         </class>
11190         <class id="rhrr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
11191                 <fields oils_persist:primary="id">
11192                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11193                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11194                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11195                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11196                 </fields>
11197                 <links>
11198                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11199                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11200                 </links>
11201                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11202                         <actions>
11203                                 <retrieve permission="VIEW_HOLD">
11204                                         <context link="id" field="pickup_lib"/>
11205                                 </retrieve>
11206                         </actions>
11207                 </permacrud>
11208         </class>
11209         <class id="rxbt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::xact_billing_totals" oils_persist:tablename="reporter.xact_billing_totals" reporter:label="Transaction Billing Totals">
11210                 <fields oils_persist:primary="xact">
11211                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11212                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11213                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11214                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11215                 </fields>
11216                 <links>
11217                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11218                 </links>
11219         </class>
11220         <class id="rxpt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::xact_paid_totals" oils_persist:tablename="reporter.xact_paid_totals" reporter:label="Transaction Paid Totals">
11221                 <fields oils_persist:primary="xact">
11222                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11223                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11224                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11225                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11226                 </fields>
11227                 <links>
11228                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11229                 </links>
11230         </class>
11231         <class id="ergbhu" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::global_bibs_by_holding_update" oils_persist:tablename="extend_reporter.global_bibs_by_holding_update" reporter:label="Bib IDs by Holding Add/Delete Time (OCLC batch update)">
11232                 <fields oils_persist:primary="id">
11233                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11234                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11235                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11236                 </fields>
11237                 <links>
11238                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11239                 </links>
11240         </class>
11241         <class id="erfcc" controller="open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="extend_reporter::full_circ_count" oils_persist:tablename="extend_reporter.full_circ_count" reporter:label="Total Circulation Count, Including Legacy">
11242                 <fields oils_persist:primary="id">
11243                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11244                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11245                 </fields>
11246                 <links>
11247                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11248                 </links>
11249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11250                         <actions>
11251                                 <retrieve permission="STAFF_LOGIN">
11252                                         <context link="id" field="circ_lib"/>
11253                                 </retrieve>
11254                         </actions>
11255                 </permacrud>
11256         </class>
11257         <class id="erccpo" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::copy_count_per_org" oils_persist:tablename="extend_reporter.copy_count_per_org" reporter:label="Library Holdings Count with Deleted">
11258                 <fields oils_persist:primary="bibid">
11259                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11260                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11261                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11262                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11263                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11264                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11265                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11266                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11267                 </fields>
11268                 <links>
11269                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11270                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11271                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11272                 </links>
11273         </class>
11274         <class id="rcsv" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::copy_statistics_view" oils_persist:tablename="reporter.copy_statistics_view" reporter:label="Item Statistics View">
11275                 <fields oils_persist:primary="copy_id">
11276                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11277                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11278                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11279                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11280                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11281                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11282                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11283                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11284                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11285                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11286                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11287                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11288                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11289                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11290                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11291                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11292                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11293                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11294                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11295                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11296                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11297                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11298                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11299                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11300                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11301                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11302                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11303                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11304                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11305                 </fields>
11306                 <links>
11307                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11308                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11309                 </links>
11310         </class>
11311         <class id="acqdf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula" oils_persist:tablename="acq.distribution_formula" reporter:label="Distribution Formula">
11312                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11313                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11314                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11315                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11316                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11317                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11318                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11319                 </fields>
11320                 <links>
11321                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11322                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11323                 </links>
11324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11325                         <actions>
11326                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11327                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11328                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11329                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11330                         </actions>
11331                 </permacrud>
11332         </class>
11333         <class id="acqdfe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula_entry" oils_persist:tablename="acq.distribution_formula_entry" reporter:label="Distribution Formula Entry">
11334                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11335                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11336                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11337                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11338                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11339                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11340                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11341                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11342                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11343                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11344                 </fields>
11345                 <links>
11346                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11347                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11348                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11349                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11350                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11351                 </links>
11352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11353                         <actions>
11354                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11355                                         <context link="formula" field="owner"/>
11356                                 </create>
11357                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11358                                         <context link="formula" field="owner"/>
11359                                 </retrieve>
11360                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11361                                         <context link="formula" field="owner"/>
11362                                 </update>
11363                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11364                                         <context link="formula" field="owner"/>
11365                                 </delete>
11366                         </actions>
11367                 </permacrud>
11368         </class>
11369
11370         <class id="acqdfa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula_application" oils_persist:tablename="acq.distribution_formula_application" reporter:label="Distribution Formula Application">
11371                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11372                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11373                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11374                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11375                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11376                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11377                 </fields>
11378                 <links>
11379                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11380                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11381                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11382                 </links>
11383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11384                         <actions>
11385                                 <create permission="CREATE_PURCHASE_ORDER">
11386                                         <context link="formula" field="owner"/>
11387                 </create>
11388                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11389                                         <context link="formula" field="owner"/>
11390                 </retrieve>
11391                                 <update permission="CREATE_PURCHASE_ORDER">
11392                                         <context link="formula" field="owner"/>
11393                 </update>
11394                                 <delete permission="CREATE_PURCHASE_ORDER">
11395                                         <context link="formula" field="owner"/>
11396                 </delete>
11397                         </actions>
11398                 </permacrud>
11399         </class>
11400
11401         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11402                 <fields oils_persist:primary="id">
11403                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11404                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11405                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11406                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11407                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11408                 </fields>
11409                 <links>
11410                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11411                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11412                 </links>
11413         </class>
11414
11415         <class id="acqclt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_type" oils_persist:tablename="acq.claim_type" reporter:label="Claim Type">
11416                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11417                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11418                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11419                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11420                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11421                 </fields>
11422                 <links>
11423                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11424                 </links>
11425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11426                         <actions>
11427                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11428                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11429                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11430                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11431                         </actions>
11432                 </permacrud>
11433         </class>
11434
11435         <class id="acqclet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_event_type" oils_persist:tablename="acq.claim_event_type" reporter:label="Claim Event Type">
11436                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11437                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11438                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11439                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11440                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11441                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11442                 </fields>
11443                 <links>
11444                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11445                 </links>
11446                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11447                         <actions>
11448                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11449                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11450                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11451                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11452                         </actions>
11453                 </permacrud>
11454         </class>
11455
11456         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11457                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11458                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11459                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11460                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11461                 </fields>
11462                 <links>
11463                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11464                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11465                 </links>
11466         </class>
11467
11468         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11469                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11470                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11471                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11472                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11473                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11474                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11475                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11476                 </fields>
11477                 <links>
11478                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11479                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11480                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11481                 </links>
11482         </class>
11483
11484         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11485                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11486                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11487                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11488                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11489                 </fields>
11490                 <links>
11491                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11492                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11493                 </links>
11494         </class>
11495
11496         <class id="acqscle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim_event" oils_persist:tablename="acq.serial_claim_event" reporter:label="Serial Claim Event">
11497                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11498                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11499                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11500                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11501                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11502                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11503                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11504                 </fields>
11505                 <links>
11506                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11507                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11508                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11509                 </links>
11510         </class>
11511
11512         <class id="acqclp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy" oils_persist:tablename="acq.claim_policy" reporter:label="Claim Policy">
11513                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11514                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11515                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11516                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11517                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11518                 </fields>
11519                 <links>
11520                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11521                 </links>
11522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11523             <actions>
11524                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11525                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11526                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11527                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11528             </actions>
11529                 </permacrud>
11530         </class>
11531
11532         <class id="acqclpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy_action" oils_persist:tablename="acq.claim_policy_action" reporter:label="Claim Policy Action">
11533                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11534                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11535                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11536                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11537                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11538                 </fields>
11539                 <links>
11540                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11541                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11542                 </links>
11543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11544                         <actions>
11545                                 <create permission="ADMIN_CLAIM_POLICY">
11546                                         <context link="claim_policy" field="org_unit"/>
11547                 </create>
11548                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11549                                         <context link="claim_policy" field="org_unit"/>
11550                 </retrieve>
11551                                 <update permission="ADMIN_CLAIM_POLICY">
11552                                         <context link="claim_policy" field="org_unit"/>
11553                 </update>
11554                                 <delete permission="ADMIN_CLAIM_POLICY">
11555                                         <context link="claim_policy" field="org_unit"/>
11556                 </delete>
11557                         </actions>
11558                 </permacrud>
11559         </class>
11560
11561     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11562         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11563             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11564             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11565             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11566             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11567             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11568             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11569             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11570             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11571             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11572             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11573             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11574             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11575             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11576             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11577             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11578             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11579                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11580                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11581                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11582         </fields>
11583         <links>
11584             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11585             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11586         </links>
11587     </class>
11588
11589     <class id="stgc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::card_stage" oils_persist:tablename="staging.card_stage" reporter:label="Card Stage">
11590         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11591             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11592             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11593             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11594             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11595             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11596         </fields>
11597     </class>
11598
11599     <class id="stgma" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::mailing_address_stage" oils_persist:tablename="staging.mailing_address_stage" reporter:label="Mailing Address Stage">
11600         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11601             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11602             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11603             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11604             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11605             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11606             <field reporter:label="City" name="city" reporter:datatype="text"/>
11607             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11608             <field reporter:label="State" name="state" reporter:datatype="text"/>
11609             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11610             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11611             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11612         </fields>
11613     </class>
11614
11615     <class id="stgba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::billing_address_stage" oils_persist:tablename="staging.billing_address_stage" reporter:label="Billing Address Stage">
11616         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11617             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11618             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11619             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11620             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11621             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11622             <field reporter:label="City" name="city" reporter:datatype="text"/>
11623             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11624             <field reporter:label="State" name="state" reporter:datatype="text"/>
11625             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11626             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11627             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11628         </fields>
11629     </class>
11630
11631     <class id="stgsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::statcat_stage" oils_persist:tablename="staging.statcat_stage" reporter:label="Statistical Category Stage">
11632         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11633             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11634             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11635             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11636             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11637             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11638             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11639         </fields>
11640     </class>
11641
11642     <class id="stgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::setting_stage" oils_persist:tablename="staging.setting_stage" reporter:label="User Setting Stage">
11643         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11644             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11645             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11646             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11647             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11648             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11649             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11650         </fields>
11651     </class>
11652
11653         <class id="afsg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_group" oils_persist:tablename="action.fieldset_group" reporter:label="Fieldset Group">
11654                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11655                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11656                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11657                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11658                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11659                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11660                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11661                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11662                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11663                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11664                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11665                 </fields>
11666                 <links>
11667                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11668                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11669                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11670                 </links>
11671                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11672                         <actions>
11673                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11674                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11675                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11676                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11677                         </actions>
11678                 </permacrud>
11679         </class>
11680
11681         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11682                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11683                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11684                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11685                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11686                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11687                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11688                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11689                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11690                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11691                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11692                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11693                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11694                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11695                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11696                 </fields>
11697                 <links>
11698                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11699                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11700                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11701                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11702                 </links>
11703                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11704                         <actions>
11705                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11706                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11707                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11708                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11709                         </actions>
11710                 </permacrud>
11711         </class>
11712
11713         <class id="afscv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
11714                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11715                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11716                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11717                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11718                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11719                 </fields>
11720                 <links>
11721                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11722                 </links>
11723                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11724                         <actions>
11725                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11726                     <context link="fieldset" field="owning_lib"/>
11727                 </create>
11728                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11729                     <context link="fieldset" field="owning_lib"/>
11730                 </retrieve>
11731                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11732                     <context link="fieldset" field="owning_lib"/>
11733                 </update>
11734                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11735                     <context link="fieldset" field="owning_lib"/>
11736                 </delete>
11737                         </actions>
11738                 </permacrud>
11739         </class>
11740
11741     <class id="aufhl" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_loops" oils_persist:tablename="action.unfulfilled_hold_loops" oils_persist:readonly="true">
11742         <fields>
11743             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11744             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11745             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11746         </fields>
11747                 <links>
11748                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11749                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11750                 </links>
11751     </class>
11752
11753     <class id="aufhml" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_min_loop" oils_persist:tablename="action.unfulfilled_hold_min_loop" oils_persist:readonly="true">
11754         <fields>
11755             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11756             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11757         </fields>
11758                 <links>
11759                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11760                 </links>
11761     </class>
11762
11763     <class id="aufhil" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_innermost_loop" oils_persist:tablename="action.unfulfilled_hold_innermost_loop" oils_persist:readonly="true">
11764         <fields>
11765             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11766             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11767             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11768         </fields>
11769                 <links>
11770                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11771                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11772                 </links>
11773     </class>
11774
11775     <class id="aufhmxl" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_max_loop" oils_persist:tablename="action.unfulfilled_hold_max_loop" oils_persist:readonly="true">
11776         <fields>
11777             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11778             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11779         </fields>
11780                 <links>
11781                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11782                 </links>
11783     </class>
11784
11785     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11786                 <oils_persist:source_definition><![CDATA[
11787
11788             SELECT  DISTINCT l.*
11789               FROM  action.unfulfilled_hold_loops l
11790                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11791               WHERE l.count = m.max
11792
11793                 ]]></oils_persist:source_definition>
11794         <fields>
11795             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11796             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11797             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11798         </fields>
11799                 <links>
11800                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11801                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11802                 </links>
11803     </class>
11804
11805         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11806                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11807                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11808                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11809                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11810                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11811                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11812                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11813                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11814                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11815                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11816                 </fields>
11817                 <links>
11818                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11819                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11820                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11821                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11822                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11823                 </links>
11824         </class>
11825
11826         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11827                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11828                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11829                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11830                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11831                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11832                 </fields>
11833                 <links>
11834                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11835                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11836                 </links>
11837         </class>
11838
11839         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11840                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11841                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11842                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11843                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11844                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11845                 </fields>
11846                 <links>
11847                 </links>
11848         </class>
11849
11850         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11851                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11852                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11853                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11854                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11855                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11856                 </fields>
11857                 <links>
11858                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11859                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11860                 </links>
11861         </class>
11862         
11863         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11864                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11865                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11866                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11867                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11868                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11869                 </fields>
11870                 <links>
11871                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11872                 </links>
11873         </class>
11874         
11875         <class id="qfpd" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_param_def" oils_persist:tablename="query.function_param_def" reporter:label="Function Parameter Definition">
11876                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11877                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11878                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11879                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11880                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11881                 </fields>
11882                 <links>
11883                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11884                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11885                 </links>
11886         </class>
11887
11888         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11889                 <fields oils_persist:primary="name">
11890                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11891                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11892                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11893                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11894                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11895                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11896                 </fields>
11897                 <links>
11898                 </links>
11899         </class>
11900
11901         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11902                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11903                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11904                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11905                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11906                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11907                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11908                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11909                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11910                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11911                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11912                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11913                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11914                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11915                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11916                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11917                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11918                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11919                 </fields>
11920                 <links>
11921                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11922                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11923                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11924                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11925                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11926                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11927                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11928                 </links>
11929         </class>
11930
11931         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11932                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11933                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11934                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11935                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11936                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11937                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
11938                 </fields>
11939                 <links>
11940                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11941                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11942                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11943                 </links>
11944         </class>
11945
11946         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11947                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11948                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11949                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
11950                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11951                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11952                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11953                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11954                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11955                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11956                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11957                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11958                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11959                 </fields>
11960                 <links>
11961                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11962                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11963                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11964                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11965                 </links>
11966         </class>
11967
11968         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11969                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11970                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11971                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
11972                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11973                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11974                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
11975                 </fields>
11976                 <links>
11977                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
11978                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
11979                 </links>
11980         </class>
11981
11982         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
11983                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
11984                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
11985                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11986                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11987                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11988                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
11989                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
11990                 </fields>
11991                 <links>
11992                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11993                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11994                 </links>
11995         </class>
11996
11997         <class id="qobi" controller="open-ils.cstore" oils_obj:fieldmapper="query::order_by_item" oils_persist:tablename="query.order_by_item" reporter:label="Order By Item">
11998                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
11999                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12000                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12001                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12002                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12003                 </fields>
12004                 <links>
12005                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12006                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12007                 </links>
12008         </class>
12009
12010         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12011                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12012                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12013                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12014                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12015                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12016                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12017                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12018                 </fields>
12019                 <links>
12020                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12021                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12022                 </links>
12023         </class>
12024
12025         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12026                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12027                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12028                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12029                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12030                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12031                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12032                 </fields>
12033                 <links>
12034                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12035                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12036                 </links>
12037         </class>
12038
12039         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12040                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12041                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12042                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12043                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12044                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12045                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12046                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12047                 </fields>
12048                 <links>
12049                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12050                 </links>
12051         </class>
12052
12053         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12054                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12055                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12056                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12057                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12058                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12059                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12060                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12061                 </fields>
12062                 <links>
12063                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12064                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12065                 </links>
12066         </class>
12067
12068         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12069                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12070                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12071                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12072                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12073                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12074                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12075                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12076                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12077                 </fields>
12078                 <links>
12079                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12080                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12081                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12082                 </links>
12083         </class>
12084
12085         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12086                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12087                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12088                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12089                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12090                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12091                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12092                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12093                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12094                 </fields>
12095                 <links>
12096                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12097                 </links>
12098         </class>
12099
12100         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12101                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12102                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12103                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12104                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12105                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12106                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12107                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12108                 </fields>
12109                 <links>
12110                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12111                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12112                 </links>
12113         </class>
12114
12115         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12116                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12117                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12118                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12119                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12120                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12121                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12122                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12123                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12124                 </fields>
12125                 <links>
12126                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12127                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12128                 </links>
12129         </class>
12130
12131         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12132                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12133                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12134                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12135                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12136                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12137                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12138                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12139                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12140                 </fields>
12141                 <links>
12142                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12143                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12144                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12145                 </links>
12146         </class>
12147
12148         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12149                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12150                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12151                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12152                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12153                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12154                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12155                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12156                 </fields>
12157                 <links>
12158                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12159                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12160                 </links>
12161         </class>
12162
12163         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12164                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12165                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12166                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12167                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12168                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12169                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12170                 </fields>
12171                 <links>
12172                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12173                 </links>
12174         </class>
12175
12176         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12177                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12178                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12179                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12180                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12181                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12182                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12183                 </fields>
12184                 <links>
12185                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12186                 </links>
12187         </class>
12188
12189         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12190                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12191                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12192                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12193                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12194                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12195                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12196                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12197                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12198                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12199                 </fields>
12200                 <links>
12201                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12202                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12203                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12204                 </links>
12205         </class>
12206
12207         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12208                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12209                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12210                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12211                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12212                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12213                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12214                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12215                 </fields>
12216                 <links>
12217                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12218                 </links>
12219         </class>
12220
12221         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12222                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12223                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12224                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12225                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12226                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12227                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12228                 </fields>
12229                 <links>
12230                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12231                 </links>
12232         </class>
12233
12234         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12235                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12236                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12237                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12238                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12239                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12240                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12241                 </fields>
12242                 <links>
12243                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12244                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12245                 </links>
12246         </class>
12247
12248         <class id="bmpc" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::marc21_physical_characteristics" oils_persist:tablename="biblio.marc21_physical_characteristics" reporter:label="MARC21 Physical Characteristics" oils_persist:field_safe="true" oils_persist:readonly="true">
12249                 <fields oils_persist:primary="id">
12250                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12251                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12252                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12253                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12254                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12255                 </fields>
12256                 <links>
12257                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12258                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12259                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12260                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12261                 </links>
12262         </class>
12263
12264         <class id="cmfpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_ff_pos_map" oils_persist:tablename="config.marc21_ff_pos_map" reporter:label="MARC21 Fixed Field Map" oils_persist:field_safe="true">
12265                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12266                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12267                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12268                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12269                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12270                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12271                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12272                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12273                 </fields>
12274                 <links/>
12275                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12276                         <actions>
12277                                 <retrieve/>
12278                         </actions>
12279                 </permacrud>
12280         </class>
12281
12282         <class id="cmpctm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_type_map" oils_persist:tablename="config.marc21_physical_characteristic_type_map" reporter:label="MARC21 Physical Characteristic Type Map" oils_persist:field_safe="true">
12283                 <fields oils_persist:primary="ptype_key">
12284                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12285                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12286                 </fields>
12287                 <links/>
12288                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12289                         <actions>
12290                                 <retrieve/>
12291                         </actions>
12292                 </permacrud>
12293         </class>
12294
12295         <class id="cmpcsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_subfield_map" oils_persist:tablename="config.marc21_physical_characteristic_subfield_map" reporter:label="MARC21 Physical Characteristic Subfield Map" oils_persist:field_safe="true">
12296                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12297                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12298                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12299                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12300                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12301                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12302                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12303                 </fields>
12304                 <links>
12305                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12306                 </links>
12307                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12308                         <actions>
12309                                 <retrieve/>
12310                         </actions>
12311                 </permacrud>
12312         </class>
12313
12314         <class id="cmpcvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_value_map" oils_persist:tablename="config.marc21_physical_characteristic_value_map" reporter:label="MARC21 Physical Characteristic Value Map" oils_persist:field_safe="true">
12315                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12316                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12317                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12318                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12319                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12320                 </fields>
12321                 <links>
12322                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12323                 </links>
12324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12325                         <actions>
12326                                 <retrieve/>
12327                         </actions>
12328                 </permacrud>
12329         </class>
12330
12331     <class
12332         id="uvs"
12333         controller="open-ils.cstore open-ils.pcrud"
12334         oils_obj:fieldmapper="url_verify::session"
12335         oils_persist:tablename="url_verify.session"
12336         reporter:label="URL Verification Session"
12337     >
12338         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12339             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12340             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12341                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12342             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12343             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12344             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12345             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12346             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12347             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12348         </fields>
12349
12350         <links>
12351             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12352             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12353             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12354             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12355             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12356         </links>
12357
12358         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12359             <actions>
12360                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12361             </actions>
12362         </permacrud>
12363
12364     </class>
12365
12366     <class id="uvsbrem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session_biblio_record_entry_map" oils_persist:readonly="true" reporter:label="URL Verify Session Biblio Record Entry Map">
12367         <oils_persist:source_definition><![CDATA[
12368             SELECT
12369                 cbrebi.id AS id,  -- so we can have a pkey in our view
12370                 uvs.id AS session,
12371                 uvs.owning_lib,
12372                 cbrebi.target_biblio_record_entry
12373             FROM url_verify.session uvs
12374             JOIN container.biblio_record_entry_bucket cbreb
12375                 ON (uvs.container = cbreb.id)
12376             JOIN container.biblio_record_entry_bucket_item cbrebi
12377                 ON (cbrebi.bucket = cbreb.id)
12378         ]]></oils_persist:source_definition>
12379         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12380             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12381             <field reporter:label="Session" name="session" reporter:datatype="link" />
12382             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12383             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12384         </fields>
12385         <links>
12386             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12387             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12388             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12389         </links>
12390         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12391             <actions>
12392                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12393             </actions>
12394         </permacrud>
12395     </class>
12396
12397     <class
12398         id="uvus"
12399         controller="open-ils.cstore open-ils.pcrud"
12400         oils_obj:fieldmapper="url_verify::url_selector"
12401         oils_persist:tablename="url_verify.url_selector"
12402         reporter:label="URL Verification URL Selector"
12403     >
12404         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12405             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12406             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12407                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12408             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12409         </fields>
12410
12411         <links>
12412             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12413             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12414         </links>
12415
12416         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12417             <actions>
12418                 <create permission="URL_VERIFY">
12419                     <context link="session" field="owning_lib"/>
12420                 </create>
12421                 <retrieve permission="URL_VERIFY">
12422                     <context link="session" field="owning_lib"/>
12423                 </retrieve>
12424                 <update permission="URL_VERIFY">
12425                     <context link="session" field="owning_lib"/>
12426                 </update>
12427                 <delete permission="URL_VERIFY">
12428                     <context link="session" field="owning_lib"/>
12429                 </delete>
12430             </actions>
12431         </permacrud>
12432
12433     </class>
12434
12435     <class
12436         id="uvu"
12437         controller="open-ils.cstore open-ils.pcrud"
12438         oils_obj:fieldmapper="url_verify::url"
12439         oils_persist:tablename="url_verify.url"
12440         reporter:label="URL Verification URL"
12441     >
12442         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12443             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12444                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12445                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12446                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12447                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12448             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12449             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12450             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12451             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12452             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12453             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12454             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12455             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12456             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12457             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12458             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12459             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12460             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12461         </fields>
12462
12463         <links>
12464             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12465             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12466             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12467             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12468             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12469         </links>
12470
12471         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12472             <actions>
12473                 <create permission="URL_VERIFY">
12474                     <context link="session" field="owning_lib"/>
12475                 </create>
12476                 <retrieve permission="URL_VERIFY">
12477                     <context link="session" field="owning_lib"/>
12478                 </retrieve>
12479                 <update permission="URL_VERIFY">
12480                     <context link="session" field="owning_lib"/>
12481                 </update>
12482                 <delete permission="URL_VERIFY">
12483                     <context link="session" field="owning_lib"/>
12484                 </delete>
12485             </actions>
12486         </permacrud>
12487
12488     </class>
12489
12490     <class
12491         id="uvva"
12492         controller="open-ils.cstore open-ils.pcrud"
12493         oils_obj:fieldmapper="url_verify::verification_attempt"
12494         oils_persist:tablename="url_verify.verification_attempt"
12495         reporter:label="URL Verification Attempt"
12496     >
12497         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12498             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12499                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12500                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12501             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12502             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12503         </fields>
12504
12505         <links>
12506             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12507             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12508         </links>
12509
12510         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12511             <actions>
12512                 <create permission="URL_VERIFY">
12513                     <context link="session" field="owning_lib"/>
12514                 </create>
12515                 <retrieve permission="URL_VERIFY">
12516                     <context link="session" field="owning_lib"/>
12517                 </retrieve>
12518                 <update permission="URL_VERIFY">
12519                     <context link="session" field="owning_lib"/>
12520                 </update>
12521                 <delete permission="URL_VERIFY">
12522                     <context link="session" field="owning_lib"/>
12523                 </delete>
12524             </actions>
12525         </permacrud>
12526
12527     </class>
12528
12529     <class
12530         id="uvuv"
12531         controller="open-ils.cstore open-ils.pcrud"
12532         oils_obj:fieldmapper="url_verify::url_verification"
12533         oils_persist:tablename="url_verify.url_verification"
12534         reporter:label="URL Verification"
12535     >
12536         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12537             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12538                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12539                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12540             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12541             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12542             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12543             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12544                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12545         </fields>
12546
12547         <links>
12548             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12549             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12550             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12551         </links>
12552
12553         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12554             <actions>
12555                 <create permission="URL_VERIFY">
12556                     <context link="attempt" jump="session" field="owning_lib"/>
12557                 </create>
12558                 <retrieve permission="URL_VERIFY">
12559                     <context link="attempt" jump="session" field="owning_lib"/>
12560                 </retrieve>
12561                 <update permission="URL_VERIFY">
12562                     <context link="attempt" jump="session" field="owning_lib"/>
12563                 </update>
12564                 <delete permission="URL_VERIFY">
12565                     <context link="attempt" jump="session" field="owning_lib"/>
12566                 </delete>
12567             </actions>
12568         </permacrud>
12569
12570     </class>
12571
12572         <class
12573                 id="cfdi"
12574                 controller="open-ils.cstore open-ils.pcrud"
12575                 oils_obj:fieldmapper="config::filter_dialog_interface"
12576                 oils_persist:tablename="config.filter_dialog_interface"
12577                 reporter:label="FilterDialog Interface">
12578                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12579                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12580                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12581                 </fields>
12582                 <links>
12583                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12584                 </links>
12585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12586                         <actions>
12587                                 <retrieve />
12588                         </actions>
12589                 </permacrud>
12590         </class>
12591
12592         <class
12593                 id="cfdfs"
12594                 controller="open-ils.cstore open-ils.pcrud"
12595                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12596                 oils_persist:tablename="config.filter_dialog_filter_set"
12597                 reporter:label="FilterDialog Filter Set">
12598                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12599                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12600                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12601                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12602                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12603                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12604                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12605                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12606                 </fields>
12607                 <links>
12608                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12609                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12610                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12611                 </links>
12612                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12613                         <actions>
12614                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12615                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12616                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12617                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12618                         </actions>
12619                 </permacrud>
12620
12621         </class>
12622
12623         <class id="cmrtm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_rec_type_map" oils_persist:tablename="config.marc21_rec_type_map" reporter:label="MARC21 Record Type Map" oils_persist:field_safe="true">
12624                 <fields oils_persist:primary="code">
12625                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12626                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12627                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12628                 </fields>
12629                 <links/>
12630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12631                         <actions>
12632                                 <retrieve/>
12633                         </actions>
12634                 </permacrud>
12635         </class>
12636
12637         <class id="rlcd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_copy_deleted" oils_persist:readonly="true" reporter:core="true" reporter:label="Last Copy Delete Time">
12638                 <oils_persist:source_definition><![CDATA[
12639
12640             SELECT  b.id,
12641                     MAX(dcp.edit_date) AS last_delete_date
12642              FROM   biblio.record_entry b
12643                     JOIN asset.call_number cn ON (cn.record = b.id)
12644                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12645              WHERE  NOT b.deleted
12646              GROUP BY b.id
12647              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12648
12649                 ]]></oils_persist:source_definition>
12650                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12651                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12652                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12653                 </fields>
12654                 <links>
12655                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12656                 </links>
12657                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12658                         <actions>
12659                                 <retrieve/>
12660                         </actions>
12661                 </permacrud>
12662         </class>
12663
12664         <class id="jubstlbl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::li_state_label" oils_persist:tablename="acq.li_state_label" oils_persist:readonly="true" reporter:label="Line Item State Labels" oils_persist:field_safe="true">
12665                 <fields oils_persist:primary="id">
12666                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12667                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12668                 </fields>
12669                 <links/>
12670                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12671                         <actions>
12672                                 <retrieve/>
12673                         </actions>
12674                 </permacrud>
12675         </class>
12676
12677         <class id="acqpostlbl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_state_label" oils_persist:tablename="acq.po_state_label" oils_persist:readonly="true" reporter:label="PO State Labels">
12678                 <fields oils_persist:primary="id">
12679                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12680                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12681                 </fields>
12682                 <links/>
12683                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12684                         <actions>
12685                                 <retrieve/>
12686                         </actions>
12687                 </permacrud>
12688         </class>
12689
12690
12691         <class id="rhcrpb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib" oils_persist:readonly="true" reporter:core="true" reporter:label="Hold/Copy Ratio per Bib">
12692                 <oils_persist:source_definition><![CDATA[
12693                 SELECT
12694                     x.id,
12695                     COALESCE( y.copy_count, 0 ) AS copy_count,
12696                     x.hold_count AS hold_count,
12697                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12698                 FROM
12699                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12700                         FROM
12701                             action.hold_request ahr
12702                             JOIN reporter.hold_request_record rhrr USING (id)
12703                         WHERE
12704                             ahr.cancel_time IS NULL
12705                             AND ahr.fulfillment_time IS NULL
12706                         GROUP BY bib_record
12707                     )x
12708                     JOIN
12709                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12710                         FROM
12711                             action.hold_request ahr
12712                             JOIN reporter.hold_request_record rhrr USING (id)
12713                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12714                         WHERE
12715                             ahr.cancel_time IS NULL
12716                             AND ahr.fulfillment_time IS NULL
12717                             AND ahr.capture_time IS NULL
12718                             AND ahr.frozen IS FALSE
12719                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12720                             AND ahr.hold_type != 'M'
12721                            GROUP BY bib_record
12722                     )y
12723                     USING (id)
12724                 ]]></oils_persist:source_definition>
12725                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12726                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12727                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12728                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12729                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12730                 </fields>
12731                 <links>
12732                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12733                 </links>
12734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12735                         <actions>
12736                                 <retrieve/>
12737                         </actions>
12738                 </permacrud>
12739         </class>
12740
12741         <class id="rhcrpbap" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library">
12742                 <oils_persist:source_definition><![CDATA[
12743             SELECT *,
12744                 CASE WHEN copy_count_at_pickup_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_pickup_library::FLOAT/copy_count_at_pickup_library END AS pickup_library_ratio,
12745                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12746             FROM
12747                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12748                     FROM
12749                         action.hold_request ahr
12750                         JOIN reporter.hold_request_record rhrr USING (id)
12751                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12752                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12753                     WHERE
12754                         ahr.cancel_time IS NULL
12755                         AND ahr.fulfillment_time IS NULL
12756                     GROUP BY bib_record, pickup_lib
12757                 )x
12758                 JOIN
12759                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12760                     FROM
12761                         action.hold_request ahr
12762                         JOIN reporter.hold_request_record rhrr USING (id)
12763                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12764                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12765                     WHERE
12766                         ahr.cancel_time IS NULL
12767                         AND ahr.fulfillment_time IS NULL
12768                         AND ahr.capture_time IS NULL
12769                         AND ahr.frozen IS FALSE
12770                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12771                         AND ahr.hold_type != 'M'
12772                     GROUP BY bib_record, pickup_lib
12773                 )y
12774                 USING(id,pickup_lib)
12775                 JOIN
12776                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12777                     FROM
12778                         action.hold_request ahr
12779                         JOIN reporter.hold_request_record rhrr USING (id)
12780                     WHERE
12781                         ahr.cancel_time IS NULL
12782                         AND ahr.fulfillment_time IS NULL
12783                     GROUP BY bib_record
12784                 )z
12785                 USING (id)
12786                 JOIN
12787                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12788                     FROM
12789                         action.hold_request ahr
12790                         JOIN reporter.hold_request_record rhrr USING (id)
12791                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12792                     WHERE
12793                         ahr.cancel_time IS NULL
12794                         AND ahr.fulfillment_time IS NULL
12795                         AND ahr.capture_time IS NULL
12796                         AND ahr.frozen IS FALSE
12797                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12798                         AND ahr.hold_type != 'M'
12799                         GROUP BY bib_record
12800                 )u
12801                 USING (id)
12802                 ]]></oils_persist:source_definition>
12803                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12804                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12805                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12806                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12807                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12808                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12809                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12810                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12811                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12812                 </fields>
12813                 <links>
12814                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12815                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12816                 </links>
12817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12818                         <actions>
12819                                 <retrieve/>
12820                         </actions>
12821                 </permacrud>
12822         </class>
12823
12824         <class id="rhcrpbah" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_home" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Home Library">
12825                 <oils_persist:source_definition><![CDATA[
12826             SELECT *,
12827                 CASE WHEN copy_count_at_home_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_home_library::FLOAT/copy_count_at_home_library END AS home_library_ratio,
12828                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12829             FROM
12830                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12831                     FROM
12832                         action.hold_request ahr
12833                         JOIN actor.usr au ON (ahr.usr = au.id)
12834                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12835                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12836                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12837                     WHERE
12838                         ahr.cancel_time IS NULL
12839                         AND ahr.fulfillment_time IS NULL
12840                     GROUP BY bib_record, home_ou
12841                 )x
12842                 JOIN
12843                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12844                     FROM
12845                         action.hold_request ahr
12846                         JOIN actor.usr au ON (ahr.usr = au.id)
12847                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12848                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12849                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12850                     WHERE
12851                         ahr.cancel_time IS NULL
12852                         AND ahr.fulfillment_time IS NULL
12853                         AND ahr.capture_time IS NULL
12854                         AND ahr.frozen IS FALSE
12855                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12856                         AND ahr.hold_type != 'M'
12857                     GROUP BY bib_record, home_ou
12858                 )y
12859                 USING (id,home_ou)
12860                 JOIN
12861                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12862                     FROM
12863                         action.hold_request ahr
12864                         JOIN reporter.hold_request_record rhrr USING (id)
12865                     WHERE
12866                         ahr.cancel_time IS NULL
12867                         AND ahr.fulfillment_time IS NULL
12868                     GROUP BY bib_record
12869                 )z
12870                 USING (id)
12871                 JOIN
12872                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12873                     FROM
12874                         action.hold_request ahr
12875                         JOIN reporter.hold_request_record rhrr USING (id)
12876                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12877                     WHERE
12878                         ahr.cancel_time IS NULL
12879                         AND ahr.fulfillment_time IS NULL
12880                         AND ahr.capture_time IS NULL
12881                         AND ahr.frozen IS FALSE
12882                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12883                         AND ahr.hold_type != 'M'
12884                     GROUP BY bib_record
12885                 )u
12886                 USING (id)
12887         ]]></oils_persist:source_definition>
12888         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12889                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12890                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12891                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12892                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12893                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12894                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12895                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12896                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12897         </fields>
12898         <links>
12899                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12900                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12901         </links>
12902         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12903                 <actions>
12904                         <retrieve/>
12905                 </actions>
12906         </permacrud>
12907 </class>
12908
12909         <class id="rhcrpbapd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup_desc" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library (and Descendants) ">
12910                 <oils_persist:source_definition><![CDATA[
12911                 WITH counts_at_ou AS (
12912                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12913                 FROM
12914                     (SELECT rhrr.bib_record AS id,
12915                             aou.id AS pickup_lib_or_desc,
12916                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12917                        FROM actor.org_unit aou
12918                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12919                             action.hold_request ahr
12920                             JOIN reporter.hold_request_record rhrr USING (id)
12921                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12922                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12923                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12924                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12925                             AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
12926                       GROUP BY 1, 2
12927                 ) a
12928                 JOIN
12929                     (SELECT rhrr.bib_record AS id,
12930                             aou.id AS pickup_lib_or_desc,
12931                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12932                        FROM actor.org_unit aou
12933                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12934                             action.hold_request ahr
12935                             JOIN reporter.hold_request_record rhrr USING (id)
12936                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12937                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12938                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12939                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12940                             AND ahr.hold_type != 'M'
12941                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12942                             AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
12943                       GROUP BY 1, 2
12944                 ) b
12945                 USING (id,pickup_lib_or_desc)
12946             )
12947             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
12948                    y.holds_everywhere, z.copy_count_everywhere,
12949                 CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE x.holds_at_or_below::FLOAT/x.copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
12950                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
12951             FROM counts_at_ou x
12952                 JOIN
12953                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12954                     FROM
12955                         action.hold_request ahr
12956                         JOIN reporter.hold_request_record rhrr USING (id)
12957                     WHERE
12958                         ahr.cancel_time IS NULL
12959                         AND ahr.fulfillment_time IS NULL
12960                     GROUP BY bib_record
12961                 )y
12962                 USING (id)
12963                 JOIN
12964                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12965                     FROM
12966                         action.hold_request ahr
12967                         JOIN reporter.hold_request_record rhrr USING (id)
12968                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12969                     WHERE
12970                         ahr.cancel_time IS NULL
12971                         AND ahr.fulfillment_time IS NULL
12972                         AND ahr.capture_time IS NULL
12973                         AND ahr.frozen IS FALSE
12974                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12975                         AND ahr.hold_type != 'M'
12976                         GROUP BY bib_record
12977                 )z
12978                 USING (id)
12979                 ]]></oils_persist:source_definition>
12980                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12981                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12982                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
12983                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
12984                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
12985                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12986                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12987                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
12988                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12989                 </fields>
12990                 <links>
12991                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12992                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
12993                 </links>
12994                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12995                         <actions>
12996                                 <retrieve/>
12997                         </actions>
12998                 </permacrud>
12999         </class>
13000
13001         <class id="rlc" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_circ_date" oils_persist:readonly="true" reporter:label="Last Circulation or Creation Date">
13002                 <oils_persist:source_definition><![CDATA[
13003             SELECT
13004                 ac.id,
13005                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13006                 MAX(actac.xact_start) AS last_circ
13007             FROM asset.copy ac
13008                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13009             GROUP BY ac.id
13010
13011             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13012             --SELECT
13013             --    ac.id,
13014             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13015             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13016             --FROM asset.copy ac
13017             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13018             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13019             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13020                 ]]></oils_persist:source_definition>
13021                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13022                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13023                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13024                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13025                 </fields>
13026                 <links>
13027                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13028                 </links>
13029                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13030                         <actions>
13031                                 <retrieve/>
13032                         </actions>
13033                 </permacrud>
13034         </class>
13035
13036         <class id="ctcl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ts_config_list" oils_persist:tablename="config.ts_config_list" reporter:label="Text Search Configs">
13037                 <fields oils_persist:primary="id">
13038                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13039                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13040                 </fields>
13041                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13042                         <actions>
13043                                 <retrieve/>
13044                         </actions>
13045                 </permacrud>
13046         </class>
13047
13048         <class id="cmcts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class_ts_map" oils_persist:tablename="config.metabib_class_ts_map" reporter:label="Metabib Class TS Map">
13049                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13050                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13051                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13052                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13053                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13054                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13055                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13056                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13057                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13058                 </fields>
13059                 <links>
13060                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13061                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13062                 </links>
13063                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13064                         <actions>
13065                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13066                                 <retrieve/>
13067                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13068                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13069                         </actions>
13070                 </permacrud>
13071         </class>
13072
13073         <class id="cmfts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_ts_map" oils_persist:tablename="config.metabib_field_ts_map" reporter:label="Metabib Field TS Map">
13074                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13075                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13076                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13077                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13078                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13079                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13080                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13081                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13082                 </fields>
13083                 <links>
13084                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13085                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13086                 </links>
13087                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13088                         <actions>
13089                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13090                                 <retrieve/>
13091                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13092                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13093                         </actions>
13094                 </permacrud>
13095         </class>
13096
13097
13098         <!-- ********************************************************************************************************************* -->
13099         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13100         <!-- ********************************************************************************************************************* -->
13101         <class id="rccc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_circ" oils_persist:tablename="reporter.classic_current_circ" reporter:core="true" reporter:label="Classic Circulation View">
13102                 <fields oils_persist:primary="id">
13103                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13104                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13105                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13106                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13107                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13108                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13109                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13110                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13111                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13112                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13113                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13114                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13115                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13116                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13117                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13118                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13119                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13120                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13121                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13122                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13123                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13124                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13125                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13126                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13127                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13128                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13129                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13130                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13131                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13132                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13133                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13134                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13135                 </fields>
13136                 <links>
13137                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13138                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13139                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13140                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13141                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13142                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13143                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13144                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13145                 </links>
13146         </class>
13147
13148         <class id="rsce1" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::legacy_cat1" oils_persist:tablename="reporter.legacy_cat1" reporter:label="CAT1 Entry">
13149                 <fields oils_persist:primary="id">
13150                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13151                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13152                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13153                 </fields>
13154                 <links>
13155                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13156                 </links>
13157         </class>
13158
13159         <class id="rsce2" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::legacy_cat2" oils_persist:tablename="reporter.legacy_cat2" reporter:label="CAT2 Entry">
13160                 <fields oils_persist:primary="id">
13161                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13162                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13163                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13164                 </fields>
13165                 <links>
13166                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13167                 </links>
13168         </class>
13169
13170         <class id="rccbs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_billing_summary" oils_persist:tablename="reporter.classic_current_billing_summary" reporter:core="true" reporter:label="Classic Open Transaction Summary">
13171                 <fields oils_persist:primary="id">
13172                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13173
13174                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13175                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13176                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13177
13178                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13179                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13180                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13181
13182                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13183                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13184
13185                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13186                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13187                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13188
13189                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13190                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13191
13192                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13193                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13194                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13195
13196                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13197                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13198                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13199
13200                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13201                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13202                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13203                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13204
13205                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13206                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13207
13208                 </fields>
13209                 <links>
13210                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13211                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13212                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13213                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13214                 </links>
13215         </class>
13216
13217         <class id="acrlid" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_ready_lineitem_detail" oils_persist:readonly="true" reporter:label="Claim Ready Lineitem Details">
13218                 <oils_persist:source_definition><![CDATA[
13219
13220             SELECT
13221                 po.ordering_agency AS ordering_agency,
13222                 po.id AS purchase_order,
13223                 li.id AS lineitem,
13224                 lid.id AS lineitem_detail,
13225                 cpa.id AS claim_policy_action
13226             FROM
13227                 acq.lineitem_detail lid
13228                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13229                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13230                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13231                 JOIN acq.claim_policy_action cpa ON (
13232                     cpa.claim_policy = cp.id
13233
13234                     -- we only care about claim policy actions whose claim
13235                     -- interval we'd reached or exceeded
13236                     AND (NOW() - cpa.action_interval) > po.order_date
13237
13238                     -- filter out all claim policy actions where claim events
13239                     -- have occurred on or after the action's action_interval
13240                     AND NOT EXISTS (
13241                         SELECT 1
13242                         FROM
13243                             acq.claim_event evt
13244                             JOIN acq.claim claim ON (
13245                                 claim.id = evt.claim
13246                                 AND claim.lineitem_detail = lid.id
13247                             )
13248                         WHERE
13249                             evt.event_date >= (po.order_date + cpa.action_interval)
13250                     )
13251                 )
13252             WHERE
13253                 lid.cancel_reason IS NULL
13254                 AND li.cancel_reason IS NULL -- belt/suspenders
13255                 AND po.cancel_reason IS NULL -- belt/suspenders
13256                 AND lid.recv_time IS NULL
13257                 AND po.state = 'on-order'
13258             ORDER BY 1, 2, 3, 4, 5
13259
13260                 ]]></oils_persist:source_definition>
13261                 <fields>
13262                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13263                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13264                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13265                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13266                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13267                 </fields>
13268                 <links>
13269                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13270                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13271                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13272                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13273                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13274                 </links>
13275         </class>
13276         <class id="acqlisum" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary" oils_persist:readonly="true" reporter:label="Lineitem Summary" oils_persist:tablename="acq.lineitem_summary">
13277                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13278                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13279                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13280                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13281                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13282                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13283                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13284                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13285                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13286                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13287                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13288                 </fields>
13289                 <links>
13290                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13291                 </links>
13292     </class>
13293         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13294                 <oils_persist:source_definition><![CDATA[
13295             SELECT * FROM acq.lineitem_summary 
13296                                 WHERE item_count > (invoice_count + cancel_count)
13297         ]]></oils_persist:source_definition>
13298                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13299                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13300                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13301                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13302                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13303                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13304                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13305                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13306                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13307                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13308                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13309                 </fields>
13310                 <links>
13311                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13312                 </links>
13313     </class>
13314         <class id="iatc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::intersystem_transit_copy" oils_persist:readonly="true" reporter:core="true" reporter:label="Inter-system Copy Transit">
13315                 <oils_persist:source_definition><![CDATA[
13316
13317                         SELECT  t.*
13318                           FROM  action.transit_copy t
13319                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13320                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13321                           WHERE s.parent_ou <> d.parent_ou
13322
13323                 ]]></oils_persist:source_definition>
13324                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13325                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13326                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13327                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13328                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13329                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13330                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13331                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13332                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13333                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13334                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13335                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13336                 </fields>
13337                 <links>
13338                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13339                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13340                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13341                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13342                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13343                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13344                 </links>
13345         </class>
13346
13347     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13348                 <oils_persist:source_definition><![CDATA[
13349
13350         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13351                 SELECT
13352                         cp.id as copy,
13353                         COUNT(circ.id),
13354                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13355                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13356                 FROM
13357                         asset.copy cp
13358                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13359                 GROUP BY 1, 3, 4
13360                 UNION ALL
13361                 SELECT
13362                         cp.id as copy,
13363                         COUNT(circ.id),
13364                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13365                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13366                 FROM
13367                         asset.copy cp
13368                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13369                 GROUP BY 1, 3, 4
13370                 UNION ALL
13371                 SELECT
13372                         id as copy,
13373                         circ_count,
13374                         -1 AS year,
13375                         false as is_renewal
13376                 FROM
13377                         extend_reporter.legacy_circ_count
13378         )x GROUP BY 1, 3, 4
13379
13380                 ]]></oils_persist:source_definition>
13381         <fields>
13382             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13383             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13384             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13385             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13386         </fields>
13387                 <links>
13388                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13389                 </links>
13390                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13391                         <actions>
13392                                 <retrieve/>
13393                         </actions>
13394                 </permacrud>
13395     </class>
13396
13397         <class id="rodcirc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::overdue_circs" oils_persist:tablename="reporter.overdue_circs" reporter:core="true" reporter:label="Overdue Circulation">
13398                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13399                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13400                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13401                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13402                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13403                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13404                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13405                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13406                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13407                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13408                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13409                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13410                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13411                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13412                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13413                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13414                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13415                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13416                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13417                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13418                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13419                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13420                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13421                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13422                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13423                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13424                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13425                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13426                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13427                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13428                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13429                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13430                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13431                 </fields>
13432                 <links>
13433                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13434                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13435                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13436                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13437                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13438                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13439                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13440                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13441                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13442                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13443                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13444                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13445                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13446                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13447                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13448                 </links>
13449         </class>
13450
13451     <class id="rocit" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_item_list" oils_persist:tablename="reporter.classic_item_list" reporter:core="true" reporter:label="Classic Item List">
13452         <fields oils_persist:primary="id">
13453             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13454             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13455             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13456             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13457             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13458             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13459             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13460             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13461             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13462             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13463             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13464             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13465             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13466             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13467             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13468             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13469             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13470             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13471             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13472             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13473             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13474             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13475             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13476             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13477             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13478             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13479             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13480             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13481             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13482             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13483             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13484             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13485             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13486             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13487         </fields>
13488         <links>
13489             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13490             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13491             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13492             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13493             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13494             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13495             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13496             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13497         </links>
13498     </class>
13499
13500     <class id="rmocbbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_owning_lib" oils_persist:tablename="money.open_circ_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Owning Library">
13501         <fields oils_persist:primary="id">
13502             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13503             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13504             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13505             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13506         </fields>
13507         <links>
13508             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13509             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13510         </links>
13511     </class>
13512
13513     <class id="rmobbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_owning_lib" oils_persist:tablename="money.open_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Owning Library">
13514         <fields oils_persist:primary="owning_lib">
13515             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13516             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13517             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13518         </fields>
13519         <links>
13520             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13521         </links>
13522     </class>
13523
13524     <class id="rmocbbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Circulating Library and Owning Library">
13525         <fields oils_persist:primary="id">
13526             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13527             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13528             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13529             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13530             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13531         </fields>
13532         <links>
13533             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13534             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13535             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13536         </links>
13537     </class>
13538
13539     <class id="rmobbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Circulating Library and Owning Library">
13540         <fields oils_persist:primary="circ_lib">
13541             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13542             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13543             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13544             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13545         </fields>
13546         <links>
13547             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13548             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13549         </links>
13550     </class>
13551
13552     <class id="rmocbbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by User Home Library and Owning Library">
13553         <fields oils_persist:primary="id">
13554             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13555             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13556             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13557             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13558             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13559         </fields>
13560         <links>
13561             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13562             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13563             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13564         </links>
13565     </class>
13566
13567     <class id="rmobbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by User Home Library and Owning Library">
13568         <fields oils_persist:primary="home_ou">
13569             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13570             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13571             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13572             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13573         </fields>
13574         <links>
13575             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13576             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13577         </links>
13578     </class>
13579         <class id="acqft" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_tag" oils_persist:tablename="acq.fund_tag" reporter:label="Fund Tag">
13580                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13581                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13582                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13583                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13584                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13585                 </fields>
13586                 <links>
13587                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13588                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13589                 </links>
13590                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13591                         <actions>
13592                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13593                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13594                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13595                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13596                         </actions>
13597                 </permacrud>
13598         </class>
13599         <class id="acqftm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_tag_map" oils_persist:tablename="acq.fund_tag_map" reporter:label="Fund Tag Map">
13600                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13601                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13602                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13603                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13604                 </fields>
13605                 <links>
13606                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13607                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13608                         </links>
13609                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13610                 <actions>
13611                                 <create permission="ADMIN_ACQ_FUND_TAG">
13612                                         <context link="tag" field="owner"/>
13613                                 </create>
13614                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13615                                         <context link="tag" field="owner"/>
13616                                 </retrieve>
13617                                 <update permission="ADMIN_ACQ_FUND_TAG">
13618                                         <context link="tag" field="owner"/>
13619                                 </update>
13620                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13621                                         <context link="tag" field="owner"/>
13622                                 </delete>
13623                         </actions>
13624                 </permacrud>
13625         </class>
13626         <class id="acqmapinv" controller="open-ils.cstore" oils_obj:fieldmapper="acq::map_to_invoice" reporter:label="Acq Map to Invoice View" oils_persist:readonly="true">
13627                 <oils_persist:source_definition><![CDATA[
13628                 SELECT
13629                         poi.purchase_order AS purchase_order,
13630                         ii.invoice AS invoice,
13631                         NULL AS lineitem,
13632                         poi.id AS po_item,
13633                         NULL AS picklist
13634                 FROM
13635                         acq.po_item poi
13636                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13637                 UNION SELECT
13638                         jub.purchase_order AS purchase_order,
13639                         ie.invoice AS invoice,
13640                         jub.id AS lineitem,
13641                         NULL AS po_item,
13642                         jub.picklist AS picklist
13643                 FROM
13644                         acq.lineitem jub
13645                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13646                 UNION SELECT
13647                         ii.purchase_order AS purchase_order,
13648                         ii.invoice AS invoice,
13649                         NULL AS lineitem,
13650                         NULL AS po_item,
13651                         NULL AS picklist
13652                 FROM
13653                         acq.invoice_item ii
13654                 WHERE ii.po_item IS NULL
13655                 UNION SELECT
13656                         ie.purchase_order AS purchase_order,
13657                         ie.invoice AS invoice,
13658                         NULL AS lineitem,
13659                         NULL AS po_item,
13660                         NULL AS picklist
13661                 FROM
13662                         acq.invoice_entry ie
13663                 WHERE ie.lineitem IS NULL
13664                 UNION SELECT
13665                         NULL AS purchase_order,
13666                         NULL AS invoice,
13667                         jub.id AS lineitem,
13668                         NULL AS po_item,
13669                         jub.picklist AS picklist
13670                 FROM
13671                         acq.lineitem jub
13672                 WHERE jub.purchase_order IS NULL
13673                 ]]></oils_persist:source_definition>
13674                 <fields>
13675                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13676                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13677                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13678                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13679                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13680                 </fields>
13681                 <links>
13682                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13683                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13684                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13685                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13686                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13687                 </links>
13688         </class>
13689         <class id="cbc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::barcode_completion" oils_persist:tablename="config.barcode_completion" reporter:label="Barcode Completions">
13690                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13691                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13692                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13693                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13694                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13695                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13696                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13697                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13698                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13699                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13700                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13701                 </fields>
13702                 <links>
13703                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13704                 </links>
13705                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13706                         <actions>
13707                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13708                                 <retrieve/>
13709                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13710                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13711                         </actions>
13712                 </permacrud>
13713         </class>
13714
13715         <class id="coustl" controller="open-ils.cstore" oils_obj:fieldmapper="config::org_unit_setting_type_log" oils_persist:tablename="config.org_unit_setting_type_log" reporter:label="Organizational Unit Setting Type Log">
13716                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13717                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13718                         <field name="date_applied" reporter:datatype="timestamp"/>
13719                         <field name="org" reporter:datatype="org_unit"/>
13720                         <field name="original_value" reporter:datatype="text"/>
13721                         <field name="new_value" reporter:datatype="text"/>
13722                         <field name="field_name" reporter:datatype="link"/>
13723                 </fields>
13724                 <links>
13725                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13726                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13727                 </links>
13728         </class>
13729         <class id="aaactsc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::archive_actor_stat_cat" oils_persist:tablename="action.archive_actor_stat_cat" reporter:label="Circ-Archived Patron Statistical Category Entries">
13730                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13731                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13732                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13733                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13734                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13735                 </fields>
13736                 <links>
13737                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13738                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13739                 </links>
13740         </class>
13741         <class id="aaasc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::archive_asset_stat_cat" oils_persist:tablename="action.archive_asset_stat_cat" reporter:label="Circ-Archived Copy Statistical Category Entries">
13742                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13743                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13744                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13745                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13746                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13747                 </fields>
13748                 <links>
13749                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13750                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13751                 </links>
13752         </class>
13753         <class id="cfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group" oils_persist:tablename="config.floating_group" reporter:label="Floating Group">
13754                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13755                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13756                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13757                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13758                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13759                 </fields>
13760                 <links>
13761                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13762                 </links>
13763                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13764                         <actions>
13765                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13766                                 <retrieve/>
13767                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13768                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13769                         </actions>
13770                 </permacrud>
13771         </class>
13772         <class id="cfgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group_member" oils_persist:tablename="config.floating_group_member" reporter:label="Floating Group Members">
13773                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13774                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13775                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13776                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13777                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13778                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13779                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13780                 </fields>
13781                 <links>
13782                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13783                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13784                 </links>
13785                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13786                         <actions>
13787                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13788                                 <retrieve/>
13789                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13790                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13791                         </actions>
13792                 </permacrud>
13793         </class>
13794         <class id="cctt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_tag_type" oils_persist:tablename="config.copy_tag_type" reporter:label="Copy Tag Types" oils_persist:field_safe="true">
13795                 <fields oils_persist:primary="code">
13796                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13797                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13798                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13799                 </fields>
13800                 <links>
13801                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13802                 </links>
13803                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13804                         <actions>
13805                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13806                                 <retrieve/>
13807                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13808                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13809                         </actions>
13810                 </permacrud>
13811         </class>
13812         <class id="acpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag" oils_persist:tablename="asset.copy_tag" reporter:label="Item Tags" oils_persist:field_safe="true">
13813                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13814                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13815                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13816                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13817                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13818                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13819                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13820                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13821                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13822                 </fields>
13823                 <links>
13824                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13825                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13826                 </links>
13827                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13828                         <actions>
13829                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13830                                 <retrieve/>
13831                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13832                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13833                         </actions>
13834                 </permacrud>
13835         </class>
13836         <class id="acptcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag_copy_map" oils_persist:tablename="asset.copy_tag_copy_map" reporter:label="Copy Tag Copy Map" oils_persist:field_safe="true">
13837                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13838                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13839                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13840                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13841                 </fields>
13842                 <links>
13843                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13844                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13845                 </links>
13846                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13847                         <actions>
13848                                 <create permission="UPDATE_COPY">
13849                     <context link="copy" field="circ_lib"/>
13850                 </create>
13851                                 <retrieve/>
13852                                 <update permission="UPDATE_COPY">
13853                     <context link="copy" field="circ_lib"/>
13854                 </update>
13855                                 <delete permission="UPDATE_COPY">
13856                     <context link="copy" field="circ_lib"/>
13857                 </delete>
13858                         </actions>
13859                 </permacrud>
13860         </class>
13861         <class id="hasholdscount" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::has_holds_count" reporter:label="Copy Has Holds Count" oils_persist:readonly="true">
13862         <oils_persist:source_definition><![CDATA[
13863         SELECT ahcm.target_copy AS id,count(*) AS count
13864          FROM
13865          action.hold_request ahr,
13866          action.hold_copy_map ahcm
13867          WHERE
13868          ahr.cancel_time IS NULL AND
13869          ahr.fulfillment_time IS NULL AND
13870          ahr.capture_time IS NULL AND
13871          ahr.id = ahcm.hold
13872          GROUP BY ahcm.target_copy
13873         ]]></oils_persist:source_definition>
13874         <fields oils_persist:primary="id">
13875             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13876             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13877         </fields>
13878         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13879             <actions>
13880                <retrieve/>
13881             </actions>
13882         </permacrud>
13883         </class>
13884
13885         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13886                 oils_obj:fieldmapper="config::workstation_setting_type" 
13887                 oils_persist:tablename="config.workstation_setting_type" 
13888                 reporter:label="Workstation Setting Type">
13889                 <fields oils_persist:primary="name">
13890                         <field name="name" reporter:datatype="text"/>
13891                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13892                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13893                         <field name="datatype" reporter:datatype="text"/>
13894                         <field name="fm_class" reporter:datatype="text"/>
13895                         <field name="grp" reporter:datatype="link"/>
13896                 </fields>
13897                 <links>
13898                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13899                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13900                 </links>
13901                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13902                         <actions>
13903                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13904                                 <retrieve/>
13905                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13906                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13907                         </actions>
13908                 </permacrud>
13909         </class>
13910
13911         <!-- no pcrud access is granted for now, because it's assumed these
13912                          setting values will be applied and retrived via the API. -->
13913         <class id="awss" 
13914                 controller="open-ils.cstore"
13915                 oils_obj:fieldmapper="actor::workstation_setting" 
13916                 oils_persist:tablename="actor.workstation_setting" 
13917                 reporter:label="Workstation Setting">
13918                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13919                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13920                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13921                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13922                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
13923                 </fields>
13924                 <links>
13925                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13926                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13927                 </links>
13928         </class>
13929
13930         <class id="cht" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_type" oils_persist:tablename="config.hold_type" reporter:label="Hold Type" oils_persist:readonly="true">
13931         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13932                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
13933                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
13934                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
13935         </fields>
13936         </class>
13937
13938         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
13939                 oils_obj:fieldmapper="config::print_template" 
13940                 oils_persist:tablename="config.print_template" 
13941                 reporter:label="Print Templates">
13942                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13943                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
13944                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13945                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13946                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13947                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13948                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13949                         <field name="content_type" reporter:datatype="text"/>
13950                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13951                 </fields>
13952                 <links>
13953                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13954                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13955                 </links>
13956                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13957                         <actions>
13958                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13959                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
13960                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13961                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13962                         </actions>
13963                 </permacrud>
13964         </class>
13965
13966         <class id="cct" 
13967                 controller="open-ils.cstore open-ils.pcrud"
13968                 oils_obj:fieldmapper="config::carousel_type" 
13969                 oils_persist:tablename="config.carousel_type" 
13970                 reporter:label="Carousel Types">
13971                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
13972                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
13973                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13974                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
13975                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
13976                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
13977                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
13978                 </fields>
13979                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13980                         <actions>
13981                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13982                                 <retrieve/>
13983                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13984                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13985                         </actions>
13986                 </permacrud>
13987         </class>
13988
13989         <class id="cc" 
13990                 controller="open-ils.cstore open-ils.pcrud"
13991                 oils_obj:fieldmapper="container::carousel" 
13992                 oils_persist:tablename="container.carousel" 
13993                 reporter:label="Carousels">
13994                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
13995                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
13996                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
13997                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
13998                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13999                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14000                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14001                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14002                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14003                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14004                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14005                         <field reporter:label="Item Libraries" name="owning_lib_filter" reporter:datatype="text" />      <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
14006                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14007                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14008                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14009                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14010                 </fields>
14011                 <links>
14012                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14013                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14014                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14015                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14016                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14017                 </links>
14018                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14019                         <actions>
14020                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14021                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14022                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14023                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14024                         </actions>
14025                 </permacrud>
14026         </class>
14027
14028         <class id="ccou" 
14029                 controller="open-ils.cstore open-ils.pcrud"
14030                 oils_obj:fieldmapper="container::carousel_org_unit" 
14031                 oils_persist:tablename="container.carousel_org_unit" 
14032                 reporter:label="Carousels Visible at Library">
14033                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14034                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14035                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14036                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14037                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14038                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14039                 </fields>
14040                 <links>
14041                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14042                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14043                 </links>
14044                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14045                         <actions>
14046                                 <create permission="ADMIN_CAROUSEL">
14047                                     <context link="carousel" field="owner" />
14048                                 </create>
14049                                 <retrieve permission="ADMIN_CAROUSEL">
14050                                     <context link="carousel" field="owner" />
14051                                 </retrieve>
14052                                 <update permission="ADMIN_CAROUSEL">
14053                                     <context link="carousel" field="owner" />
14054                                 </update>
14055                                 <delete permission="ADMIN_CAROUSEL">
14056                                     <context link="carousel" field="owner" />
14057                                 </delete>
14058                         </actions>
14059                 </permacrud>
14060         </class>
14061
14062         <class id="cra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remoteauth_profile" oils_persist:tablename="config.remoteauth_profile" reporter:label="Remote Patron Authentication Configuration Profile">
14063                 <fields oils_persist:primary="name">
14064                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14065                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14066                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14067                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14068                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14069                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14070                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14071                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14072                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14073                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14074                 </fields>
14075                 <links>
14076                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14077                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14078                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14079                 </links>
14080                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14081                         <actions>
14082                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14083                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14084                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14085                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14086                         </actions>
14087                 </permacrud>
14088         </class>
14089         <class id="cgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::geolocation_service" oils_persist:tablename="config.geolocation_service" reporter:label="Geographic Location Service">
14090                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14091                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14092                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14093                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14094                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14095                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14096                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14097                 </fields>
14098                 <links>
14099                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14100                 </links>
14101                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14102                         <actions>
14103                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14104                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14105                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14106                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14107                         </actions>
14108                 </permacrud>
14109         </class>
14110
14111     <class id="cusppet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ui_staff_portal_page_entry_type" oils_persist:tablename="config.ui_staff_portal_page_entry_type" reporter:label="Portal Page Entry Type">
14112         <fields oils_persist:primary="code">
14113             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14114             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14115         </fields>
14116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14117                         <actions>
14118                                 <retrieve/>
14119                         </actions>
14120                 </permacrud>
14121         </class>
14122
14123     <class id="cusppe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ui_staff_portal_page_entry" oils_persist:tablename="config.ui_staff_portal_page_entry" reporter:label="Portal Page Entry">
14124         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14125             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14126             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14127             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14128             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14129             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14130             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14131             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14132             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14133                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14134         </fields>
14135                 <links>
14136                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14137                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14138                 </links>
14139         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14140             <actions>
14141                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14142                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14143                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14144                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14145             </actions>
14146         </permacrud>
14147     </class>
14148
14149         <!-- Simple Reporter classes are currently used only by the SR UI -->
14150     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14151         <oils_persist:source_definition><![CDATA[
14152             SELECT
14153               -- Circ id; just for counting
14154               combcirc.id AS circ_id,
14155
14156               -- User info, currently limiting to what's available from action.all_circulation
14157               combcirc.usr_post_code AS usr_post_code,
14158               combcirc.usr_birth_year AS usr_bith_year,
14159               combcirc.usr_profile AS usr_profile_id,
14160               pgtu.name AS usr_profile,
14161               combcirc.usr_home_ou AS usr_home_ou_id,
14162               aouuh.shortname AS usr_home_ou_shortname,
14163               aouuh.name AS usr_home_ou_name,
14164               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14165               aouus.shortname AS usr_sys_shortname,
14166               aouus.name AS usr_sys_name,
14167
14168               -- Circ info
14169               -- Checkout
14170               combcirc.xact_start AS xact_start,
14171               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14172               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14173               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14174               combcirc.circ_lib AS circ_lib_id,
14175               aouco.shortname AS circ_lib_shortname,
14176               aouco.name AS circ_lib_name,
14177               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14178               aoucos.shortname AS circ_sys_shortname,
14179               aoucos.name AS circ_sys_name,
14180               auco.usrname AS circ_staff,
14181               awso.name AS checkout_workstation,
14182
14183               combcirc.due_date AS due_date,
14184               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14185               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14186               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14187
14188               -- Checkin
14189               combcirc.xact_finish AS xact_finish,
14190               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14191               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14192               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14193               aouci.shortname AS checkin_lib_shortname,
14194               aouci.name AS checkin_lib_name,
14195               auci.usrname AS checkin_staff,
14196               awsi.name AS checkin_workstation,
14197               aoucis.shortname AS checkin_sys_shortname,
14198               aoucis.name AS checkin_sys_name,
14199
14200               combcirc.checkin_time AS checkin_time,
14201
14202               -- Misc circ info
14203               combcirc.renewal_remaining AS renewal_remaining,
14204               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14205               combcirc.grace_period AS grace_period,
14206
14207               combcirc.stop_fines AS stop_fines,
14208               combcirc.stop_fines_time AS stop_fines_time,
14209
14210               combcirc.duration AS duration,
14211               combcirc.fine_interval AS fine_interval,
14212               combcirc.recurring_fine AS recurring_fine,
14213               combcirc.max_fine AS max_fine,
14214               combcirc.duration_rule AS duration_rule,
14215               combcirc.recurring_fine_rule AS recurring_fine_rule,
14216               combcirc.max_fine_rule AS max_fine_rule,
14217               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14218               CASE WHEN phone_renewal THEN 'phone' WHEN desk_renewal THEN 'desk' WHEN opac_renewal THEN 'opac' WHEN auto_renewal THEN 'auto' ELSE null END AS renewal_type,
14219               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14220
14221               -- Copy info
14222               acp.barcode AS copy_barcode,
14223               acp.circ_modifier AS copy_circ_modifier_code,
14224               ccm.name AS copy_circ_modifier_name,
14225               acp.circ_lib AS copy_circ_lib_id,
14226               acp.location AS location_id,
14227               acpl.name AS location_name,
14228               aoucp.shortname AS copy_circ_lib_shortname,
14229               aoucp.name AS copy_circ_lib_name,
14230               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14231               aoucps.shortname AS copy_sys_shortname,
14232               aoucps.name AS copy_sys_name,
14233               combcirc.copy_owning_lib AS copy_owning_lib_id,
14234               aoucpo.shortname AS copy_owning_lib_shortname,
14235               aoucpo.name AS copy_owning_lib_name,
14236               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14237               acnp.label AS copy_call_number_prefix,
14238               acn.label AS copy_call_number_label,
14239               acns.label AS copy_call_number_suffix,
14240               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14241               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14242               acn.label_sortkey AS copy_call_number_label_sortkey,
14243               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14244               COALESCE(rmsr.title, acp.dummy_title) AS title,
14245               COALESCE(rmsr.author, acp.dummy_author) AS author,
14246               rmsr.publisher AS publisher,
14247               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14248               array_to_string(rmsr.isbn, ', ') AS isbn,
14249               array_to_string(rmsr.issn, ', ') AS issn,
14250               part.label AS part_label,
14251               part.label_sortkey AS part_label_sortkey,
14252               acn.record AS bib_id,
14253               rmsr.tcn_value AS tcn_value
14254
14255             FROM
14256               action.all_circulation combcirc
14257
14258               -- User
14259               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14260               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14261               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14262
14263               -- Circ
14264               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14265               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14266               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14267               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14268               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14269               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14270               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14271               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14272
14273               -- Copy / call / title
14274               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14275                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14276               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14277               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14278               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14279               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14280               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14281               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14282               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14283               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14284               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14285               LEFT JOIN (
14286                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14287                 FROM biblio.monograph_part bmp
14288                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14289                 WHERE NOT bmp.deleted
14290               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14291         ]]></oils_persist:source_definition>
14292         <field_groups>
14293             <group name="common" reporter:label="Common Fields"/>
14294             <group name="item" reporter:label="Item Fields"/>
14295             <group name="user" reporter:label="Patron Fields"/>
14296             <group name="title" reporter:label="Call Number and Title Fields"/>
14297             <group name="org" reporter:label="Libraries"/>
14298         </field_groups>
14299         <fields oils_persist:primary="circ_id">
14300             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14301             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14302             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14303             <field reporter:label="Patron Profile Group" name="usr_profile_id" sr:hide_from="display" reporter:datatype="link" field_groups="user,common" sr:suggest_filter="true"/>
14304             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14305             <field reporter:label="Patron Home Library" name="usr_home_ou_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,user,common" sr:suggest_filter="true"/>
14306             <field reporter:label="Patron Home Library Short (Policy) Name" sr:hide_from="filter" name="usr_home_ou_shortname" reporter:datatype="text" field_groups="org,user,common"/>
14307             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14308             <field reporter:label="Patron System Library" name="usr_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,user,common" sr:suggest_filter="true"/>
14309             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14310             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14311             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14312             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14313             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14314             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14315             <field reporter:label="Checkout Library" name="circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,common" sr:suggest_filter="true"/>
14316             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14317             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14318             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14319             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14320             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14321             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14322             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14323             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14324             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14325             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14326             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14327             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14328             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14329             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14330             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14331             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14332             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14333             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14334             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14335             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14336             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14337             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14338             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14339             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14340             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14341             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14342             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14343             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14344             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14345             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14346             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14347             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14348             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14349             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14350             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14351             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14352             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14353             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14354             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14355             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14356             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14357             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14358             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14359             <field reporter:label="Item Circulating Library Short (Policy) Name" name="copy_circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14360             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14361             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14362             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14363             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14364             <field reporter:label="Item Owning Library" name="copy_owning_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item" sr:suggest_filter="true"/>
14365             <field reporter:label="Item Owning Library Short (Policy) Name" name="copy_owning_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14366             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14367             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14368             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14369             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14370             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14371             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14372             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14373             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14374             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14375             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14376             <field reporter:label="Call Number Dewey Block Tens" name="copy_call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14377             <field reporter:label="Call Number Dewey Block Hundreds" name="copy_call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14378             <field reporter:label="Call Number Dewey Range Tens" name="copy_call_number_dewey_range_tens" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14379             <field reporter:label="Call Number Dewey Range Hundreds" name="copy_call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14380             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14381             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14382             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14383             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14384             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14385             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14386             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14387             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14388             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14389             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14390         </fields>
14391         <links>
14392             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14393             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14394             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14395         </links>
14396     </class>
14397
14398     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14399         <oils_persist:source_definition><![CDATA[
14400             SELECT
14401               au.home_ou AS home_ou_filter,
14402               au.id AS user_id,
14403               cardp.barcode AS barcode_primary,
14404               au.usrname AS usrname,
14405               au.email AS email,
14406               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14407               au.prefix AS prefix,
14408               au.first_given_name AS first_given_name,
14409               au.second_given_name AS second_given_name,
14410               au.family_name AS family_name,
14411               au.suffix AS suffix,
14412               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14413               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14414               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14415               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14416               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14417               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14418               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14419               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14420               au.profile AS profile_id,
14421               pgt.name AS profile,
14422               au.alias AS alias,
14423               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14424               au.day_phone AS day_phone,
14425               au.evening_phone AS evening_phone,
14426               au.other_phone AS other_phone,
14427               au.dob AS dob,
14428               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14429               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14430               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14431               au.active AS active,
14432               au.barred AS barred,
14433               au.deleted AS deleted,
14434               au.juvenile AS juvenile,
14435               au.claims_returned_count AS claims_returned_count,
14436               au.credit_forward_balance AS credit_forward_balance,
14437               au.create_date AS create_date,
14438               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14439               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14440               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14441               au.expire_date AS expire_date,
14442               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14443               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14444               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14445               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14446               au.last_update_time AS last_update_time,
14447               au.home_ou AS home_ou_id,
14448               aouh.shortname AS home_ou_shortname,
14449               aouh.name AS home_ou_name,
14450               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14451               aous.shortname AS home_sys_shortname,
14452               aous.name AS home_sys_name,
14453               auam.valid AS mailing_valid,
14454               auam.address_type AS mailing_address_type,
14455               auam.street1 AS mailing_street1,
14456               auam.street2 AS mailing_street2,
14457               auam.city AS mailing_city,
14458               auam.state AS mailing_state,
14459               auam.country AS mailing_country,
14460               auam.post_code AS mailing_post_code,
14461               auam.county AS mailing_county,
14462               auam.within_city_limits AS mailing_within_city_limits,
14463               auam.pending AS mailing_pending,
14464               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14465               auap.valid AS physical_valid,
14466               auap.address_type AS physical_address_type,
14467               auap.street1 AS physical_street1,
14468               auap.street2 AS physical_street2,
14469               auap.city AS physical_city,
14470               auap.state AS physical_state,
14471               auap.country AS physical_country,
14472               auap.post_code AS physical_post_code,
14473               auap.county AS physical_county,
14474               auap.within_city_limits AS physical_within_city_limits,
14475               auap.pending AS physical_pending,
14476               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14477               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14478               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14479               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14480               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14481               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14482               asceum1.stat_cat_entry AS legacy_stat_cat1,
14483               asceum2.stat_cat_entry AS legacy_stat_cat2,
14484
14485               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14486               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14487               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14488               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14489               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL AND now() > circ.due_date THEN circ.id ELSE NULL END) AS circs_overdue,
14490               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14491
14492             FROM
14493               actor.usr au
14494               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14495               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14496               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14497               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14498               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14499               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14500               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14501               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14502               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14503               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14504               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14505               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14506               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14507               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14508               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14509               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14510
14511             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14512               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14513               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14514               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14515               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14516               76,77,78,79,80,81
14517         ]]></oils_persist:source_definition>
14518         <field_groups>
14519             <group name="common" reporter:label="Common Fields"/>
14520             <group name="name" reporter:label="Name Fields"/>
14521             <group name="contact" reporter:label="Contact Fields"/>
14522             <group name="address" reporter:label="Address Related Fields"/>
14523             <group name="org" reporter:label="Libraries"/>
14524         </field_groups>
14525         <fields oils_persist:primary="user_id">
14526             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14527                 sr:hide_from="display,filter" sr:force_transform="reporter.intersect_user_perm_ou,SR__USER_ID,VIEW_USER" sr:force_filter="true" sr:force_filtervalues="t"/>
14528             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14529             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14530             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14531             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14532             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14533             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14534             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14535             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14536             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14537             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14538             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14539             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14540             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14541             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14542             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14543             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14544             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14545             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14546             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14547             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14548             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14549             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14550             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14551             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14552             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14553             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14554             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14555             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14556             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14557             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14558             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14559             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14560             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14561             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14562             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14563             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14564             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14565             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14566             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14567             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14568             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14569             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14570             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14571             <field reporter:label="Home Library" name="home_ou_id" reporter:datatype="org_unit" sr:suggest_filter="true" sr:hide_from="display" field_groups="org,common"/>
14572             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14573             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14574             <field reporter:label="Home System" name="home_sys_id" reporter:datatype="org_unit" sr:suggest_filter="true" sr:hide_from="display" field_groups="org,common"/>
14575             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14576             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14577             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14578             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14579             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14580             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14581             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14582             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14583             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14584             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14585             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14586             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14587             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14588             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14589             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14590             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14591             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14592             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14593             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14594             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14595             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14596             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14597             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14598             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14599             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14600             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14601             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14602             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14603             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14604             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14605             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14606             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14607             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14608             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14609             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14610             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14611             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14612             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14613         </fields>
14614         <links>
14615             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14616         </links>
14617     </class>
14618
14619     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14620         <oils_persist:source_definition><![CDATA[
14621             SELECT
14622               -- ids
14623               acp.id AS copy_id,
14624               acp.floating AS floating_id,
14625               acn.id AS acn_id,
14626               acp.circ_lib AS circ_lib_id,
14627               acp.status AS status_id,
14628               acp.location AS location_id,
14629               acp.age_protect AS age_protect_id,
14630               aous.id AS circ_sys_id,
14631               acn.owning_lib AS owning_lib_id,
14632               aouos.id AS owning_sys_id,
14633               awsi.id AS inv_workstation_id,
14634
14635               -- OUs
14636               aou.shortname AS circ_lib_shortname,
14637               aou.name AS circ_lib_name,
14638               aous.shortname AS circ_sys_shortname,
14639               aous.name AS circ_sys_name,
14640               aouo.shortname AS owning_lib_shortname,
14641               aouo.name AS owning_lib_name,
14642               aouos.shortname AS owning_sys_shortname,
14643               aouos.name AS owning_sys_name,
14644
14645               -- dates
14646               acp.create_date AS create_date_time,
14647               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14648               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14649               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14650               acp.active_date AS active_date_time,
14651               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14652               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14653               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14654               acp.edit_date AS edit_date_time,
14655               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14656               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14657               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14658               acp.status_changed_time AS status_changed_time_time,
14659               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14660               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14661               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14662               ali.inventory_date AS latest_inv_date,
14663               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14664               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14665               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14666
14667               -- acp
14668               acp.barcode AS barcode,
14669               ccs.name AS status,
14670               acpl.name AS location_name,
14671                                                         acp.circ_modifier AS copy_circ_modifier_code,
14672                                                         ccm.name AS copy_circ_modifier_name,
14673               acp.price AS price,
14674               acp.cost AS acq_price,
14675               acp.deleted AS copy_deleted,
14676               acp.ref AS reference,
14677               acp.circulate AS copy_circulate,
14678               (acp.circulate AND acpl.circulate) AS circulate,
14679               acp.holdable AS copy_holdable,
14680               acp.deposit AS deposit,
14681               acp.deposit_amount AS deposit_amount,
14682               acp.alert_message AS alert_message,
14683               acp.opac_visible AS copy_opac_visible,
14684               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14685               crahp.name AS age_protect,
14686               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14687               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14688               acp.copy_number AS copy_number,
14689               acp.circ_as_type AS circ_as_type,
14690               acp.loan_duration AS loan_duration_int,
14691               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14692               acp.fine_level AS fine_level_int,
14693               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14694
14695               -- Call Number
14696               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14697               acnp.label AS copy_call_number_prefix,
14698               acn.label AS copy_call_number_label,
14699               acns.label AS copy_call_number_suffix,
14700               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14701               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14702               acn.label_sortkey AS copy_call_number_label_sortkey,
14703               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14704               racnd.dewey AS call_number_dewey,
14705               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14706               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14707               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14708               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14709
14710               -- Misc
14711               COALESCE(rmsr.title, acp.dummy_title) AS title,
14712               COALESCE(rmsr.author, acp.dummy_author) AS author,
14713               rmsr.publisher AS publisher,
14714               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14715               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14716               array_to_string(rmsr.issn, ', ') AS issn,
14717               part.label AS part_label,
14718               part.label_sortkey AS part_label_sortkey,
14719               acn.record AS bib_id,
14720               rmsr.tcn_value AS tcn_value,
14721               acn.deleted AS call_deleted,
14722               bre.deleted AS bib_deleted,
14723               ccs.holdable AS status_holdable,
14724               acpl.holdable AS location_holdable,
14725               acp.circulate AS location_circulate,
14726               awsi.name AS inventory_workstation,
14727               aucr.usrname AS creating_user,
14728               aued.usrname AS editing_user,
14729
14730               -- Aggregates
14731               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14732               COALESCE(acp.cost, acp.price, (select first(value::numeric(8,2)) from actor.org_unit_ancestor_setting('cat.default_item_price', acp.circ_lib)), 5.00) AS est_price,
14733               COUNT(DISTINCT combcirc.id) AS circ_total,
14734               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14735
14736             FROM
14737               asset.copy acp
14738               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14739               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14740               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14741               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14742               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14743               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14744               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14745               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14746               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14747               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14748               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14749               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14750               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14751               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14752               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14753               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14754               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14755               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14756               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14757               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14758               LEFT JOIN (
14759                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14760                 FROM biblio.monograph_part bmp
14761                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14762                 WHERE NOT bmp.deleted
14763               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14764
14765             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14766               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14767               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14768               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14769               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14770               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14771               91,92,93,94,95,96
14772
14773         ]]></oils_persist:source_definition>
14774         <field_groups>
14775             <group name="common" reporter:label="Common Fields"/>
14776             <group name="dates" reporter:label="Date Fields"/>
14777             <group name="title" reporter:label="Call Number and Title Fields"/>
14778             <group name="org" reporter:label="Libraries"/>
14779         </field_groups>
14780         <fields oils_persist:primary="copy_id">
14781             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14782             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14783             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14784             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14785             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14786             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14787             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14788             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14789             <field reporter:label="Owning Library" name="owning_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
14790             <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
14791             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14792             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14793             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14794             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14795             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14796             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14797             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14798             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14799             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14800             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14801             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14802             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14803             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14804             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14805             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14806             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14807             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14808             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14809             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14810             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14811             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14812             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14813             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14814             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14815             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14816             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14817             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14818             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14819             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14820             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14821             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14822             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14823             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14824             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14825             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14826             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14827             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14828             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14829             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14830             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14831             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14832             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14833             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14834             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14835             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14836             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14837             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14838             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14839             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14840             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14841             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14842             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14843             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14844             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14845             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14846             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14847             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14848             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14849             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14850             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14851             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14852             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14853             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14854             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14855             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14856             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14857             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14858             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14859             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14860             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14861             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14862             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14863             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14864             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14865             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14866             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14867             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14868             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14869             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14870             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14871             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14872             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14873             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14874             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14875         </fields>
14876         <links>
14877             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14878             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14879             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14880             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14881             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14882             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14883         </links>
14884     </class>
14885
14886     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14887         <oils_persist:source_definition><![CDATA[
14888
14889             SELECT
14890               -- ids
14891               acp.id AS copy_id,
14892               acn.id AS acn_id,
14893               acp.circ_lib AS circ_lib_id,
14894               acp.status AS status_id,
14895               acp.location AS location_id,
14896               acp.age_protect AS age_protect_id,
14897               aous.id AS circ_sys_id,
14898               acn.owning_lib AS owning_lib_id,
14899               aouos.id AS owning_sys_id,
14900               awsi.id AS inv_workstation_id,
14901
14902               -- OUs
14903               aou.shortname AS circ_lib_shortname,
14904               aou.name AS circ_lib_name,
14905               aous.shortname AS circ_sys_shortname,
14906               aous.name AS circ_sys_name,
14907               aouo.shortname AS owning_lib_shortname,
14908               aouo.name AS owning_lib_name,
14909               aouos.shortname AS owning_sys_shortname,
14910               aouos.name AS owning_sys_name,
14911
14912               -- dates
14913               acp.create_date AS create_date_time,
14914               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14915               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14916               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14917               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14918               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14919               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14920               acp.active_date AS active_date_time,
14921               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14922               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14923               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14924               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14925               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14926               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14927               acp.edit_date AS edit_date_time,
14928               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14929               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14930               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14931               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14932               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14933               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14934               acp.status_changed_time AS status_changed_time_time,
14935               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14936               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14937               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14938               ali.inventory_date AS latest_inv_date,
14939               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14940               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14941               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14942               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14943               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14944               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14945
14946               -- acp
14947               acp.barcode AS barcode,
14948               ccs.name AS status,
14949               acpl.name AS location_name,
14950               acp.circ_modifier AS circ_modifier_code,
14951               ccm.name AS circ_modifier_name,
14952               acp.price AS price,
14953               acp.cost AS acq_price,
14954               acp.deleted AS copy_deleted,
14955               acp.ref AS reference,
14956               acp.circulate AS copy_circulate,
14957               (acp.circulate AND acpl.circulate) AS circulate,
14958               acp.holdable AS copy_holdable,
14959               acp.deposit AS deposit,
14960               acp.deposit_amount AS deposit_amount,
14961               acp.alert_message AS alert_message,
14962               acp.opac_visible AS copy_opac_visible,
14963               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14964               crahp.name AS age_protect,
14965               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14966               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14967               acp.copy_number AS copy_number,
14968               acp.circ_as_type AS circ_as_type,
14969               acp.loan_duration AS loan_duration_int,
14970               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14971               acp.fine_level AS fine_level_int,
14972               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14973
14974               -- Call Number
14975               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14976               acnp.label AS copy_call_number_prefix,
14977               acn.label AS copy_call_number_label,
14978               acns.label AS copy_call_number_suffix,
14979               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14980               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14981               acn.label_sortkey AS copy_call_number_label_sortkey,
14982               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14983               racnd.dewey AS call_number_dewey,
14984               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14985               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14986               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14987               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14988
14989               -- Misc
14990               COALESCE(rmsr.title, acp.dummy_title) AS title,
14991               COALESCE(rmsr.author, acp.dummy_author) AS author,
14992               rmsr.publisher AS publisher,
14993               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14994               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14995               array_to_string(rmsr.issn, ', ') AS issn,
14996               part.label AS part_label,
14997               part.label_sortkey AS part_label_sortkey,
14998               acn.record AS bib_id,
14999               rmsr.tcn_value AS tcn_value,
15000               acn.deleted AS call_deleted,
15001               bre.deleted AS bib_deleted,
15002               ccs.holdable AS status_holdable,
15003               acpl.holdable AS location_holdable,
15004               acp.circulate AS location_circulate,
15005               awsi.name AS inventory_workstation,
15006
15007               -- Aggregates
15008               -- may decide these price games aren't worth it, but estimated collection value is useful
15009               COALESCE(acp.cost, acp.price, (select first(value::numeric(8,2)) from actor.org_unit_ancestor_setting('cat.default_item_price', acp.circ_lib)), 5.00) AS est_price,
15010               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15011               MAX(combcirc.xact_start) AS last_circ_datetime,
15012               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15013               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15014               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15015               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15016               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15017               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15018               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15019               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15020               (EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) * 12) + EXTRACT(MONTH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_months,
15021               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15022               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15023               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15024               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15025               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15026               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15027               COUNT(DISTINCT CASE WHEN date_part('year', now() - '1 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_last_year,
15028               COUNT(DISTINCT CASE WHEN date_part('year', now() - '2 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_two_years_ago,
15029               COUNT(DISTINCT CASE WHEN date_part('year', now() - '3 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_three_years_ago,
15030               COUNT(DISTINCT CASE WHEN date_part('year', now() - '5 year'::interval) <= date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_last_five_years
15031
15032             FROM
15033               asset.copy acp
15034               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15035               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15036               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15037               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15038               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15039               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15040               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15041               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15042               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15043               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15044               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15045               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15046               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15047               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15048               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15049               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15050               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15051               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15052               LEFT JOIN (
15053                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15054                 FROM biblio.monograph_part bmp
15055                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15056                 WHERE NOT bmp.deleted
15057               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15058
15059             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15060               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15061               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15062               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15063               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15064               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15065               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15066
15067         ]]></oils_persist:source_definition>
15068         <field_groups>
15069             <group name="common" reporter:label="Common Fields"/>
15070             <group name="dates" reporter:label="Date Fields"/>
15071             <group name="inv" reporter:label="Inventory Fields"/>
15072             <group name="title" reporter:label="Call Number and Title Fields"/>
15073             <group name="org" reporter:label="Libraries"/>
15074         </field_groups>
15075         <fields oils_persist:primary="copy_id">
15076              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15077              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15078              <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
15079              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15080              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15081              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15082              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15083              <field reporter:label="Owning Library" name="owning_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
15084              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15085              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15086              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15087              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15088              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15089              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15090              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15091              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15092              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15093              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15094              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15095              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15096              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15097              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15098              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15099              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15100              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15101              <field reporter:label="Last Circulated or Item Created Date / Time" name="last_circ_create_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15102              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15103              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15104              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15105              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15106              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15107              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15108              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15109              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15110              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15111              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15112              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15113              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15114              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15115              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15116              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15117              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15118              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15119              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15120              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15121              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15122              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15123              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15124              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15125              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15126              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15127              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15128              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15129              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15130              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15131              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15132              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15133              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15134              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15135              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15136              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15137              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15138              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15139              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15140              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15141              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15142              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15143              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15144              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15145              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15146              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15147              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15148              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15149              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15150              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15151              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15152              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15153              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15154              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15155              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15156              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15157              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15158              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15159              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15160              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15161              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15162              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15163              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15164              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15165              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15166              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15167              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15168              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15169              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15170              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15171              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15172              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15173              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15174              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15175              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15176              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15177              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15178              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15179              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15180              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15181              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15182              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15183              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15184              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15185              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15186              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15187              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15188              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15189              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15190              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15191              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15192              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15193              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15194              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15195              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15196              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15197              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15198              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15199              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15200              <field reporter:label="Circulation Two Years Ago" name="circ_two_years_ago" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15201              <field reporter:label="Circulation Three Years Ago" name="circ_three_years_ago" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15202              <field reporter:label="Circulation Total Last Five Years" name="circ_last_five_years" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15203         </fields>
15204         <links>
15205             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15206             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15207             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15208             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15209             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15210         </links>
15211     </class>
15212
15213     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15214         <oils_persist:source_definition><![CDATA[
15215
15216             SELECT
15217               -- ids
15218               xact.id AS xact_id,
15219               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15220               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15221
15222               -- OUs
15223               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15224               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15225               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15226               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15227
15228               -- billings
15229               billings.total_amount AS billing_grand_total,
15230               billings.total_unvoided_amount AS billing_total,
15231
15232               billings.voided_billing_count AS billing_voided_count,
15233               billings.all_billing_types AS all_billing_types,
15234               billings.billing_types AS billing_types,
15235
15236               billings.total_voided_amount AS billing_total_voided,
15237               billings.total_overdue_amount AS billing_overdue_amount,
15238               billings.total_lost_amount AS billing_lost_amount,
15239               billings.total_long_od_amount AS billing_long_od_amount,
15240               billings.total_damaged_amount AS billing_damaged_amount,
15241               billings.total_deposit_amount AS billing_deposit_amount,
15242               billings.total_rental_amount AS billing_rental_amount,
15243
15244               -- payments
15245               payments.total_amount AS payment_grand_total,
15246               payments.total_unvoided_amount AS payment_total,
15247
15248               payments.voided_payment_count AS payment_voided_count,
15249               payments.all_payment_types AS all_payment_types,
15250               payments.payment_types AS payment_types,
15251
15252               payments.total_voided_amount AS payment_total_voided,
15253               payments.total_account_adjustment AS payment_account_adjustment_amount,
15254               payments.total_cash_payment AS payment_cash_amount,
15255               payments.total_check_payment AS payment_check_amount,
15256               payments.total_credit_card_payment AS payment_credit_card_amount,
15257               payments.total_debit_card_payment AS payment_debit_card_amount,
15258               payments.total_credit_payment AS payment_credit_amount,
15259               payments.total_forgive_payment AS payment_forgive_amount,
15260               payments.total_work_payment AS payment_work_amount,
15261               payments.total_goods_payment AS payment_goods_amount,
15262               payments.total_currency_payment AS payment_currency_amount,
15263               payments.total_non_currency_payment AS payment_non_currency_amount,
15264
15265               -- dates
15266               xact.xact_start AS xact_start,
15267               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15268               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15269               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15270               xact.xact_finish AS xact_finish,
15271               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15272               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15273               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15274               billings.earliest_billing_ts AS earliest_billing_ts,
15275               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15276               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15277               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15278               billings.latest_billing_ts AS latest_billing_ts,
15279               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15280               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15281               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15282               payments.earliest_payment_ts AS earliest_payment_ts,
15283               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15284               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15285               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15286               payments.latest_payment_ts AS latest_payment_ts,
15287               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15288               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15289               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15290
15291               -- Misc
15292               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15293               (xact.xact_finish IS NOT NULL) AS xact_closed
15294
15295             FROM
15296               money.billable_xact xact
15297               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15298               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15299               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15300               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15301               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15302               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15303
15304               -- oohh nooo.... If not done this way you encounter situations
15305               -- like multiplying billing totals x number of payments and
15306               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15307               LEFT JOIN (
15308                 SELECT
15309                   xact,
15310                   MIN(billing_ts) AS earliest_billing_ts,
15311                   MAX(billing_ts) AS latest_billing_ts,
15312
15313                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15314                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15315                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15316
15317                   SUM(amount) AS total_amount,
15318                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15319                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15320                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15321                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15322                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15323                   SUM(CASE WHEN NOT voided AND btype IN (7,8) THEN amount ELSE NULL END) AS total_damaged_amount, -- Likely incomplete because damaged billing interface is whack.
15324                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15325                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15326
15327                 FROM
15328                   money.all_billings
15329                 GROUP BY 1
15330               ) billings ON (xact.id = billings.xact)
15331               -- Can't include accepting user or cash_drawer because that will "duplicate"
15332               -- rows if multiple staff accept payments on a single xact...
15333               LEFT JOIN (
15334                 SELECT
15335                   xact,
15336                   MIN(payment_ts) AS earliest_payment_ts,
15337                   MAX(payment_ts) AS latest_payment_ts,
15338
15339                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15340                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15341                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15342
15343                   SUM(amount) AS total_amount,
15344                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15345                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15346                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15347                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15348                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15349                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15350                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15351                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15352                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15353                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15354                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15355                   SUM(CASE WHEN NOT voided AND payment_type IN ('cash_payment', 'check_payment', 'credit_card_payment', 'debit_card_payment', 'credit_payment') THEN amount ELSE NULL END) AS total_currency_payment,
15356                   SUM(CASE WHEN NOT voided AND payment_type NOT IN ('cash_payment', 'check_payment', 'credit_card_payment', 'debit_card_payment', 'credit_payment') THEN amount ELSE NULL END) AS total_non_currency_payment
15357
15358                 FROM
15359                   money.all_payments
15360                 GROUP BY 1
15361               ) payments ON (xact.id = payments.xact)
15362
15363         ]]></oils_persist:source_definition>
15364         <field_groups>
15365             <group name="common" reporter:label="Common Fields"/>
15366             <group name="bill" reporter:label="Billing Fields"/>
15367             <group name="pay" reporter:label="Payment Fields"/>
15368             <group name="dates" reporter:label="Date Fields"/>
15369             <group name="org" reporter:label="Libraries"/>
15370         </field_groups>
15371         <fields oils_persist:primary="xact_id">
15372              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15373              <field reporter:label="Billing Library" name="billing_lib_id" reporter:datatype="org_unit" sr:hide_from="display" sr:suggest_filter="true" field_groups="org,common"/>
15374              <field reporter:label="Billing System" name="billing_sys_id" reporter:datatype="org_unit" sr:hide_from="display" sr:suggest_filter="true" field_groups="org,common"/>
15375              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15376              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15377              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15378              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15379              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15380              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15381              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15382              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15383              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15384              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15385              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15386              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15387              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15388              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15389              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15390              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15391              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15392              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15393              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15394              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15395              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15396              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15397              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15398              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15399              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15400              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15401              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15402              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15403              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15404              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15405              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15406              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15407              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15408              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15409              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15410              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15411              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15412              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15413              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15414              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15415              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15416              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15417              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15418              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15419              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15420              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15421              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15422              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15423              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15424              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15425              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15426              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15427              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15428              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15429              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15430              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15431              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15432              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15433              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15434         </fields>
15435     </class>
15436
15437         <class id="coauf" 
15438                 controller="open-ils.cstore open-ils.pcrud"
15439                 oils_obj:fieldmapper="config::openathens_uid_field" 
15440                 oils_persist:tablename="config.openathens_uid_field" 
15441                 reporter:label="OpenAthens unique identifiers">
15442                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15443                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15444                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15445                 </fields>
15446                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15447                         <actions>
15448                                 <retrieve/>
15449                         </actions>
15450                 </permacrud>
15451         </class>
15452
15453         <class id="coanf" 
15454                 controller="open-ils.cstore open-ils.pcrud"
15455                 oils_obj:fieldmapper="config::openathens_name_field" 
15456                 oils_persist:tablename="config.openathens_name_field" 
15457                 reporter:label="OpenAthens name fields">
15458                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15459                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15460                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15461                 </fields>
15462                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15463                         <actions>
15464                                 <retrieve/>
15465                         </actions>
15466                 </permacrud>
15467         </class>
15468
15469         <class id="coai" 
15470                 controller="open-ils.cstore open-ils.pcrud"
15471                 oils_obj:fieldmapper="config::openathens_identity" 
15472                 oils_persist:tablename="config.openathens_identity" 
15473                 reporter:label="Sign-on to OpenAthens">
15474                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15475                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15476                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15477                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15478                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15479                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15480                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15481                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15482                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15483                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15484                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15485                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15486                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15487                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15488                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15489                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15490                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15491                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15492                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15493                 </fields>
15494                 <links>
15495                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15496                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15497                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15498                 </links>
15499                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15500                         <actions>
15501                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15502                                 <retrieve/>
15503                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15504                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15505                         </actions>
15506                 </permacrud>
15507         </class>
15508
15509         <!-- ********************************************************************************************************************* -->
15510 </IDL>
15511
15512 <!--
15513     vim:noet:ts=4:sw=4:
15514 -->