]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1729620 Cleanup, fix bugs
[working/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="oai_biblio" 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>
82                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="number"/>
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="oai_authority" 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>
92                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="number"/>
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                 </fields>
1337                 <links>
1338             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1339             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1340                 </links>
1341                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1342                         <actions>
1343                                 <retrieve/>
1344                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1345                         </actions>
1346                 </permacrud>
1347         </class>
1348
1349         <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">
1350                 <fields oils_persist:primary="key">
1351                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1352                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1353                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1354                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1355                 </fields>
1356                 <links/>
1357                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1358                         <actions>
1359                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1360                                 <retrieve/>
1361                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1362                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1363                         </actions>
1364                 </permacrud>
1365         </class>
1366
1367         <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">
1368                 <fields oils_persist:primary="module">
1369                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1370                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1371                 </fields>
1372                 <links/>
1373                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1374                         <actions>
1375                                 <retrieve/>
1376                         </actions>
1377                 </permacrud>
1378         </class>
1379
1380         <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">
1381                 <fields oils_persist:primary="module">
1382                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1383                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1384                 </fields>
1385                 <links/>
1386                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1387                         <actions>
1388                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1389                                 <retrieve/>
1390                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1391                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1392                         </actions>
1393                 </permacrud>
1394         </class>
1395
1396         <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">
1397                 <fields oils_persist:primary="module">
1398                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1399                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1400                 </fields>
1401                 <links/>
1402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1403                         <actions>
1404                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1405                                 <retrieve/>
1406                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1407                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1408                         </actions>
1409                 </permacrud>
1410         </class>
1411
1412         <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">
1413                 <fields oils_persist:primary="module">
1414                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1415                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1416                 </fields>
1417                 <links/>
1418                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1419                         <actions>
1420                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1421                                 <retrieve/>
1422                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1423                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1424                         </actions>
1425                 </permacrud>
1426         </class>
1427
1428         <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">
1429                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1430                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1431                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1432                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1433                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1434                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1435                 </fields>
1436                 <links>
1437                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1438                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1439                 </links>
1440                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1441                         <actions>
1442                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1443                     <context link="event_def" field="owner"/>
1444                 </create>
1445                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1446                     <context link="event_def" field="owner"/>
1447                 </retrieve>
1448                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1449                     <context link="event_def" field="owner"/>
1450                 </update>
1451                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1452                     <context link="event_def" field="owner"/>
1453                 </delete>
1454                         </actions>
1455                 </permacrud>
1456         </class>
1457
1458         <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">
1459                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1460                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1461                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1462                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1463                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1464                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1465                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1466                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1467                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1468                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1469                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1470                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1471                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1472                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1473                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1474                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1475                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1476                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1477                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1478                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1479                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1480                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1481                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1482                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1483                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1484                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1485                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1486                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1487                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1488                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1489                 </fields>
1490                 <links>
1491                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1492                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1493                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1494                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1495                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1496                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1497                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1498                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1499                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1500                 </links>
1501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1502                         <actions>
1503                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1504                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1505                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                         </actions>
1508                 </permacrud>
1509         </class>
1510
1511         <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">
1512                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1513                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1514                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1515                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1516                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1517                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1518                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1519                 </fields>
1520                 <links>
1521                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1522                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1523                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1524                 </links>
1525                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1526                         <actions>
1527                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1528                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1529                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1530                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1531                         </actions>
1532                 </permacrud>
1533         </class>
1534
1535         <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">
1536                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1537                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1538                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1539                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1540                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1541                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1542                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1543                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1544                 </fields>
1545                 <links>
1546                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1547                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1548                 </links>
1549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1550                         <actions>
1551                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1552                     <context link="grp" field="owner"/>
1553                 </create>
1554                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1555                     <context link="grp" field="owner"/>
1556                 </retrieve>
1557                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1558                     <context link="grp" field="owner"/>
1559                 </update>
1560                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1561                     <context link="grp" field="owner"/>
1562                 </delete>
1563                         </actions>
1564                 </permacrud>
1565         </class>
1566
1567         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1568                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1569                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1570                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1571                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1572                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1573                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1574                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1575                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1576                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1577                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1578                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1579                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1580                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1581                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1582                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1583                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1584                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1585                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1586                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1587                 </fields>
1588                 <links>
1589                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1590                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1591                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1592                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1593                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1594                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1595                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1596                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1597                 </links>
1598         </class>
1599
1600         <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">
1601                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1602                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1603                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1604                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1605                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1606                 </fields>
1607                 <links>
1608                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1609                 </links>
1610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1611                         <actions>
1612                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1613                     <context link="event_def" field="owner"/>
1614                 </create>
1615                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1616                     <context link="event_def" field="owner"/>
1617                 </retrieve>
1618                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1619                     <context link="event_def" field="owner"/>
1620                 </update>
1621                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1622                     <context link="event_def" field="owner"/>
1623                 </delete>
1624                         </actions>
1625                 </permacrud>
1626         </class>
1627
1628         <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">
1629                 <oils_persist:source_definition><![CDATA[
1630                 SELECT  atevdef.hook,
1631                         atevdef.name,
1632                         atevdef.reactor,
1633                         atev.id,
1634                         atev.event_def,
1635                         atev.add_time,
1636                         atev.run_time,
1637                         atev.start_time,
1638                         atev.update_time,
1639                         atev.complete_time,
1640                         atev.update_process,
1641                         atev.state,
1642                         atev.user_data,
1643                         atev.template_output,
1644                         atev.error_output,
1645                         atev.async_output,
1646                         targ_circ.id AS target_circ,
1647                         targ_ahr.id AS target_hold,
1648                         COALESCE(
1649                                 targ_circ.circ_lib,
1650                                 targ_ahr.pickup_lib
1651                         ) AS perm_lib
1652                 FROM action_trigger.event atev
1653                 JOIN action_trigger.event_definition atevdef ON
1654                         (atevdef.id = atev.event_def)
1655                 JOIN action_trigger.hook ath ON
1656                         (ath.key = atevdef.hook)
1657                 LEFT JOIN action.circulation targ_circ ON
1658                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1659                 LEFT JOIN action.hold_request targ_ahr ON
1660                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1661                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1662                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1663                                 'circ.staff.max_visible_event_age',
1664                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1665                         ) UNION
1666                         SELECT '1000 YEARS'::INTERVAL AS value
1667                 ) ous)
1668                 ]]></oils_persist:source_definition>
1669                 <fields oils_persist:primary="id">
1670                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1671                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1672                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1673                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1674                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1675                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1676                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1677                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1678                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1679                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1680                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1681                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1682                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1683                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1684                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1685                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1686                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1687                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1688                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1689                 </fields>
1690                 <links>
1691                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1692                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1693                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1694                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1695                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1696                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1697                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1698                 </links>
1699                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1700                         <actions>
1701                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1702                         </actions>
1703                 </permacrud>
1704         </class>
1705
1706         <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">
1707                 <oils_persist:source_definition><![CDATA[
1708                 SELECT  atevdef.hook,
1709                         atevdef.name,
1710                         atevdef.reactor,
1711                         atev.id,
1712                         atev.event_def,
1713                         atev.add_time,
1714                         atev.run_time,
1715                         atev.start_time,
1716                         atev.update_time,
1717                         atev.complete_time,
1718                         atev.update_process,
1719                         atev.state,
1720                         atev.user_data,
1721                         atev.template_output,
1722                         atev.error_output,
1723                         atev.async_output,
1724             atev.target,
1725                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1726                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1727             atev.context_user,
1728                         atev.context_library,
1729             atev.context_bib,
1730             atev.context_item,
1731             rssr.title,
1732             rssr.author
1733                 FROM action_trigger.event atev
1734                 JOIN action_trigger.event_definition atevdef ON
1735                         (atevdef.id = atev.event_def)
1736                 JOIN action_trigger.hook ath ON
1737                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1738         LEFT JOIN reporter.super_simple_record rssr ON
1739             (atev.context_bib = rssr.id)
1740                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1741                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1742                                 'circ.staff.max_visible_event_age',
1743                                 atev.context_library
1744                         ) UNION
1745                         SELECT '1000 YEARS'::INTERVAL AS value
1746                 ) ous)
1747                 ]]></oils_persist:source_definition>
1748                 <fields oils_persist:primary="id">
1749                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1750                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1751                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1752                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1753                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1754                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1755                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1756                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1757                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1758                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1759                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1760                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1761                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1762                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1763                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1764                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1765                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1766                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1767                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1768                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1769                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1770                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1771                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1772                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1773                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1774                 </fields>
1775                 <links>
1776                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1777                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1778                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1779                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1780                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1781                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1782                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1783                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1784                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1785                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1786                 </links>
1787                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1788                         <actions>
1789                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1790                         </actions>
1791                 </permacrud>
1792         </class>
1793
1794         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1795                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1796                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1797                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1798                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1799                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1800                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1801                 </fields>
1802                 <links>
1803                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1804                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1805                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1806                 </links>
1807                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1808                         <actions>
1809                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1810                         </actions>
1811                 </permacrud>
1812         </class>
1813
1814         <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">
1815                 <fields oils_persist:primary="code">
1816                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1817                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1818                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1819                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1820                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1821                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1822                 </fields>
1823                 <links/>
1824         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1825             <actions>
1826                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1827                 <retrieve/>
1828                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1829                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1830             </actions>
1831         </permacrud>
1832         </class>
1833
1834         <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">
1835                 <fields oils_persist:primary="code">
1836                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1837                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1838                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1839                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1840                 </fields>
1841                 <links/>
1842         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1843             <actions>
1844                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1845                 <retrieve/>
1846                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1847                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1848             </actions>
1849         </permacrud>
1850         </class>
1851
1852         <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">
1853                 <fields oils_persist:primary="code">
1854                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1855                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1856                 </fields>
1857                 <links/>
1858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859             <actions>
1860                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1861                 <retrieve/>
1862                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1863                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1864             </actions>
1865         </permacrud>
1866         </class>
1867
1868         <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">
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="label" reporter:datatype="text" oils_persist:i18n="true"/>
1872                 </fields>
1873                 <links/>
1874         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1875             <actions>
1876                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1877                 <retrieve/>
1878                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1879                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1880             </actions>
1881         </permacrud>
1882         </class>
1883
1884         <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">
1885                 <fields oils_persist:primary="code">
1886                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1887                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1888                 </fields>
1889                 <links/>
1890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1891             <actions>
1892                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1893                 <retrieve/>
1894                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1895                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1896             </actions>
1897         </permacrud>
1898         </class>
1899
1900         <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">
1901                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1902                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1903                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1904                 </fields>
1905                 <links/>
1906         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1907             <actions>
1908                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1909                 <retrieve/>
1910                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1911                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1912             </actions>
1913         </permacrud>
1914         </class>
1915
1916         <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">
1917                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1918                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1919                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1920                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1921                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1922                 </fields>
1923         <links>
1924             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1925             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1926             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1927         </links>
1928         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1929             <actions>
1930                 <create permission="UPDATE_COPY">
1931                     <context link="target_copy" field="circ_lib"/>
1932                 </create>
1933                 <retrieve/>
1934                 <update permission="UPDATE_COPY">
1935                     <context link="target_copy" field="circ_lib"/>
1936                 </update>
1937                 <delete permission="UPDATE_COPY">
1938                     <context link="target_copy" field="circ_lib"/>
1939                 </delete>
1940             </actions>
1941         </permacrud>
1942         </class>
1943
1944         <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">
1945                 <fields oils_persist:primary="code">
1946                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1947                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1948                 </fields>
1949                 <links/>
1950         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1951             <actions>
1952                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1953                 <retrieve/>
1954                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1955                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1956             </actions>
1957         </permacrud>
1958         </class>
1959
1960         <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">
1961                 <fields oils_persist:primary="code">
1962                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1963                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1964                 </fields>
1965                 <links/>
1966         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1967             <actions>
1968                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1969                 <retrieve/>
1970                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1971                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1972             </actions>
1973         </permacrud>
1974         </class>
1975
1976         <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">
1977                 <fields oils_persist:primary="code">
1978                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1979                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1980                 </fields>
1981                 <links/>
1982         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1983             <actions>
1984                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1985                 <retrieve/>
1986                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1987                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1988             </actions>
1989         </permacrud>
1990         </class>
1991
1992     <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">
1993         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1994             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1995             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1996             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1997             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1998             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1999             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
2000             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
2001             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
2002             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
2003             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
2004             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
2005             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
2006             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
2007             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
2008             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
2009             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2010             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2011         </fields>
2012         <links/>
2013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2014             <actions>
2015                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2016                 <retrieve/>
2017                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2018                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2019             </actions>
2020         </permacrud>
2021     </class>
2022
2023     <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">
2024         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2025             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2026             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2027             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2028             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2029             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2030             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2031             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2032             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2033             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2034             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2035             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2036             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2037             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2038             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2039             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2040             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2041             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2042             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2043             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2044         </fields>
2045         <links/>
2046         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2047             <actions>
2048                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2049                 <retrieve/>
2050                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2051                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2052             </actions>
2053         </permacrud>
2054     </class>
2055
2056     <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">
2057         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2058             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2059             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2060             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2061             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2062             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2063         </fields>
2064         <links>
2065             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2066             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2067             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2068         </links>
2069         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2070             <actions>
2071                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2072                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2073                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2074                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2075             </actions>
2076         </permacrud>
2077     </class>
2078
2079         <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">
2080                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2081                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2082                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2083                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2084                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2085                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2086                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2087                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2088                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2089                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2090                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2091                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2092                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2093                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2094                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2095                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2096                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2097             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2098                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2099                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2100                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2101                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2102                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2103                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2104                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2105                 </fields>
2106                 <links>
2107                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2108                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2109                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2110                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2111                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2112                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2113                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2114                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2115                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2116                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2117                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2118                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2119                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2120             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2121                 </links>
2122         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2123             <actions>
2124                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2125                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2126                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2127                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2128             </actions>
2129         </permacrud>
2130         </class>
2131
2132         <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">
2133                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2134                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2135                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2136                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2137                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2138                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2139                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2140                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2141                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2142                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2143                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2144                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2145                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2146                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2147                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2148                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2149             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2150                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2151                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2152             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2153                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2154                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2155                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2156                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2157             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2158             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2159             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2160                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2161                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2162                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2163                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2164                 </fields>
2165                 <links>
2166                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2167                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2168                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2169                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2170                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2171                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2172                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2173                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2174                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2175                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2176                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2177                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2178                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2179                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2180             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2181                 </links>
2182         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2183             <actions>
2184                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2185                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2186                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2187                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2188             </actions>
2189         </permacrud>
2190         </class>
2191
2192     <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">
2193         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2194             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2195             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2196             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2197         </fields>
2198         <links/>
2199         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2200             <actions>
2201                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2202                 <retrieve/>
2203                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2204                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2205             </actions>
2206         </permacrud>
2207     </class>
2208
2209     <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">
2210         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2211             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2212             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2213             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2214             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2215             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2216             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2217             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2218         </fields>
2219         <links>
2220             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2221         </links>
2222         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2223             <actions>
2224                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2225                 <retrieve/>
2226                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2227                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2228             </actions>
2229         </permacrud>
2230     </class>
2231
2232     <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">
2233         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2234             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2235             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2236             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2237             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2238             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2239         </fields>
2240         <links>
2241             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2242             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2243         </links>
2244         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2245             <actions>
2246                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2247                     <context link="matchpoint" field="org_unit"/>
2248                 </create>
2249                 <retrieve/>
2250                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2251                     <context link="matchpoint" field="org_unit"/>
2252                 </update>
2253                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2254                     <context link="matchpoint" field="org_unit"/>
2255                 </delete>
2256             </actions>
2257         </permacrud>
2258     </class>
2259
2260     <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">
2261         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2262             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2263             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2264             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2265         </fields>
2266         <links>
2267             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2268             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2269         </links>
2270         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2271             <actions>
2272                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2273                     <context link="limit_set" field="owning_lib"/>
2274                 </create>
2275                 <retrieve/>
2276                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2277                     <context link="limit_set" field="owning_lib"/>
2278                 </update>
2279                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2280                     <context link="limit_set" field="owning_lib"/>
2281                 </delete>
2282             </actions>
2283         </permacrud>
2284     </class>
2285     <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">
2286         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2287             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2288             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2289             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2290         </fields>
2291         <links>
2292             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2293             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2294         </links>
2295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2296             <actions>
2297                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2298                     <context link="limit_set" field="owning_lib"/>
2299                 </create>
2300                 <retrieve/>
2301                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2302                     <context link="limit_set" field="owning_lib"/>
2303                 </update>
2304                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2305                     <context link="limit_set" field="owning_lib"/>
2306                 </delete>
2307             </actions>
2308         </permacrud>
2309     </class>
2310
2311     <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">
2312         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2313             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2314             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2315             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2316             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2317         </fields>
2318         <links>
2319             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2320             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2321         </links>
2322         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2323             <actions>
2324                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2325                     <context link="limit_set" field="owning_lib"/>
2326                 </create>
2327                 <retrieve/>
2328                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2329                     <context link="limit_set" field="owning_lib"/>
2330                 </update>
2331                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                     <context link="limit_set" field="owning_lib"/>
2333                 </delete>
2334             </actions>
2335         </permacrud>
2336     </class>
2337
2338         <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">
2339                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2340                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2341                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2342                 </fields>
2343                 <links/>
2344         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2345             <actions>
2346                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2347                 <retrieve/>
2348                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2349                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2350             </actions>
2351         </permacrud>
2352         </class>
2353
2354         <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">
2355                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2356                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2357                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2358                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2359                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2360                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2361                 </fields>
2362                 <links>
2363                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2364                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2365                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2366                 </links>
2367         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2368             <actions>
2369                 <create permission="ADMIN_SURVEY">
2370                     <context link="survey" field="owner"/>
2371                 </create>
2372                 <retrieve/>
2373                 <update permission="ADMIN_SURVEY">
2374                     <context link="survey" field="owner"/>
2375                 </update>
2376                 <delete permission="ADMIN_SURVEY">
2377                     <context link="survey" field="owner"/>
2378                 </delete>
2379             </actions>
2380         </permacrud>
2381         </class>
2382         <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">
2383                 <fields oils_persist:primary="id" oils_persist:sequence="">
2384                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2385                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2386                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2387                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2388                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2389                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2390                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2391                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2392                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2393                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2394                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2395                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2396                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2397                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2398                 </fields>
2399                 <links>
2400                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2401                 </links>
2402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2403                         <actions>
2404                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2405                                         <context link="usr" field="home_ou" />
2406                                 </retrieve>
2407                         </actions>
2408                 </permacrud>
2409         </class>
2410         <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">
2411                 <fields oils_persist:primary="id" oils_persist:sequence="">
2412                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2413                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2414                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2415                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2416                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2417                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2418                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2419                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2420                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2421                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2422                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2423                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2424                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2425                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2426                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2427                 </fields>
2428                 <links>
2429                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2430                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2431                 </links>
2432         </class>
2433         <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">
2434                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2435                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2436                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2437                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2438                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2439                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2440                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2441                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2442                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2443                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2444                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2445                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2446                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2447                 </fields>
2448                 <links>
2449                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2450                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2451                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2452                 </links>
2453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2454                         <actions> <!-- created magically, so no create action -->
2455                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2456                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2457                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2458                         </actions>
2459                 </permacrud>
2460         </class>
2461         <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)">
2462                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2463                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2464                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2465                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2466                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2467                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2468                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2469                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2470                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2471                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2472                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2473                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2474                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2475                 </fields>
2476                 <links>
2477                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2478                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2479                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2480                 </links>
2481                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2482                         <actions> <!-- created magically, so no create action -->
2483                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2484                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2485                         </actions>
2486                 </permacrud>
2487         </class>
2488         <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">
2489         <fields oils_persist:primary="id">
2490                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2491                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2492                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2493                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2494                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2495                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2496                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2497                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2498                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2499                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2500                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2501                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2502                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2503                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2504                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2505                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2506                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2507                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2508                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2509                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2510                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2511                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2512                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2513                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2514                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2515                 </fields>
2516                 <links>
2517                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2518                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2519                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2520                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2521                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2522                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2523                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2524                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2525                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2526                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2527                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2528                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2529                 </links>
2530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2531                         <actions> <!-- created magically, so no create action -->
2532                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2533                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2534                         </actions>
2535                 </permacrud>
2536         </class>
2537
2538         <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">
2539                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2540                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2541                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2542                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2543                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2544                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2545                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2546                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2547                 </fields>
2548                 <links>
2549                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2550                 </links>
2551                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2552                         <actions>
2553                                 <create permission="UPDATE_USER">
2554                                         <context link="usr" field="home_ou"/>
2555                                 </create>
2556                                 <retrieve permission="VIEW_USER">
2557                                         <context link="usr" field="home_ou"/>
2558                                 </retrieve>
2559                                 <update permission="UPDATE_USER">
2560                                         <context link="usr" field="home_ou"/>
2561                                 </update>
2562                                 <delete permission="UPDATE_USER">
2563                                         <context link="usr" field="home_ou"/>
2564                                 </delete>
2565                         </actions>
2566                 </permacrud>
2567         </class>
2568         <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">
2569                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2570                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2571                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2572                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2573                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2574                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2575                 </fields>
2576                 <links>
2577                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2578                 </links>
2579         </class>
2580         <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">
2581                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2582                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2583                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2584                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2585                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2586                 </fields>
2587                 <links>
2588                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2589                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2590                 </links>
2591                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2592                         <actions>
2593                                 <retrieve permission="VIEW_USER">
2594                                         <context link="usr" field="home_ou" />
2595                                 </retrieve>
2596                         </actions>
2597                 </permacrud>
2598         </class>
2599         <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">
2600                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2601                         <field name="field" reporter:datatype="link"/>
2602                         <field name="id" reporter:datatype="id" />
2603                         <field name="source" reporter:datatype="link"/>
2604                         <field name="value" reporter:datatype="text"/>
2605                 </fields>
2606                 <links>
2607                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2608                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2609                 </links>
2610         </class>
2611         <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">
2612                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2613                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2614                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2615                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2616                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2617                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2618                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2619                 </fields>
2620                 <links>
2621                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2622                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2623                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2624                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2625                 </links>
2626                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2627                         <actions>
2628                                 <retrieve/>
2629                         </actions>
2630                 </permacrud>
2631         </class>
2632         <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">
2633                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2634                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2635                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2636                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2637                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2638                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2639                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2640                 </fields>
2641                 <links>
2642                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2643                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2644                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2645                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2646                 </links>
2647                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2648                         <actions>
2649                                 <retrieve/>
2650                         </actions>
2651                 </permacrud>
2652         </class>
2653         <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">
2654                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2655                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2656                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2657                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2658                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2659                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2660                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2661                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2662                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2663                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2664                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2665                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2666                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2667                 </fields>
2668                 <links>
2669                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2670                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2671                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2672                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2673                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2674                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2675                 </links>
2676         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2677             <actions>
2678                 <create permission="TRANSIT_COPY" context_field="owner">
2679                     <context link="target_copy" field="circ_lib"/>
2680                 </create>
2681                 <retrieve/>
2682                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2683                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2684             </actions>
2685         </permacrud>
2686         </class>
2687         <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">
2688                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2689                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2690                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2691                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2692                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2693                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2694                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2695                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2696                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2697                 </fields>
2698                 <links>
2699                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2700                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2701                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2702                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2703                 </links>
2704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2705             <actions>
2706                 <create permission="ADMIN_SURVEY">
2707                     <context link="survey" field="owner"/>
2708                 </create>
2709                 <retrieve permission="VIEW_USER">
2710                     <context link="usr" field="home_ou"/>
2711                 </retrieve>
2712                 <update permission="ADMIN_SURVEY">
2713                     <context link="survey" field="owner"/>
2714                 </update>
2715                 <delete permission="ADMIN_SURVEY">
2716                     <context link="survey" field="owner"/>
2717                 </delete>
2718             </actions>
2719         </permacrud>
2720         </class>
2721         <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">
2722                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2723                         <field name="bucket" reporter:datatype="link"/>
2724                         <field name="id" reporter:datatype="id" />
2725                         <field name="target_copy" reporter:datatype="link"/>
2726                         <field name="create_time" reporter:datatype="timestamp" />
2727                         <field name="pos" reporter:datatype="int" />
2728                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2729                 </fields>
2730                 <links>
2731                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2732                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2733             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2734                 </links>
2735                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2736                         <actions>
2737                                 <retrieve permission="ADMIN_COPY_BUCKET">
2738                     <context link="bucket" field="owning_lib"/>
2739                 </retrieve>
2740             </actions>
2741         </permacrud>
2742         </class>
2743         <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">
2744                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2745                         <field name="id" reporter:datatype="id" />
2746                         <field name="item" reporter:datatype="link"/>
2747                         <field name="note" reporter:datatype="text" />
2748                 </fields>
2749                 <links>
2750                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2751                 </links>
2752         </class>
2753
2754         <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">
2755                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2756                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2757                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2758                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2759                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2760                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2761                 </fields>
2762                 <links>
2763                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2764                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2765                 </links>
2766                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2767                         <actions>
2768                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2769                                 <retrieve/>
2770                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2771                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2772                         </actions>
2773                 </permacrud>
2774         </class>
2775
2776         <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">
2777                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2778                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2779                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2780                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2781                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2782                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2783                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2784                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2785                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2786                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2787                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2788                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2789                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2790                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2791                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2792                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2793                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2794                 </fields>
2795                 <links>
2796                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2797                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2798                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2799                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2800                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2801                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2802                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2803                 </links>
2804                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2805                         <actions>
2806                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2807                                 <retrieve/>
2808                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2809                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2810                         </actions>
2811                 </permacrud>
2812         </class>
2813
2814         <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">
2815                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2816                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2817                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2818                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2819                 </fields>
2820                 <links>
2821                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2822                 </links>
2823                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2824                         <actions>
2825                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2826                                 <retrieve/>
2827                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2828                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2829                         </actions>
2830                 </permacrud>
2831         </class>
2832
2833         <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">
2834                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2835                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2836                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2837                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2838                 </fields>
2839                 <links>
2840                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2841                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2842                 </links>
2843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2844                         <actions>
2845                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2846                                 <retrieve/>
2847                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2848                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2849                         </actions>
2850                 </permacrud>
2851         </class>
2852
2853         <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">
2854                 <fields oils_persist:primary="code">
2855                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2856                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2857                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2858                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2859                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2860                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2861                 </fields>
2862                 <links>
2863                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2864                 </links>
2865                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2866                         <actions>
2867                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2868                                 <retrieve/>
2869                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2870                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2871                         </actions>
2872                 </permacrud>
2873         </class>
2874
2875         <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">
2876                 <fields oils_persist:primary="code">
2877                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2878                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2879                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2880                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2881                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2882                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2883                 </fields>
2884                 <links>
2885                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2886                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2887                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2888                 </links>
2889                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2890                         <actions>
2891                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2892                                 <retrieve/>
2893                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2894                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2895                         </actions>
2896                 </permacrud>
2897         </class>
2898
2899     <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">
2900         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2901             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2902             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2903             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2904         </fields>
2905         <links>
2906             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2907             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2908         </links>
2909         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2910             <actions>
2911                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2912                 <retrieve/>
2913                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2914                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2915             </actions>
2916         </permacrud>
2917     </class>
2918
2919         <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">
2920                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2921                         <field name="active" reporter:datatype="bool"/>
2922                         <field name="create_date" reporter:datatype="timestamp"/>
2923                         <field name="creator" />
2924                         <field name="deleted" reporter:datatype="bool"/>
2925                         <field name="edit_date" reporter:datatype="timestamp"/>
2926                         <field name="editor" />
2927                         <field name="id" reporter:datatype="id" />
2928                         <field name="last_xact_id" />
2929                         <field name="marc" />
2930                         <field name="source" />
2931                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2932                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2933                         <field name="heading" />
2934                         <field name="simple_heading" />
2935                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2936                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2937                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2938                 </fields>
2939                 <links>
2940                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2941                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2942                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2943                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2944                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2945                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2946                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2947                 </links>
2948                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2949                         <actions>
2950                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2951                                 <retrieve/>
2952                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2953                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2954                         </actions>
2955                 </permacrud>
2956         </class>
2957         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2958                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2959                         <field name="char_encoding" />
2960                         <field name="id" />
2961                         <field name="record" />
2962                         <field name="record_status" />
2963                         <field name="thesaurus" />
2964                 </fields>
2965                 <links>
2966                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2967                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2968                 </links>
2969         </class>
2970         <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">
2971                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2972                         <field name="id" reporter:datatype="id" />
2973                         <field name="bib" reporter:datatype="link" />
2974                         <field name="authority" reporter:datatype="link" />
2975                 </fields>
2976                 <links>
2977                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2978                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2979                 </links>
2980                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2981                         <actions>
2982                                 <retrieve/>
2983                         </actions>
2984                 </permacrud>
2985         </class>
2986         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2987                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2988                         <field name="id" reporter:datatype="id" />
2989                         <field name="record" reporter:datatype="link" />
2990                         <field name="atag" reporter:datatype="link" />
2991                         <field name="value" reporter:datatype="text" />
2992                         <field name="thesaurus" reporter:datatype="text" />
2993                 </fields>
2994                 <links>
2995                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2996                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2997                 </links>
2998         </class>
2999
3000         <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">
3001                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3002                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3003                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3004                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3005                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3006                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3007                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3008                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3009                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3010                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3011                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3012                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3013                 </fields>
3014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3015                         <actions>
3016                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3017                                 <retrieve/>
3018                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3019                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3020                         </actions>
3021                 </permacrud>
3022         </class>
3023
3024         <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">
3025                 <fields oils_persist:primary="code" oils_persist:sequence="">
3026                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3027                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3028                 </fields>
3029                 <links/>
3030         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3031             <actions>
3032                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3033                 <retrieve/>
3034                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3035                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3036             </actions>
3037         </permacrud>
3038         </class>
3039         <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">
3040                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3041                         <field name="accepting_usr" />
3042                         <field name="amount" reporter:datatype="money" />
3043                         <field name="amount_collected" reporter:datatype="money" />
3044                         <field name="approval_code" reporter:datatype="text"/>
3045                         <field name="cash_drawer" reporter:datatype="link"/>
3046                         <field name="cc_number" reporter:datatype="text"/>
3047                         <field name="cc_order_number" reporter:datatype="text"/>
3048                         <field name="cc_processor" reporter:datatype="text"/>
3049                         <field name="id" reporter:datatype="id" />
3050                         <field name="note" reporter:datatype="text"/>
3051                         <field name="payment_ts" reporter:datatype="timestamp"/>
3052                         <field name="xact" reporter:datatype="link"/>
3053                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3054                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3055                 </fields>
3056                 <links>
3057                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3058                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3059                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3060                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3061                 </links>
3062         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3063             <actions>
3064                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3065                     <context link="xact" jump="usr" field="home_ou"/>
3066                 </retrieve>
3067                         </actions>
3068                 </permacrud>
3069         </class>
3070         <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">
3071                 <fields oils_persist:primary="name">
3072                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3073                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3074                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3075                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3076                 </fields>
3077                 <links/>
3078         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3079             <actions>
3080                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3081                 <retrieve/>
3082                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3083                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3084             </actions>
3085         </permacrud>
3086         </class>
3087
3088         <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">
3089                 <fields oils_persist:primary="alias">
3090                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3091                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3092                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3093                 </fields>
3094                 <links>
3095                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3096                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3097                 </links>
3098         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3099             <actions>
3100                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3101                 <retrieve/>
3102                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3103                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3104             </actions>
3105         </permacrud>
3106         </class>
3107
3108         <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">
3109                 <fields oils_persist:primary="name">
3110                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3111                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3112                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3113                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3114                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3115                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3116                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3117                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3118                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3119                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3120                 </fields>
3121                 <links>
3122                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3123                 </links>
3124         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3125             <actions>
3126                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3127                 <retrieve/>
3128                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3129                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3130             </actions>
3131         </permacrud>
3132         </class>
3133
3134         <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">
3135                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3136                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3137                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3138                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3139                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3140                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3141                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3142                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3143                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3144                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3145                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3146                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3147                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3148                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3149                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3150                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3151                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3152                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3153                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3154                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3155                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3156                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3157                 </fields>
3158                 <links>
3159                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3160                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3161                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3162                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3163                 </links>
3164         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3165             <actions>
3166                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3167                 <retrieve/>
3168                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3169                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3170             </actions>
3171         </permacrud>
3172         </class>
3173
3174         <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">
3175                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3176                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3177                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3178                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3179                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3180                 </fields>
3181                 <links>
3182                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3183                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3184                 </links>
3185         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3186             <actions>
3187                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3188                 <retrieve/>
3189                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3190                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3191             </actions>
3192         </permacrud>
3193         </class>
3194
3195         <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">
3196                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3197                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3198                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3199                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3200                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3201                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3202                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3203                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3204                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3205                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3206                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3207                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3208                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3209                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3210                 </fields>
3211                 <links>
3212                 </links>
3213                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3214                         <actions>
3215                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3216                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3217                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3218                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3219                         </actions>
3220                 </permacrud>
3221         </class>
3222         <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">
3223                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3224                         <field name="id" reporter:datatype="id" />
3225                         <field name="name" reporter:datatype="text"/>
3226                         <field name="xpath" reporter:datatype="text"/>
3227                         <field name="format" reporter:datatype="link"/>
3228                         <field name="first_word" reporter:datatype="bool" />
3229                 </fields>
3230                 <links/>
3231         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3232             <actions>
3233                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3234                 <retrieve/>
3235                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3236                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3237             </actions>
3238         </permacrud>
3239         </class>
3240         <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">
3241                 <fields oils_persist:primary="code" oils_persist:sequence="">
3242                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3243                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3244                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3245                 </fields>
3246                 <links/>
3247         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3248             <actions>
3249                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3250                 <retrieve/>
3251                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3252                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3253             </actions>
3254         </permacrud>
3255         </class>
3256         <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">
3257                 <fields oils_persist:primary="code" oils_persist:sequence="">
3258                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3259                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3260                 </fields>
3261                 <links/>
3262         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3263             <actions>
3264                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3265                 <retrieve/>
3266                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3267                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3268             </actions>
3269         </permacrud>
3270         </class>
3271     <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">
3272         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3273             <field reporter:label="ID" name="id" reporter:datatype="id" />
3274             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3275             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3276             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3277             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3278             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3279             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3280             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3281                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3282         </fields>
3283         <links>
3284             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3285             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3286             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3287                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3288         </links>
3289         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3290             <actions>
3291                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3292                 <retrieve/>
3293                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3294                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3295             </actions>
3296         </permacrud>
3297     </class>
3298     <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">
3299         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3300             <field reporter:label="ID" name="id" reporter:datatype="id" />
3301             <field reporter:label="Course" name="course" reporter:datatype="link" />
3302             <field reporter:label="User" name="usr" reporter:datatype="link" />
3303             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3304         </fields>
3305         <links>
3306             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3307             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3308             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3309         </links>
3310         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3311             <actions>
3312                 <create permission="MANAGE_RESERVES">
3313                                         <context link="course" field="owning_lib" />
3314                 </create>
3315                 <retrieve/>
3316                 <update permission="MANAGE_RESERVES">
3317                                         <context link="course" field="owning_lib" />
3318                 </update>
3319                 <delete permission="MANAGE_RESERVES">
3320                                         <context link="course" field="owning_lib" />
3321                 </delete>
3322             </actions>
3323         </permacrud>
3324     </class>
3325     <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">
3326         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3327             <field reporter:label="ID" name="id" reporter:datatype="id" />
3328             <field reporter:label="Course" name="course" reporter:datatype="link" />
3329             <field reporter:label="Item" name="item" reporter:datatype="link" />
3330             <field reporter:label="Record" name="record" reporter:datatype="link" />
3331             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3332             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3333             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3334             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3335             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3336             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3337         </fields>
3338         <links>
3339             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3340             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3341             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3342             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3343             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3344             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3345             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3346         </links>
3347         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3348             <actions>
3349                 <create permission="MANAGE_RESERVES">
3350                                         <context link="course" field="owning_lib" />
3351                 </create>
3352                 <retrieve/>
3353                 <update permission="MANAGE_RESERVES">
3354                                         <context link="course" field="owning_lib" />
3355                 </update>
3356                 <delete permission="MANAGE_RESERVES">
3357                                         <context link="course" field="owning_lib" />
3358                 </delete>
3359             </actions>
3360         </permacrud>
3361     </class>
3362         <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">
3363                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3364                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3365                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3366             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3367                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3368                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3369                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3370                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3371                 </fields>
3372                 <links>
3373             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3374                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3375                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3376                 </links>
3377                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3378                         <actions>
3379                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3380                                 <retrieve/>
3381                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3382                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3383                         </actions>
3384                 </permacrud>
3385         </class>
3386     <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">
3387         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3388             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3389             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3390             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3391         </fields>
3392         <links>
3393             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3394             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3395         </links>
3396         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3397             <actions>
3398                 <create permission="MANAGE_RESERVES">
3399                                         <context link="course" field="owning_lib" />
3400                 </create>
3401                 <retrieve/>
3402                 <update permission="MANAGE_RESERVES">
3403                                         <context link="course" field="owning_lib" />
3404                 </update>
3405                 <delete permission="MANAGE_RESERVES">
3406                                         <context link="course" field="owning_lib" />
3407                 </delete>
3408             </actions>
3409         </permacrud>
3410     </class>
3411         <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">
3412                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3413                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3414                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3415             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3416                 </fields>
3417                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3418                         <actions>
3419                                 <create permission="MANAGE_RESERVES" global_required="true" />
3420                                 <retrieve/>
3421                                 <update permission="MANAGE_RESERVES" global_required="true" />
3422                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3423                         </actions>
3424                 </permacrud>
3425         </class>
3426         
3427     <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">
3428         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3429             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3430             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3431             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3432             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3433         </fields>
3434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3435             <actions>
3436                 <retrieve/>
3437             </actions>
3438         </permacrud>
3439     </class>
3440         <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">
3441                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3442                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3443                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3444                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3445                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3446                 </fields>
3447                 <links>
3448                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3449                 </links>
3450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3451             <actions>
3452                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3453                 <retrieve/>
3454                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3455                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3456             </actions>
3457         </permacrud>
3458         </class>
3459         <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">
3460                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3461                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3462                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3463                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3464                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3465                 </fields>
3466                 <links>
3467                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3468                 </links>
3469         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3470             <actions>
3471                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3472                 <retrieve/>
3473                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3474                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3475             </actions>
3476         </permacrud>
3477         </class>
3478         <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">
3479                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3480                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3481                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3482                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3483                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3484                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3485                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3486                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3487                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3488                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3489                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3490                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3491                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3492                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3493                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3494                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3495                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3496                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3497                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3498                 </fields>
3499                 <links>
3500                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3501                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3502                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3503                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3504                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3505                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3506                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3507                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3508                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3509                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3510                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3511                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3512                 </links>
3513         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3514             <actions>
3515                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3516                 <retrieve/>
3517                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3518                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3519             </actions>
3520         </permacrud>
3521         </class>
3522         <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">
3523                 <fields oils_persist:primary="call_number">
3524                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3525                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3526                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3527                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3528                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3529                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3530                 </fields>
3531                 <links>
3532                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3533                 </links>
3534         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3535             <actions>
3536                 <retrieve/>
3537             </actions>
3538         </permacrud>
3539         </class>
3540         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3541                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3542                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3543                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3544                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3545                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3546                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3547                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3548                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3549                 </fields>
3550                 <links>
3551                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3552                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3553         </links>
3554         </class>
3555         <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">
3556                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3557                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3558                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3559                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3560                 </fields>
3561                 <links>
3562                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3563                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3564                 </links>
3565         </class>
3566         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3567                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3568                         <field name="id" reporter:datatype="id" />
3569                         <field name="value" oils_persist:i18n="true" />
3570                 </fields>
3571                 <links/>
3572         </class>
3573         <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">
3574                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3575                         <field name="balance_owed" reporter:datatype="money" />
3576                         <field name="total_owed" reporter:datatype="money" />
3577                         <field name="total_paid" reporter:datatype="money" />
3578                         <field name="usr" reporter:datatype="link"/>
3579                 </fields>
3580                 <links>
3581                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3582         </links>
3583         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3584             <actions>
3585                 <retrieve permission="VIEW_USER">
3586                     <context link="usr" field="home_ou"/>
3587                 </retrieve>
3588             </actions>
3589         </permacrud>
3590         </class>
3591         <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">
3592                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3593                         <field name="balance_owed" reporter:datatype="money" />
3594                         <field name="total_owed" reporter:datatype="money" />
3595                         <field name="total_paid" reporter:datatype="money" />
3596                         <field name="usr" reporter:datatype="link"/>
3597                 </fields>
3598                 <links>
3599                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3600         </links>
3601         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3602             <actions>
3603                 <retrieve permission="VIEW_USER">
3604                     <context link="usr" field="home_ou"/>
3605                 </retrieve>
3606             </actions>
3607         </permacrud>
3608         </class>
3609         <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">
3610                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3611                         <field name="collector" />
3612                         <field name="enter_time" reporter:datatype="timestamp"/>
3613                         <field name="id" reporter:datatype="id" />
3614                         <field name="location" reporter:datatype="link"/>
3615                         <field name="usr" reporter:datatype="link"/>
3616                 </fields>
3617                 <links>
3618                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3619                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3620                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3621                 </links>
3622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3623             <actions>
3624                 <create permission="money.collections_tracker.create" context_field="location"/>
3625                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3626                 <delete permission="money.collections_tracker.create" context_field="location"/>
3627             </actions>
3628         </permacrud>
3629         </class>
3630         <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">
3631                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3632                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3633                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3634                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3635                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3636                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3637                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3638                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3639                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3640                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3641                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3642                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3643                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3644                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3645                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3646                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3647                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3648                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3649                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3650                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3651                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3652                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3653                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3654                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3655                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3656                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3657                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3658                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3659                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3660                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3661                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3662                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3663                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3664                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3665                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3666                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3667                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3668                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3669                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3670                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3671                 </fields>
3672                 <links>
3673                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3674                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3675                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3676                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3677                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3678                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3679                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3680                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3681                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3682                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3683                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3684                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3685                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3686                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3687                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3688                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3689                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3690                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3691                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3692                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3693                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3694                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3695                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3696                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3697                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3698                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3699                 </links>
3700         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3701             <actions>
3702                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3703                 <retrieve/>
3704                 <update permission="UPDATE_MARC" global_required="true"/>
3705                 <!-- 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. -->
3706                 <delete permission="DELETE_RECORD" global_required="true"/>
3707             </actions>
3708         </permacrud>
3709         </class>
3710         <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">
3711                 <fields oils_persist:primary="id">
3712                         <field name="dow_0_close" />
3713                         <field name="dow_0_open" />
3714                         <field name="dow_1_close" />
3715                         <field name="dow_1_open" />
3716                         <field name="dow_2_close" />
3717                         <field name="dow_2_open" />
3718                         <field name="dow_3_close" />
3719                         <field name="dow_3_open" />
3720                         <field name="dow_4_close" />
3721                         <field name="dow_4_open" />
3722                         <field name="dow_5_close" />
3723                         <field name="dow_5_open" />
3724                         <field name="dow_6_close" />
3725                         <field name="dow_6_open" />
3726                         <field name="id" reporter:datatype="id" />
3727                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3728                 </fields>
3729                 <links>
3730                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3731                 </links>
3732         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3733             <actions>
3734                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3735                 <retrieve/>
3736                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3737                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3738             </actions>
3739         </permacrud>
3740         </class>
3741         <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">
3742                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3743                         <field name="id" reporter:datatype="id" />
3744                         <field name="record" reporter:datatype="link"/>
3745                         <field name="label" reporter:datatype="text"/>
3746                         <field name="label_sortkey" reporter:datatype="text"/>
3747                         <field name="deleted" reporter:datatype="bool"/>
3748                 </fields>
3749                 <links>
3750                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3751                 </links>
3752         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3753             <actions>
3754                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3755                 <retrieve/>
3756                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3757                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3758             </actions>
3759         </permacrud>
3760         </class>
3761         <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">
3762                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3763                         <field name="id" reporter:datatype="id" />
3764                         <field name="target_copy" reporter:datatype="link" />
3765                         <field name="part" reporter:datatype="link"/>
3766                 </fields>
3767                 <links>
3768                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3769                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3770                 </links>
3771         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3772             <actions>
3773                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3774                 <retrieve/>
3775                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3776                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3777             </actions>
3778         </permacrud>
3779         </class>
3780     <class  id="aecc"
3781             controller="open-ils.cstore open-ils.pcrud"
3782             oils_obj:fieldmapper="action::emergency_closing_circulation"
3783             oils_persist:tablename="action.emergency_closing_circulation"
3784             reporter:label="Emergency Closing Circulation Entry"
3785             oils_persist:readonly="true"
3786     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3787         <fields oils_persist:primary="id">
3788             <field name="id" reporter:datatype="id" />
3789             <field name="circulation" reporter:datatype="link" />
3790                         <field name="emergency_closing" reporter:datatype="link"/>
3791             <field name="original_due_date" reporter:datatype="timestamp" />
3792             <field name="process_time" reporter:datatype="timestamp" />
3793         </fields>
3794         <links>
3795             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3796             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3797         </links>
3798         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3799             <actions>
3800                 <retrieve/>
3801             </actions>
3802         </permacrud>
3803     </class>
3804     <class  id="aecr"
3805             controller="open-ils.cstore open-ils.pcrud"
3806             oils_obj:fieldmapper="action::emergency_closing_reservation"
3807             oils_persist:tablename="action.emergency_closing_reservation"
3808             reporter:label="Emergency Closing Reservation Entry"
3809             oils_persist:readonly="true"
3810     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3811         <fields oils_persist:primary="id">
3812             <field name="id" reporter:datatype="id" />
3813             <field name="reservation" reporter:datatype="link" />
3814                         <field name="emergency_closing" reporter:datatype="link"/>
3815             <field name="original_end_time" reporter:datatype="timestamp" />
3816             <field name="process_time" reporter:datatype="timestamp" />
3817         </fields>
3818         <links>
3819             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3820             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3821         </links>
3822         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3823             <actions>
3824                 <retrieve/>
3825             </actions>
3826         </permacrud>
3827     </class>
3828     <class  id="aech"
3829             controller="open-ils.cstore open-ils.pcrud"
3830             oils_obj:fieldmapper="action::emergency_closing_hold"
3831             oils_persist:tablename="action.emergency_closing_hold"
3832             reporter:label="Emergency Closing Hold Entry"
3833             oils_persist:readonly="true"
3834     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3835         <fields oils_persist:primary="id">
3836             <field name="id" reporter:datatype="id" />
3837             <field name="hold" reporter:datatype="link" />
3838                         <field name="emergency_closing" reporter:datatype="link"/>
3839             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3840             <field name="process_time" reporter:datatype="timestamp" />
3841         </fields>
3842         <links>
3843             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3844             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3845         </links>
3846         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3847             <actions>
3848                 <retrieve/>
3849             </actions>
3850         </permacrud>
3851     </class>
3852     <class  id="aecs"
3853             controller="open-ils.cstore open-ils.pcrud"
3854             oils_obj:fieldmapper="action::emergency_closing_status"
3855             oils_persist:tablename="action.emergency_closing_status"
3856             reporter:label="Emergency Closing Status"
3857             oils_persist:readonly="true"
3858     >
3859         <fields oils_persist:primary="id">
3860             <field name="id" reporter:datatype="id" />
3861             <field name="creator" reporter:datatype="link" />
3862             <field name="create_time" reporter:datatype="timestamp" />
3863             <field name="process_start_time" reporter:datatype="timestamp" />
3864             <field name="process_end_time" reporter:datatype="timestamp" />
3865             <field name="last_update_time" reporter:datatype="timestamp" />
3866             <field name="circulations" reporter:datatype="int" />
3867             <field name="circulations_complete" reporter:datatype="int" />
3868             <field name="reservations" reporter:datatype="int" />
3869             <field name="reservations_complete" reporter:datatype="int" />
3870             <field name="holds" reporter:datatype="int" />
3871             <field name="holds_complete" reporter:datatype="int" />
3872         </fields>
3873         <links>
3874             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3875         </links>
3876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3877             <actions>
3878                 <retrieve/>
3879             </actions>
3880         </permacrud>
3881     </class>
3882     <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">
3883         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3884             <field name="id" reporter:datatype="id" />
3885             <field name="creator" reporter:datatype="link" />
3886             <field name="create_time" reporter:datatype="timestamp" />
3887             <field name="process_start_time" reporter:datatype="timestamp" />
3888             <field name="process_end_time" reporter:datatype="timestamp" />
3889             <field name="last_update_time" reporter:datatype="timestamp" />
3890             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3891             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3892             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3893             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3894             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3895         </fields>
3896         <links>
3897             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3898             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3899             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3900             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3901             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3902             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3903         </links>
3904         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3905             <actions>
3906                 <create permission="EMERGENCY_CLOSING">
3907                     <context link="closing" field="org_unit" />
3908                 </create>
3909                 <retrieve/>
3910                 <update permission="EMERGENCY_CLOSING">
3911                     <context link="closing" field="org_unit" />
3912                 </update>
3913                 <delete permission="EMERGENCY_CLOSING">
3914                     <context link="closing" field="org_unit" />
3915                 </delete>
3916             </actions>
3917         </permacrud>
3918     </class>
3919         <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">
3920                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3921                         <field name="close_end" reporter:datatype="timestamp" />
3922                         <field name="close_start" reporter:datatype="timestamp" />
3923                         <field name="id" reporter:datatype="id" />
3924                         <field name="org_unit" reporter:datatype="org_unit"/>
3925                         <field name="reason" reporter:datatype="text"/>
3926                         <field name="full_day" reporter:datatype="bool"/>
3927                         <field name="multi_day" reporter:datatype="bool"/>
3928                         <field name="emergency_closing" reporter:datatype="link"/>
3929                 </fields>
3930                 <links>
3931                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3932                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3933                 </links>
3934         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3935             <actions>
3936                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3937                 <retrieve/>
3938                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3939                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3940             </actions>
3941         </permacrud>
3942         </class>
3943         <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">
3944                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3945                         <field name="extended" reporter:datatype="interval"/>
3946                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3947                         <field name="max_renewals" reporter:datatype="int" />
3948                         <field name="name" reporter:datatype="text"/>
3949                         <field name="normal" reporter:datatype="interval"/>
3950                         <field name="shrt" reporter:datatype="interval"/>
3951                         <field name="max_auto_renewals" reporter:datatype="int" />
3952                 </fields>
3953                 <links>
3954                 </links>
3955         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3956             <actions>
3957                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3958                 <retrieve/>
3959                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3960                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3961             </actions>
3962         </permacrud>
3963         </class>
3964
3965         <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">
3966                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3967                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3968                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3969             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3970                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3971             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3972                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
3973                                 reporter:datatype="link" config_field="true"/>
3974                 </fields>
3975                 <links>
3976             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3977                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
3978                 </links>
3979                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3980             <actions>
3981                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3982                 <retrieve/>
3983                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3984                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3985             </actions>
3986                 </permacrud>
3987         </class>
3988
3989         <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">
3990                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3991                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3992                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
3993                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3994             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3995                 </fields>
3996                 <links>
3997                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3998                 </links>
3999                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4000             <actions>
4001                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4002                 <retrieve/>
4003                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4004                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4005             </actions>
4006                 </permacrud>
4007         </class>
4008
4009         <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">
4010                 <fields oils_persist:primary="id" oils_persist:sequence="">
4011                         <field name="balance_owed" reporter:datatype="money"/>
4012                         <field name="id" reporter:datatype="id" />
4013                         <field name="last_billing_note" reporter:datatype="text"/>
4014                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4015                         <field name="last_billing_type" reporter:datatype="text"/>
4016                         <field name="last_payment_note" reporter:datatype="text"/>
4017                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4018                         <field name="last_payment_type" reporter:datatype="text"/>
4019                         <field name="total_owed" reporter:datatype="money"/>
4020                         <field name="total_paid" reporter:datatype="money"/>
4021                         <field name="usr" reporter:datatype="link"/>
4022                         <field name="xact_finish" reporter:datatype="timestamp" />
4023                         <field name="xact_start" reporter:datatype="timestamp" />
4024                         <field name="xact_type" reporter:datatype="text"/>
4025                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4026                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4027                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4028                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4029                         <field name="billing_location" reporter:datatype="link"/>
4030                 </fields>
4031                 <links>
4032                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4033                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4034                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4035                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4036                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4037                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4038                 </links>
4039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4040                         <actions>
4041                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4042                                         <context link="usr" field="home_ou" />
4043                                 </retrieve>
4044                         </actions>
4045                 </permacrud>
4046         </class>
4047         <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">
4048                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4049                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4050                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4051                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4052                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4053                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4054                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4055                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4056                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4057                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4058                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4059                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4060                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4061                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4062                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4063                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4064                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4065                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4066                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4067                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4068                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4069                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4070                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4071                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4072                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4073                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4074                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4075                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4076                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4077                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4078                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4079                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4080                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4081                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4082                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4083                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4084                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4085                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4086                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4087                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4088                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4089                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4090                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4091                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4092                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4093                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4094                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4095                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4096                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4097                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4098                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4099                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4100                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4101                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4102                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4103                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4104                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4105                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4106                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4107                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4108                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4109                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4110                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4111                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4112                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4113                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4114                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4115                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4116                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4117                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4118                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4119                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4120                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4121                 </fields>
4122                 <links>
4123                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4124                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4125                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4126                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4127                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4128                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4129                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4130                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4131                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4132                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4133                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4134                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4135                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4136                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4137                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4138                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4139                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4140                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4141                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4142                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4143                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4144                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4145                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4146                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4147                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4148                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4149                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4150                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4151                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4152                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4153                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4154                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4155                 </links>
4156                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4157                         <actions>
4158                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4159                         </actions>
4160                 </permacrud>
4161         </class>
4162         <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">
4163                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4164                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4165                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4166                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4167                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4168                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4169                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4170                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4171                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4172         </fields>
4173                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4174                         <actions>
4175                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4176                                 <retrieve/>
4177                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4178                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4179                         </actions>
4180                 </permacrud>
4181         </class>
4182         <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">
4183                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4184                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4185                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4186                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4187                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4188         </fields>
4189         <links>
4190                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4191                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4192                 </links>
4193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4194                         <actions>
4195                                 <retrieve permission="RUN_REPORTS">
4196                                         <context link="usr" field="home_ou" />
4197                                 </retrieve>
4198                         </actions>
4199                 </permacrud>
4200         </class>
4201         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4202                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4203                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4204                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4205                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4206                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4207                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4208                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4209         </fields>
4210         <links>
4211                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4212                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4213                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4214                 </links>
4215                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4216                         <actions>
4217                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4218                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4219                                         <context link="usr" field="home_ou" />
4220                                         <context link="ws" field="owning_lib" />
4221                                 </retrieve>
4222                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4223                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4224                         </actions>
4225                 </permacrud>
4226         </class>
4227         <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">
4228                 <fields oils_persist:primary="name">
4229                         <field name="name" reporter:datatype="text"/>
4230                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4231                 </fields>
4232                 <links/>
4233                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4234                         <actions>
4235                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4236                                 <retrieve/>
4237                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4238                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4239                         </actions>
4240                 </permacrud>
4241         </class>
4242         <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">
4243                 <fields oils_persist:primary="name">
4244                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4245                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4246                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4247                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4248                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4249                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4250                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4251                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4252                 </fields>
4253                 <links>
4254                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4255                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4256                 </links>
4257                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4258                         <actions>
4259                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4260                                 <retrieve/>
4261                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4262                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4263                         </actions>
4264                 </permacrud>
4265         </class>
4266         <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">
4267                 <fields oils_persist:primary="name">
4268                         <field name="name" reporter:datatype="text"/>
4269                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4270                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4271                         <field name="datatype" reporter:datatype="text"/>
4272                         <field name="view_perm" reporter:datatype="link"/>
4273                         <field name="update_perm" reporter:datatype="link"/>
4274                         <field name="fm_class" reporter:datatype="text"/>
4275                         <field name="grp" reporter:datatype="link"/>
4276                 </fields>
4277                 <links>
4278                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4279                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4280                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4281                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4282                 </links>
4283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4284                         <actions>
4285                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4286                                 <retrieve/>
4287                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4288                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4289                         </actions>
4290                 </permacrud>
4291         </class>
4292         <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">
4293                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4294                         <field name="id" />
4295                         <field name="name"  reporter:datatype="text"/>
4296                         <field name="org_unit" reporter:datatype="org_unit"/>
4297                         <field name="value"  reporter:datatype="text"/>
4298                 </fields>
4299                 <links>
4300                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4301                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4302                 </links>
4303         </class>
4304         <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">
4305                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4306                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4307                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4308                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4309                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4310                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4311                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4312                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4313                 </fields>
4314                 <links>
4315                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4316                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4317                 </links>
4318         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4319             <actions>
4320                 <create permission="CREATE_COPY_NOTE">
4321                     <context link="owning_copy" field="circ_lib"/>
4322                 </create>
4323                 <retrieve permission="VIEW_COPY_NOTES">
4324                     <context link="owning_copy" field="circ_lib"/>
4325                 </retrieve>
4326                 <update permission="UPDATE_COPY_NOTE">
4327                     <context link="owning_copy" field="circ_lib"/>
4328                 </update>
4329                 <delete permission="DELETE_COPY_NOTE">
4330                     <context link="owning_copy" field="circ_lib"/>
4331                 </delete>
4332             </actions>
4333         </permacrud>
4334         </class>
4335         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4336                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4337                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4338                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4339                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4340                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4341                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4342                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4343                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4344                 </fields>
4345                 <links>
4346                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4347                 </links>
4348         </class>
4349         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4350                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4351                         <field name="fingerprint"  reporter:datatype="text"/>
4352                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4353                         <field name="master_record" reporter:datatype="link"/>
4354                         <field name="mods"  reporter:datatype="text"/>
4355                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4356                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4357                 </fields>
4358                 <links>
4359                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4360                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4361                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4362                 </links>
4363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4364                         <actions>
4365                                 <retrieve/>
4366                         </actions>
4367                 </permacrud>
4368         </class>
4369         <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">
4370                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4371                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4372                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4373                 </fields>
4374                 <links/>
4375         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4376             <actions>
4377                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4378                 <retrieve/>
4379                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4380                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4381             </actions>
4382         </permacrud>
4383         </class>
4384         <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">
4385                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4386                         <field name="code"  reporter:datatype="text"/>
4387                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4388                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4389                 </fields>
4390                 <links/>
4391         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4392             <actions>
4393                 <create permission="CREATE_PERM" global_required="true"/>
4394                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4395                 <update permission="UPDATE_PERM" global_required="true"/>
4396                 <delete permission="DELETE_PERM" global_required="true"/>
4397             </actions>
4398         </permacrud>
4399         </class>
4400         <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">
4401                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4402                         <field name="id" reporter:datatype="id" />
4403                         <field name="metarecord" reporter:datatype="link"/>
4404                         <field name="source" reporter:datatype="link"/>
4405                 </fields>
4406                 <links>
4407                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4408                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4409                 </links>
4410                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4411                         <actions>
4412                                 <retrieve/>
4413                         </actions>
4414                 </permacrud>
4415         </class>
4416         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4417                         oils_obj:fieldmapper="metabib::display_entry" 
4418                         oils_persist:tablename="metabib.display_entry" 
4419                         oils_persist:field_safe="true"
4420                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4421                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4422                         <field name="id" reporter:datatype="id" />
4423                         <field name="field" reporter:datatype="link"/>
4424                         <field name="source" reporter:datatype="link"/>
4425                         <field name="value"  reporter:datatype="text"/>
4426                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4427                 </fields>
4428                 <links>
4429                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4430                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4431                 </links>
4432                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4433                         <actions>
4434                                 <retrieve/>
4435                         </actions>
4436                 </permacrud>
4437         </class>
4438         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4439                 oils_persist:tablename="metabib.flat_display_entry"
4440                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4441                 oils_persist:field_safe="true"
4442                 reporter:label="Flat Display Entry" 
4443                 oils_persist:readonly="true">
4444                 <fields>
4445                         <field name="source" reporter:datatype="id" />
4446                         <field name="name" reporter:datatype="text"/>
4447                         <field name="multi" reporter:datatype="bool"/>
4448                         <field name="label" reporter:datatype="text"/>
4449                         <field name="field" reporter:datatype="link"/>
4450                         <field name="value" reporter:datatype="text"/>
4451                 </fields>
4452                 <links>
4453                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4454                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4455                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4456                 </links>
4457                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4458                         <actions>
4459                                 <retrieve/>
4460                         </actions>
4461                 </permacrud>
4462         </class>
4463         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4464                 oils_persist:tablename="metabib.compressed_display_entry"
4465                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4466                 oils_persist:field_safe="true"
4467                 reporter:label="Compressed Display Entry" 
4468                 oils_persist:readonly="true">
4469                 <fields>
4470                         <field name="source" reporter:datatype="id" />
4471                         <field name="name" reporter:datatype="text"/>
4472                         <field name="multi" reporter:datatype="bool"/>
4473                         <field name="label" reporter:datatype="text"/>
4474                         <field name="field" reporter:datatype="link"/>
4475                         <field name="value" reporter:datatype="text"/>
4476                 </fields>
4477                 <links>
4478                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4479                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4480                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4481                 </links>
4482                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4483                         <actions>
4484                                 <retrieve/>
4485                         </actions>
4486                 </permacrud>
4487         </class>
4488         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4489                 oils_persist:tablename="metabib.wide_display_entry"
4490                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4491                 oils_persist:field_safe="true"
4492                 reporter:label="Wide Display Entry" 
4493                 oils_persist:readonly="true">
4494                 <fields oils_persist:primary="source">
4495                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4496                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4497                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4498                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4499                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4500                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4501                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4502                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4503                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4504                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4505                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4506                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4507                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4508                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4509                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4510                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4511                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4512                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4513                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4514                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4515                 </fields>
4516                 <links>
4517                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4518                 </links>
4519                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4520                         <actions>
4521                                 <retrieve/>
4522                         </actions>
4523                 </permacrud>
4524         </class>
4525
4526         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4527                 oils_persist:tablename="config.display_field_map"
4528                 oils_obj:fieldmapper="config::display_field_map"
4529                 oils_persist:field_safe="true"
4530                 reporter:label="Display Field Map">
4531                 <fields oils_persist:primary="name">
4532                         <field name="name" reporter:datatype="text"/>
4533                         <field name="field" reporter:datatype="link"/>
4534                         <field name="multi" reporter:datatype="bool"/>
4535                 </fields>
4536                 <links>
4537                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4538                 </links>
4539                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4540                         <actions>
4541                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4542                                 <retrieve/>
4543                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4544                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4545                         </actions>
4546                 </permacrud>
4547         </class>
4548
4549         <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">
4550                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4551                         <field name="id" reporter:datatype="id" />
4552                         <field name="field" reporter:datatype="link"/>
4553                         <field name="source" reporter:datatype="link"/>
4554                         <field name="value"  reporter:datatype="text"/>
4555                 </fields>
4556                 <links>
4557                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4558                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4559                 </links>
4560         </class>
4561         <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">
4562                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4563                         <field name="id" reporter:datatype="id" />
4564                         <field name="value" reporter:datatype="text"/>
4565                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4566                 </fields>
4567                 <links>
4568                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4569                 </links>
4570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4571                         <actions>
4572                                 <retrieve/>
4573                         </actions>
4574                 </permacrud>
4575         </class>
4576         <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">
4577                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4578                         <field name="id" reporter:datatype="id" />
4579                         <field name="entry" reporter:datatype="link"/>
4580                         <field name="def" reporter:datatype="link"/>
4581                         <field name="source" reporter:datatype="link"/>
4582                 </fields>
4583                 <links>
4584                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4585                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4586                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4587                 </links>
4588         </class>
4589         <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">
4590                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4591                         <field name="id" reporter:datatype="id" />
4592                         <field name="entry" reporter:datatype="link"/>
4593                         <field name="simple_heading" reporter:datatype="link"/>
4594                 </fields>
4595                 <links>
4596                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4597                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4598                 </links>
4599         </class>
4600         <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">
4601                 <oils_persist:source_definition><![CDATA[
4602                         SELECT * FROM metabib.author_field_entry
4603                                                 UNION ALL
4604                         SELECT * FROM metabib.keyword_field_entry
4605                                                 UNION ALL
4606                         SELECT * FROM metabib.identifier_field_entry
4607                                                 UNION ALL
4608                         SELECT * FROM metabib.title_field_entry
4609                                                 UNION ALL
4610                         SELECT * FROM metabib.subject_field_entry
4611                                                 UNION ALL
4612                         SELECT * FROM metabib.series_field_entry
4613                 ]]></oils_persist:source_definition>
4614                 <fields>
4615                         <field name="field" reporter:datatype="link"/>
4616                         <field name="id" reporter:datatype="id" />
4617                         <field name="source" reporter:datatype="link"/>
4618                         <field name="value"  reporter:datatype="text"/>
4619                 </fields>
4620                 <links>
4621                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4622                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4623                 </links>
4624         </class>
4625         <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">
4626                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4627                         <field name="field" reporter:datatype="link"/>
4628                         <field name="id" reporter:datatype="id" />
4629                         <field name="source" reporter:datatype="link"/>
4630                         <field name="value"  reporter:datatype="text"/>
4631                 </fields>
4632                 <links>
4633                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4634                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4635                 </links>
4636         </class>
4637         <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">
4638                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4639                         <field name="accepting_usr" reporter:datatype="link"/>
4640                         <field name="amount" reporter:datatype="money" />
4641                         <field name="amount_collected" reporter:datatype="money" />
4642                         <field name="cash_drawer" reporter:datatype="link"/>
4643                         <field name="id" reporter:datatype="id" />
4644                         <field name="note"  reporter:datatype="text"/>
4645                         <field name="payment_ts" reporter:datatype="timestamp"/>
4646                         <field name="xact" reporter:datatype="link"/>
4647                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4648                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4649                 </fields>
4650                 <links>
4651                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4652                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4653                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4654                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4655                 </links>
4656         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4657             <actions>
4658                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4659                     <context link="xact" jump="usr" field="home_ou"/>
4660                 </retrieve>
4661                         </actions>
4662                 </permacrud>
4663         </class>
4664         <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">
4665                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4666                         <field name="accepting_usr" reporter:datatype="link"/>
4667                         <field name="amount" reporter:datatype="money" />
4668                         <field name="amount_collected" reporter:datatype="money" />
4669                         <field name="id" reporter:datatype="id" />
4670                         <field name="note"  reporter:datatype="text"/>
4671                         <field name="payment_ts" reporter:datatype="timestamp"/>
4672                         <field name="xact" reporter:datatype="link"/>
4673                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4674                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4675                 </fields>
4676                 <links>
4677                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4678                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4679                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4680                 </links>
4681         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4682             <actions>
4683                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4684                     <context link="xact" jump="usr" field="home_ou"/>
4685                 </retrieve>
4686                         </actions>
4687                 </permacrud>
4688         </class>
4689         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4690                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4691                         <field name="accepting_usr" reporter:datatype="link"/>
4692                         <field name="amount" reporter:datatype="money" />
4693                         <field name="amount_collected" reporter:datatype="money" />
4694                         <field name="id" reporter:datatype="id" />
4695                         <field name="note"  reporter:datatype="text"/>
4696                         <field name="payment_ts" reporter:datatype="timestamp"/>
4697                         <field name="xact" reporter:datatype="link"/>
4698                         <field name="billing" reporter:datatype="link"/>
4699                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4700                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4701                 </fields>
4702                 <links>
4703                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4704                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4705                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4706                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4707                 </links>
4708         </class>
4709         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4710                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4711                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4712                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4713                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4714                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4715                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4716                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4717                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4718                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4719                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4720                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4721                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4722                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4723                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4724                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4725                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4726                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4727                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4728                 </fields>
4729                 <links>
4730                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4731                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4732                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4733                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4734                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4735                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4736                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4737                 </links>
4738         </class>
4739
4740         <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">
4741                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4742                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4743                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4744                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4745                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4746                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4747                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4748                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4749                 </fields>
4750                 <links/>
4751         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4752             <actions>
4753                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4754                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4755                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4756                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4757             </actions>
4758         </permacrud>
4759         </class>
4760         <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">
4761                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4762                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4763                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4764                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4765                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4766                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4767                 </fields>
4768                 <links>
4769                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4770                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4771                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4772         </links>
4773         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4774             <actions>
4775                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4776                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4777                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4778                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4779             </actions>
4780         </permacrud>
4781         </class>
4782         <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">
4783                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4784                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4785                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4786                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4787                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4788             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4789             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4790             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4791             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4792                 </fields>
4793                 <links/>
4794         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4795             <actions>
4796                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4797                 <retrieve/>
4798                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4799                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4800             </actions>
4801         </permacrud>
4802         </class>
4803         <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">
4804                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4805                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4806                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4807                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4808                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4809                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4810                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4811                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4812                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4813                 </fields>
4814                 <links>
4815                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4816                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4817                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4818                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4819                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4820                 </links>
4821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4822                         <actions>
4823                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4824                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4825                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4826                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4827                         </actions>
4828                 </permacrud>
4829         </class>
4830         <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">
4831                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4832                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4833                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4834                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4835                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4836                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4837                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4838                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4839                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4840                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4841                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4842                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4843                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4844                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4845                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4846                 </fields>
4847                 <links>
4848                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4849                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4850                 </links>
4851                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4852                         <actions>
4853                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4854                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4855                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4856                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4857                         </actions>
4858                 </permacrud>
4859         </class>
4860         <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">
4861                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4862                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4863                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4864                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4865                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4866                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4867                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4868                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4869                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4870                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4871                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4872                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4873                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4874                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4875                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4876                 </fields>
4877                 <links>
4878                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4879                 </links>
4880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4881                         <actions>
4882                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4883                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4884                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4885                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4886                         </actions>
4887                 </permacrud>
4888         </class>
4889
4890
4891         <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">
4892                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4893                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4894                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4895                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4896                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4897                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4898                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4899                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4900                 </fields>
4901                 <links>
4902                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4903                 </links>
4904         </class>
4905
4906         <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">
4907                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4908                         <field name="call_number" />
4909                         <field name="create_date" reporter:datatype="timestamp"/>
4910                         <field name="creator" reporter:datatype="link"/>
4911                         <field name="id" reporter:datatype="id" />
4912                         <field name="pub" reporter:datatype="bool"/>
4913                         <field name="title"  reporter:datatype="text"/>
4914                         <field name="value"  reporter:datatype="text"/>
4915                 </fields>
4916                 <links>
4917                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4918                 </links>
4919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4920             <actions>
4921                 <create permission="CREATE_VOLUME_NOTE">
4922                     <context link="call_number" field="owning_lib"/>
4923                 </create>
4924                 <retrieve permission="VIEW_VOLUME_NOTES">
4925                     <context link="call_number" field="owning_lib"/>
4926                 </retrieve>
4927                 <update permission="UPDATE_VOLUME_NOTE">
4928                     <context link="call_number" field="owning_lib"/>
4929                 </update>
4930                 <delete permission="DELETE_VOLUME_NOTE">
4931                     <context link="call_number" field="owning_lib"/>
4932                 </delete>
4933             </actions>
4934         </permacrud>
4935         </class>
4936         <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">
4937                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4938                         <field name="create_date" reporter:datatype="timestamp"/>
4939                         <field name="creator" reporter:datatype="link"/>
4940                         <field name="edit_date" reporter:datatype="timestamp"/>
4941                         <field name="editor" reporter:datatype="link"/>
4942                         <field name="id" reporter:datatype="id" />
4943                         <field name="record" reporter:datatype="link"/>
4944                         <field name="value" reporter:datatype="text"/>
4945                 </fields>
4946                 <links>
4947                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4948                 </links>
4949         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4950             <actions>
4951                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4952                 <retrieve/>
4953                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4954                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4955             </actions>
4956         </permacrud>
4957         </class>
4958         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4959         <oils_persist:source_definition><![CDATA[
4960 SELECT  usr,
4961         SUM(
4962             CASE
4963                 WHEN (
4964                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4965                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4966                 ) THEN 1
4967                 ELSE 0
4968             END
4969         ) AS out,
4970
4971         SUM(
4972             CASE
4973                 WHEN (
4974                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4975                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4976                 ) THEN 1
4977                 ELSE 0
4978             END
4979         ) AS overdue,
4980
4981         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4982         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4983         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4984   FROM  action.circulation
4985   WHERE checkin_time IS NULL
4986   GROUP BY 1
4987         ]]></oils_persist:source_definition>
4988         <fields oils_persist:primary="usr">
4989             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4990             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4991             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4992             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4993             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4994             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4995         </fields>
4996         <links>
4997             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4998         </links>
4999         </class>
5000         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5001         <oils_persist:source_definition><![CDATA[
5002 SELECT  usr,
5003         STRING_AGG(
5004             CASE
5005                 WHEN (
5006                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5007                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5008                 ) THEN id::TEXT
5009                 ELSE '0'
5010             END
5011         ,',') AS out,
5012
5013         STRING_AGG(
5014             CASE
5015                 WHEN (
5016                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5017                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5018                 ) THEN id::TEXT
5019                 ELSE '0'
5020             END
5021         ,',') AS overdue,
5022
5023         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5024         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5025         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5026   FROM  action.circulation
5027   WHERE checkin_time IS NULL
5028   GROUP BY 1
5029         ]]></oils_persist:source_definition>
5030         <fields oils_persist:primary="usr">
5031             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5032             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5033             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5034             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5035             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5036             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5037         </fields>
5038         <links>
5039             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5040         </links>
5041         </class>
5042         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5043                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5044                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5045                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5046                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5047                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5048                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5049                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5050                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5051                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5052                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5053                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5054                 </fields>
5055                 <links>
5056                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5057                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5058                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5059                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5060                 </links>
5061         </class>
5062         <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">
5063                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5064                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5065                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5066                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5067                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5068                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5069                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5070                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5071                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5072                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5073                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5074                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5075                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5076                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5077                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5078                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5079                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5080                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5081                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5082                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5083                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5084                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5085                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5086                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5087                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5088                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5089                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5090                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5091                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5092                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5093                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5094                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5095                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5096                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5097                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5098                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5099                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5100                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5101                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5102                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5103                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5104                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5105                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5106                 </fields>
5107                 <links>
5108                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5109                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5110                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5111                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5112                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5113                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5114                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5115                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5116                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5117                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5118                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5119                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5120                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5121                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5122                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5123                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5124                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5125                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5126                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5127                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5128                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5129                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5130                 </links>
5131                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5132                         <actions>
5133                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5134                         </actions>
5135                 </permacrud>
5136         </class>
5137         <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">
5138                 <fields>
5139                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5140                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5141                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5142                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5143                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5144                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5145                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5146                 </fields>
5147                 <links>
5148                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5149                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5150                 </links>
5151                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5152                         <actions>
5153                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5154                         </actions>
5155                 </permacrud>
5156         </class>
5157         <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">
5158                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5159                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5160                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5161                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5162                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5163                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5164                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5165                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5166                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5167                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5168                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5169                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5170                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5171                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5172                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5173                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5174                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5175                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5176                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5177                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5178                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5179                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5180                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5181                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5182                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5183                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5184                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5185                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5186                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5187                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5188                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5189                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5190                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5191                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5192                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5193                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5194                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5195                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5196                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5197                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5198                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5199                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5200                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5201                 </fields>
5202                 <links>
5203                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5204                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5205                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5206                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5207                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5208                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5209                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5210                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5211                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5212                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5213                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5214                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5215                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5216                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5217                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5218                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5219                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5220                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5221                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5222                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5223                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5224                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5225                 </links>
5226                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5227                         <actions>
5228                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5229                         </actions>
5230                 </permacrud>
5231         </class>
5232
5233         <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">
5234                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5235                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5236                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5237                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5238                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5239                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5240                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5241                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5242                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5243                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5244                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5245                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5246                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5247                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5248                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5249                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5250                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5251                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5252                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5253                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5254                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5255                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5256                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5257                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5258                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5259                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5260                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5261                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5262                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5263                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5264                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5265                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5266                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5267                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5268                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5269                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5270                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5271                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5272                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5273                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5274                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5275                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5276                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5277                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5278                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5279                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5280                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5281                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5282                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5283                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5284                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5285                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5286                 </fields>
5287                 <links>
5288                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5289                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5290                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5291                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5292                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5293                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5294                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5295                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5296                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5297                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5298                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5299                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5300                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5301                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5302                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5303                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5304                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5305                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5306                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5307                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5308                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5309                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5310                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5311                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5312                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5313                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5314                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5315                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5316                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5317                 </links>
5318                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5319                         <actions>
5320                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5321                         </actions>
5322                 </permacrud>
5323         </class>
5324         <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">
5325                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5326                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5327                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5328                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5329                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5330                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5331                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5332                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5333                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5334                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5335                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5336                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5337                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5338                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5339                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5340                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5341                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5342                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5343                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5344                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5345                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5346                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5347                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5348                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5349                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5350                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5351                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5352                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5353                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5354                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5355                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5356                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5357                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5358                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5359                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5360                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5361                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5362                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5363                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5364                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5365                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5366                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5367                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5368                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5369                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5370                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5371                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5372                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5373                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5374                 </fields>
5375                 <links>
5376                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5377                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5378                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5379                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5380                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5381                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5382                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5383                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5384                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5385                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5386                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5387                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5388                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5389                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5390                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5391                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5392                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5393                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5394                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5395                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5396                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5397                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5398                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5399                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5400                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5401                 </links>
5402         </class>
5403         <class id="auch" 
5404                 controller="open-ils.cstore" 
5405                 oils_obj:fieldmapper="action::user_circ_history" 
5406                 oils_persist:tablename="action.usr_circ_history" 
5407                 reporter:label="User Checkout History">
5408                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5409                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5410                         <!-- prevent reporting on the user that owns the checkout history -->
5411                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5412                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5413                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5414                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5415                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5416                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5417                 </fields>
5418                 <links>
5419                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5420                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5421                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5422                 </links>
5423         </class>
5424         <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">
5425                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5426                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5427                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5428                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5429                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5430                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5431                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5432                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5433                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5434                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5435                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5436                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5437                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5438                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5439                 </fields>
5440                 <links>
5441                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5442                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5443                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5444                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5445                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5446                 </links>
5447                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5448                         <actions>
5449                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5450                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5451                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5452                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5453                         </actions>
5454                 </permacrud>
5455         </class>
5456
5457         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5458                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5459                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5460                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5461                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5462                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5463                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5464                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5465                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5466                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5467                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5468                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5469                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5470                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5471                 </fields>
5472                 <links>
5473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5474                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5475                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5476                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5477                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5478                 </links>
5479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5480                         <actions>
5481                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5482                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5483                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5484                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5485                         </actions>
5486                 </permacrud>
5487         </class>
5488         
5489         <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">
5490                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5491                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5492                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5493                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5494                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5495                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5496                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5497                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5498                 </fields>
5499                 <links>
5500                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5501                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5502                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5503                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5504                 </links>
5505                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5506                         <actions>
5507                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5508                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5509                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5510                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5511                         </actions>
5512                 </permacrud>
5513         </class>
5514         
5515         <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">
5516                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5517                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5518                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5519                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5520                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5521                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5522                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5523                 </fields>
5524                 <links>
5525                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5526                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5527                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5528                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5529                 </links>
5530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5531                         <actions>
5532                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5533                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5534                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5535                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5536                         </actions>
5537                 </permacrud>
5538         </class>
5539         
5540         <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">
5541                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5542                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5543                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5544                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5545                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5546                 </fields>
5547                 <links>
5548                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5549                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5550                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5551                 </links>
5552                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5553                         <actions>
5554                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5555                     <context link="resource" field="owner" />
5556                 </create>
5557                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5558                     <context link="resource" field="owner" />
5559                 </retrieve>
5560                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5561                     <context link="resource" field="owner" />
5562                 </update>
5563                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5564                     <context link="resource" field="owner" />
5565                 </delete>
5566                         </actions>
5567                 </permacrud>
5568         </class>
5569         
5570         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5571                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5572                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5573                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5574                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5575                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5576                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5577                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5578                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5579                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5580                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5581                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5582                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5583                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5584                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5585                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5586                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5587                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5588                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5589                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5590                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5591                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5592                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5593                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5594                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5595                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5596                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5597                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5598                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5599                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5600                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5601                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5602                 </fields>
5603                 <links>
5604                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5605                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5606                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5607                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5608                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5609                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5610                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5611                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5612                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5613                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5614                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5615                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5616                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5617                 </links>
5618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5619                         <actions>
5620                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5621                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5622                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5623                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5624                         </actions>
5625                 </permacrud>
5626         </class>
5627         
5628         <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">
5629                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5630                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5631                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5632                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5633                 </fields>
5634                 <links>
5635                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5636                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5637                 </links>
5638                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5639                         <actions>
5640                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5641                                         <context link="reservation" field="pickup_lib"/>
5642                                 </create>
5643                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5644                                         <context link="reservation" field="pickup_lib"/>
5645                                 </retrieve>
5646                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5647                                         <context link="reservation" field="pickup_lib"/>
5648                                 </update>
5649                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5650                                         <context link="reservation" field="pickup_lib"/>
5651                                 </delete>
5652                         </actions>
5653                 </permacrud>
5654         </class>
5655
5656         <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">
5657                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5658                         <field name="bucket" reporter:datatype="link"/>
5659                         <field name="id" reporter:datatype="id" />
5660                         <field name="target_call_number" reporter:datatype="link" />
5661                         <field name="create_time" reporter:datatype="timestamp" />
5662                         <field name="pos" reporter:datatype="int" />
5663                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5664                 </fields>
5665                 <links>
5666                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5667                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5668             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5669                 </links>
5670                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5671                         <actions>
5672                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5673                     <context link="bucket" field="owning_lib"/>
5674                 </retrieve>
5675             </actions>
5676         </permacrud>
5677         </class>
5678         <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">
5679                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5680                         <field name="id" reporter:datatype="id" />
5681                         <field name="item" reporter:datatype="link"/>
5682                         <field name="note" reporter:datatype="text" />
5683                 </fields>
5684                 <links>
5685                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5686                 </links>
5687         </class>
5688         <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">
5689                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5690                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5691                         <field name="btype" reporter:datatype="text"/>
5692                         <field name="id" reporter:datatype="id" />
5693                         <field name="name" reporter:datatype="text"/>
5694                         <field name="description" reporter:datatype="text"/>
5695                         <field name="owner" reporter:datatype="link"/>
5696                         <field name="pub" reporter:datatype="bool"/>
5697                         <field name="create_time" reporter:datatype="timestamp" />
5698                         <field name="owning_lib" reporter:datatype="org_unit" />
5699                 </fields>
5700                 <links>
5701                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5702                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5703                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5704                 </links>
5705                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5706                         <actions>
5707                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5708                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5709                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5710                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5711                         </actions>
5712                 </permacrud>
5713         </class>
5714         <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">
5715                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5716                         <field name="id" reporter:datatype="id" />
5717                         <field name="bucket" reporter:datatype="link"/>
5718                         <field name="note" reporter:datatype="text" />
5719                 </fields>
5720                 <links>
5721                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5722                 </links>
5723         </class>
5724         <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">
5725                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5726                         <field name="hold" reporter:datatype="link"/>
5727                         <field name="id" reporter:datatype="id" />
5728                         <field name="target_copy" reporter:datatype="link"/>
5729                         <field name="proximity" reporter:datatype="number"/>
5730                 </fields>
5731                 <links>
5732                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5733                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5734                 </links>
5735         </class>
5736         <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">
5737                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5738                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5739                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5740                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5741                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5742                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5743                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5744                 </fields>
5745                 <links>
5746                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5747                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5748                 </links>
5749         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5750             <actions>
5751                 <create permission="CREATE_HOLD_NOTIFICATION">
5752                                         <context link="hold" jump="usr" field="home_ou" />
5753                                 </create>
5754                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5755                                         <context link="hold" jump="usr" field="home_ou" />
5756                                 </retrieve>
5757                 <update permission="CREATE_HOLD_NOTIFICATION">
5758                                         <context link="hold" jump="usr" field="home_ou" />
5759                                 </update>
5760                 <delete permission="CREATE_HOLD_NOTIFICATION">
5761                                         <context link="hold" jump="usr" field="home_ou" />
5762                                 </delete>
5763             </actions>
5764         </permacrud>
5765         </class>
5766         <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">
5767                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5768                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5769                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5770                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5771                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5772                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5773                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5774                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5775                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5776                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5777                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5778                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5779                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5780                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5781                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5782                 </fields>
5783                 <links>
5784                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5785                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5786                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5787                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5788                 </links>
5789         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5790             <actions>
5791                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5792                 <retrieve/>
5793                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5794                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5795             </actions>
5796         </permacrud>
5797         </class>
5798         <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">
5799                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5800                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5801                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5802                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5803                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5804             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5805             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5806             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5807                 </fields>
5808                 <links>
5809                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5810                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5811                 </links>
5812         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5813             <actions>
5814                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5815                 <retrieve/>
5816                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5817                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5818             </actions>
5819         </permacrud>
5820         </class>
5821         <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">
5822                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5823                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5824             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5825             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5826                 </fields>
5827                 <links>
5828                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5829                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5830                 </links>
5831         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5832             <actions>
5833                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5834                                         <context link="lgroup" field="owner" />
5835                 </create>
5836                 <retrieve/>
5837                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5838                                         <context link="lgroup" field="owner" />
5839                 </update>
5840                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5841                                         <context link="lgroup" field="owner" />
5842                 </delete>
5843             </actions>
5844         </permacrud>
5845         </class>
5846
5847     <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">
5848         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5849             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5850             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5851             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5852             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5853         </fields>
5854         <links>
5855             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5856             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5857         </links>
5858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5859             <actions>
5860                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5861                 <retrieve/>
5862                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5863                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5864             </actions>
5865         </permacrud>
5866     </class>
5867
5868         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5869                 <fields>
5870                         <field name="sre_id" oils_persist:virtual="true" />
5871                         <field name="location" oils_persist:virtual="true" />
5872                         <field name="owning_lib" oils_persist:virtual="true" />
5873                         <field name="basic_holdings" oils_persist:virtual="true" />
5874                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5875                         <field name="supplement_holdings" oils_persist:virtual="true" />
5876                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5877                         <field name="index_holdings" oils_persist:virtual="true" />
5878                         <field name="index_holdings_add" oils_persist:virtual="true" />
5879                         <field name="online" oils_persist:virtual="true" />
5880                         <field name="missing" oils_persist:virtual="true" />
5881                         <field name="incomplete" oils_persist:virtual="true" />
5882                 </fields>
5883         </class>
5884
5885         <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">
5886                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5887                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5888                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5889                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5890                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5891                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5892                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5893                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5894                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5895                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5896                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5897                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5898                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5899                 </fields>
5900                 <links>
5901                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5902                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5903                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5904                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5905                 </links>
5906                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5907                         <actions>
5908                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5909                                 <retrieve/>
5910                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5911                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5912                         </actions>
5913                 </permacrud>
5914         </class>
5915
5916         <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">
5917                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5918                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5919                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5920                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5921                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5922                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5923                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5924                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5925                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5926                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5927                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5928                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5929                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5930                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5931                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5932                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5933                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5934                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5935                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5936                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5937                 </fields>
5938                 <links>
5939                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5940                 </links>
5941                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5942                         <actions>
5943                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5944                                         <context link="subscription" field="owning_lib" />
5945                                 </create>
5946                                 <retrieve />
5947                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5948                                         <context link="subscription" field="owning_lib" />
5949                                 </update>
5950                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5951                                         <context link="subscription" field="owning_lib" />
5952                                 </delete>
5953                         </actions>
5954                 </permacrud>
5955         </class>
5956
5957         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5958                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5959                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5960                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5961                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5962                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5963                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5964                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5965                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5966                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5967                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5968                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5969                 </fields>
5970                 <links>
5971                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5972                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5973                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5974                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5975                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5976                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5977                 </links>
5978                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5979                         <actions>
5980                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5981                                 <retrieve />
5982                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5983                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5984                         </actions>
5985                 </permacrud>
5986         </class>
5987
5988         <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">
5989                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5990                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5991                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5992                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5993                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5994                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5995                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5996                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5997                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5998                 </fields>
5999                 <links>
6000                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6001                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6002                 </links>
6003                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6004                         <actions>
6005                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6006                     <context link="subscription" field="owning_lib"/>
6007                 </create>
6008                                 <retrieve />
6009                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6010                     <context link="subscription" field="owning_lib"/>
6011                 </update>
6012                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6013                     <context link="subscription" field="owning_lib"/>
6014                 </delete>
6015                         </actions>
6016                 </permacrud>
6017         </class>
6018
6019         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6020                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6021                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6022                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6023                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6024                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6025                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6026                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6027                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6028                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6029                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6030                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6031                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6032                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6033                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6034                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6035                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6036                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6037                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6038                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6039                 </fields>
6040                 <links>
6041                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6042                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6043                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6044                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6045                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6046                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6047                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6048                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6049                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6050                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6051                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6052                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6053                 </links>
6054                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6055                         <actions>
6056                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6057                                 <retrieve />
6058                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6059                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6060                         </actions>
6061                 </permacrud>
6062         </class>
6063
6064         <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">
6065                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6066                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6067                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6068                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6069                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6070                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6071                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6072                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6073                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6074                 </fields>
6075                 <links>
6076                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6077                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6078                 </links>
6079                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6080                         <actions>
6081                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6082                                         <context link="distribution" field="holding_lib" />
6083                                 </create>
6084                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6085                                         <context link="distribution" field="holding_lib" />
6086                                 </retrieve>
6087                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6088                                         <context link="distribution" field="holding_lib" />
6089                                 </update>
6090                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6091                                         <context link="distribution" field="holding_lib" />
6092                                 </delete>
6093                         </actions>
6094                 </permacrud>
6095         </class>
6096
6097         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6098                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6099                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6100                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6101                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6102                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6103                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6104                 </fields>
6105                 <links>
6106                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6107                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6108                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6109                 </links>
6110                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6111                         <actions>
6112                                 <create permission="ADMIN_SERIAL_STREAM">
6113                                         <context link="distribution" field="holding_lib" />
6114                                 </create>
6115                                 <retrieve />
6116                                 <update permission="ADMIN_SERIAL_STREAM">
6117                                         <context link="distribution" field="holding_lib" />
6118                                 </update>
6119                                 <delete permission="ADMIN_SERIAL_STREAM">
6120                                         <context link="distribution" field="holding_lib" />
6121                                 </delete>
6122                         </actions>
6123                 </permacrud>
6124         </class>
6125
6126         <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">
6127                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6128                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6129                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6130                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6131                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6132                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6133                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6134                 </fields>
6135                 <links>
6136                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6137                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6138                 </links>
6139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6140                         <actions>
6141                                 <create permission="ADMIN_SERIAL_STREAM">
6142                                         <context link="stream" jump="distribution" field="holding_lib" />
6143                                 </create>
6144                                 <retrieve permission="RECEIVE_SERIAL">
6145                                         <context link="stream" jump="distribution" field="holding_lib" />
6146                                 </retrieve>
6147                                 <update permission="ADMIN_SERIAL_STREAM">
6148                                         <context link="stream" jump="distribution" field="holding_lib" />
6149                                 </update>
6150                                 <delete permission="ADMIN_SERIAL_STREAM">
6151                                         <context link="stream" jump="distribution" field="holding_lib" />
6152                                 </delete>
6153                         </actions>
6154                 </permacrud>
6155         </class>
6156
6157         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6158                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6159                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6160                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6161                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6162                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6163                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6164                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6165                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6166                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6167                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6168                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6169                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6170                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6171                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6172                 </fields>
6173                 <links>
6174                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6175                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6176                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6177                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6178                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6179                 </links>
6180                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6181                         <actions>
6182                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6183                                         <context link="subscription" field="owning_lib" />
6184                                 </create>
6185                                 <retrieve/>
6186                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6187                                         <context link="subscription" field="owning_lib" />
6188                                 </update>
6189                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6190                                         <context link="subscription" field="owning_lib" />
6191                                 </delete>
6192                         </actions>
6193                 </permacrud>
6194         </class>
6195
6196         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6197                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6198                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6199                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6200                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6201                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6202                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6203                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6204                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6205                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6206                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6207                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6208                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6209                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6210                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6211                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6212                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6213                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6214                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6215                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6216                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6217                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6218                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6219                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6220                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6221                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6222                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6223                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6224                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6225                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6226                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6227                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6228                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6229                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6230                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6231                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6232                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6233                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6234                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6235                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6236                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6237                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6238                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6239                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6240                 </fields>
6241                 <links>
6242                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6243                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6244                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6245                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6246                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6247                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6248                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6249                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6250                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6251                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6252                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6253                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6254                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6255                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6256                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6257                 </links>
6258                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6259                         <actions>
6260                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6261                                 <retrieve/>
6262                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6263                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6264                         </actions>
6265                 </permacrud>
6266         </class>
6267
6268         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6269                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6270                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6271                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6272                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6273                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6274                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6275                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6276                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6277                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6278                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6279                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6280                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6281                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6282                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6283                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6284                 </fields>
6285                 <links>
6286                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6287                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6288                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6289                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6290                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6291                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6292                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6293                 </links>
6294                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6295                         <actions>
6296                                 <create permission="ADMIN_SERIAL_ITEM">
6297                                         <context link="stream" jump="distribution" field="holding_lib" />
6298                                 </create>
6299                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6300                                         <context link="stream" jump="distribution" field="holding_lib" />
6301                                 </retrieve>
6302                                 <update permission="ADMIN_SERIAL_ITEM">
6303                                         <context link="stream" jump="distribution" field="holding_lib" />
6304                                 </update>
6305                                 <delete permission="ADMIN_SERIAL_ITEM">
6306                                         <context link="stream" jump="distribution" field="holding_lib" />
6307                                 </delete>
6308                         </actions>
6309                 </permacrud>
6310         </class>
6311
6312         <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">
6313                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6314                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6315                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6316                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6317                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6318                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6319                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6320                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6321                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6322                 </fields>
6323                 <links>
6324                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6325                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6326                 </links>
6327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6328                         <actions>
6329                                 <create permission="ADMIN_SERIAL_ITEM">
6330                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6331                                 </create>
6332                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6333                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6334                                 </retrieve>
6335                                 <update permission="ADMIN_SERIAL_ITEM">
6336                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6337                                 </update>
6338                                 <delete permission="ADMIN_SERIAL_ITEM">
6339                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6340                                 </delete>
6341                         </actions>
6342                 </permacrud>
6343         </class>
6344         <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">
6345                 <fields>
6346                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6347                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6348                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6349                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6350                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6351                 </fields>
6352                 <links>
6353                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6354                 </links>
6355         </class>
6356         <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">
6357                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6358                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6359                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6360                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6361                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6362                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6363                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6364                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6365                 </fields>
6366                 <links>
6367                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6368                 </links>
6369         </class>
6370         <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">
6371                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6372                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6373                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6374                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6375                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6376                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6377                 </fields>
6378                 <links>
6379                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6380                 </links>
6381                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6382                         <actions>
6383                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6384                                         <context link="distribution" field="holding_lib" />
6385                                 </create>
6386                                 <retrieve/>
6387                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6388                                         <context link="distribution" field="holding_lib" />
6389                                 </update>
6390                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6391                                         <context link="distribution" field="holding_lib" />
6392                                 </delete>
6393                         </actions>
6394                 </permacrud>
6395         </class>
6396
6397         <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">
6398                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6399                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6400                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6401                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6402                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6403                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6404                 </fields>
6405                 <links>
6406                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6407                 </links>
6408                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6409                         <actions>
6410                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6411                                         <context link="distribution" field="holding_lib" />
6412                                 </create>
6413                                 <retrieve/>
6414                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6415                                         <context link="distribution" field="holding_lib" />
6416                                 </update>
6417                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6418                                         <context link="distribution" field="holding_lib" />
6419                                 </delete>
6420                         </actions>
6421                 </permacrud>
6422         </class>
6423
6424         <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">
6425                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6426                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6427                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6428                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6429                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6430                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6431                 </fields>
6432                 <links>
6433                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6434                 </links>
6435                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6436                         <actions>
6437                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6438                                         <context link="distribution" field="holding_lib" />
6439                                 </create>
6440                                 <retrieve/>
6441                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6442                                         <context link="distribution" field="holding_lib" />
6443                                 </update>
6444                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6445                                         <context link="distribution" field="holding_lib" />
6446                                 </delete>
6447                         </actions>
6448                 </permacrud>
6449         </class>
6450
6451         <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">
6452                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6453                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6454                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6455                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6456                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6457                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6458                 </fields>
6459                 <links>
6460                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6461                 </links>
6462                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6463                         <actions>
6464                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6465                                 <retrieve/>
6466                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6467                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6468                         </actions>
6469                 </permacrud>
6470         </class>
6471
6472         <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">
6473                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6474                         <field name="id" reporter:datatype="id" />
6475                         <field name="owning_copy" reporter:datatype="link"/>
6476                         <field name="stat_cat" reporter:datatype="link"/>
6477                         <field name="stat_cat_entry" reporter:datatype="link"/>
6478                 </fields>
6479                 <links>
6480                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6481                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6482                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6483                 </links>
6484                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6485                         <actions>
6486                                 <retrieve/>
6487                         </actions>
6488                 </permacrud>
6489         </class>
6490         <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">
6491                 <fields oils_persist:primary="code">
6492                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6493                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6494                 </fields>
6495                 <links/>
6496         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6497             <actions>
6498                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6499                 <retrieve/>
6500                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6501                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6502             </actions>
6503         </permacrud>
6504         </class>
6505         <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">
6506                 <fields oils_persist:primary="code">
6507                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6508                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6509                 </fields>
6510                 <links/>
6511         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6512             <actions>
6513                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6514                 <retrieve/>
6515                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6516                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6517             </actions>
6518         </permacrud>
6519         </class>
6520         <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">
6521                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6522                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6523                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6524                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6525                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6526                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6527                 </fields>
6528                 <links>
6529             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6530         </links>
6531         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6532             <actions>
6533                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6534                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6535                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6536                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6537             </actions>
6538         </permacrud>
6539         </class>
6540         <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">
6541                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6542                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6543                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6544                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6545                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6546                 </fields>
6547                 <links>
6548                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6549         </links>
6550         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6551             <actions>
6552                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6553                 <retrieve/>
6554                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6555                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6556             </actions>
6557         </permacrud>
6558         </class>
6559         <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">
6560                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6561                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6562                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6563                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6564                 </fields>
6565                 <links>
6566                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6567                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6568                 </links>
6569         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6570             <actions>
6571                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6572                 <retrieve/>
6573                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6574                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6575             </actions>
6576         </permacrud>
6577         </class>
6578         <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">
6579                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6580                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6581                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6582                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6583                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6584                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6585                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6586                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6587                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6588                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6589                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6590                 </fields>
6591                 <links>
6592                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6593                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6594                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6595                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6596                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6597                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6598                 </links>
6599         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6600             <actions>
6601                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6602                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6603                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6604                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6605             </actions>
6606         </permacrud>
6607         </class>
6608         <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">
6609                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6610                         <field name="id" reporter:datatype="id" />
6611                         <field name="from_org" reporter:datatype="org_unit"/>
6612                         <field name="to_org" reporter:datatype="org_unit"/>
6613                         <field name="prox" reporter:datatype="int" />
6614                 </fields>
6615                 <links>
6616                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6617                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6618                 </links>
6619         </class>
6620         <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">
6621                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6622                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6623                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6624                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6625                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6626                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6627                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6628                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6629                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6630                 </fields>
6631                 <links/>
6632         </class>
6633         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6634                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6635                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6636                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6637                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6638                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6639                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6640                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6641                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6642                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6643                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6644                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6645                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6646                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6647                 </fields>
6648                 <links>
6649                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6650                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6651                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6652                 </links>
6653         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6654             <actions>
6655                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6656                 <retrieve/>
6657                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6658                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6659             </actions>
6660         </permacrud>
6661         </class>
6662         <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">
6663                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6664                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6665                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6666                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6667                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6668                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6669                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6670                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6671                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6672                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6673                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6674                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6675                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6676                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6677                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6678                 </fields>
6679                 <links>
6680                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6681                 </links>
6682         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6683             <actions>
6684                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6685                 <retrieve/>
6686                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6687                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6688             </actions>
6689         </permacrud>
6690         </class>
6691         <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">
6692                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6693                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6694                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6695                         <field name="query_text" reporter:datatype="text"/>
6696                 </fields>
6697         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6698             <actions>
6699                 <retrieve/>
6700             </actions>
6701         </permacrud>
6702         </class>
6703
6704         <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">
6705                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6706                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6707                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6708                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6709                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6710                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6711                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6712                 </fields>
6713                 <links>
6714                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6715                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6716                 </links>
6717         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6718             <actions>
6719                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6720                 <retrieve/>
6721                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6722                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6723             </actions>
6724         </permacrud>
6725         </class>
6726         <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">
6727                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6728                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6729                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6730                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6731                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6732                 </fields>
6733                 <links>
6734                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6735                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6736                 </links>
6737         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6738             <actions>
6739                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6740                     <context link="grp" field="owner"/>
6741                 </create>
6742                 <retrieve/>
6743                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6744                     <context link="grp" field="owner"/>
6745                 </update>
6746                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6747                     <context link="grp" field="owner"/>
6748                 </delete>
6749             </actions>
6750         </permacrud>
6751         </class>
6752
6753         <!-- A note: Please update alhr and ahopl when updating ahr -->
6754         <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">
6755                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6756                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6757                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6758                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6759                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6760                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6761                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6762                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6763                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6764                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6765                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6766                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6767                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6768                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6769                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6770                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6771                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6772                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6773                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6774                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6775                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6776                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6777                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6778                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6779                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6780                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6781                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6782                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6783                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6784                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6785                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6786                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6787                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6788                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6789                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6790                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6791                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6792                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6793                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6794                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6795                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6796                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6797                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6798                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6799                 </fields>
6800                 <links>
6801                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6802                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6803                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6804                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6805                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6806                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6807                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6808                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6809                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6810                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6811                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6812                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6813                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6814                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6815                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6816                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6817                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6818                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6819                 </links>
6820                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6821                         <actions>
6822                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6823                         </actions>
6824                 </permacrud>
6825         </class>
6826         <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">
6827                 <oils_persist:source_definition><![CDATA[
6828                 SELECT
6829                         ahr.*,
6830                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6831                                 copy_location_order_position,
6832                         CASE WHEN au.alias IS NOT NULL THEN
6833                                 au.alias
6834                         ELSE
6835                                 au.first_given_name
6836                         END AS usr_alias_or_first_given_name,
6837                         au.first_given_name AS usr_first_given_name,
6838                         au.second_given_name AS usr_second_given_name,
6839                         au.family_name AS usr_family_name,
6840                         au.prefix AS usr_prefix,
6841                         au.suffix AS usr_suffix,
6842                         au.alias AS usr_alias,
6843                         CASE WHEN au.alias IS NOT NULL THEN
6844                                 au.alias
6845                         ELSE
6846                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6847                                         COALESCE(au.family_name, ''),
6848                                         COALESCE(au.suffix, ''),
6849                                         ', ',
6850                                         COALESCE(au.prefix, ''),
6851                                         COALESCE(au.first_given_name, ''),
6852                                         COALESCE(au.second_given_name, '')
6853                                 ], ' '), E'\\s+,', ',')
6854                         END AS usr_alias_or_display_name,
6855                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6856                                 COALESCE(au.family_name, ''),
6857                                 COALESCE(au.suffix, ''),
6858                                 ', ',
6859                                 COALESCE(au.prefix, ''),
6860                                 COALESCE(au.first_given_name, ''),
6861                                 COALESCE(au.second_given_name, '')
6862                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6863                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6864                                 AS call_number_label,
6865                         siss.label AS issuance_label,
6866                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6867                         ahcm_1.copy_count AS potential_copies
6868                 FROM action.hold_request ahr
6869                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6870                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6871                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6872                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6873                 JOIN actor.usr au ON (au.id = ahr.usr)
6874                 JOIN (
6875                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6876                         FROM asset.copy_location
6877                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6878                 LEFT JOIN actor.usr_standing_penalty ausp 
6879                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6880                 LEFT JOIN config.standing_penalty csp
6881                         ON (
6882                                 csp.id = ausp.standing_penalty AND 
6883                                 csp.block_list LIKE '%CAPTURE%' AND (
6884                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6885                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6886                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6887                                         )
6888                                 )
6889                         )
6890                 JOIN (
6891                         SELECT COUNT(target_copy) AS copy_count, hold
6892                         FROM action.hold_copy_map
6893                         GROUP BY 2
6894                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6895                 LEFT JOIN serial.issuance siss
6896                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6897                 LEFT JOIN asset.copy_location_order acplo
6898                         ON (acp.location = acplo.location AND
6899                                 acp.circ_lib = acplo.org)
6900                 WHERE
6901                         ahr.capture_time IS NULL AND
6902                         ahr.cancel_time IS NULL AND
6903                         csp.id IS NULL AND
6904                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6905                         acp.status IN (0,7)
6906                 ]]></oils_persist:source_definition>
6907                 <fields oils_persist:primary="id">
6908                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6909                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6910                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6911                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6912                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6913                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6914                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6915                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6916                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6917                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6918                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6919                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6920                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6921                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6922                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6923                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6924                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6925                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6926                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6927                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6928                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6929                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6930                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6931                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6932                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6933                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6934                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6935                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6936                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6937                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6938                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6939                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6940                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6941                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6942                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6943                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6944                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6945                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6946                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6947                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6948                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6949                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6950                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6951                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6952                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6953                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6954                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6955                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6956                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6957                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6958                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6959                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6960                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6961                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6962                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6963                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6964                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6965                 </fields>
6966                 <links>
6967                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6968                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6969                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6970                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6971                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6972                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6973                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6974                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6975                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6976                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6977                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6978                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6979                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6980                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6981                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6982                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6983                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6984                 </links>
6985                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6986                         <actions>
6987                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6988                         </actions>
6989                 </permacrud>
6990         </class>
6991         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6992                 <oils_persist:source_definition><![CDATA[
6993                         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)
6994                 ]]></oils_persist:source_definition>
6995                 <fields oils_persist:primary="id">
6996                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6997                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6998                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6999                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7000                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7001                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7002                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7003                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7004                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7005                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7006                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7007                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7008                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7009                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7010                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7011                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7012                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7013                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7014                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7015                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7016                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7017                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7018                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7019                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7020                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7021                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7022                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7023                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7024                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7025                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7026                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7027                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7028                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7029                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7030                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7031                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7032                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7033                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7034                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7035                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7036                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7037                 </fields>
7038                 <links>
7039                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7040                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7041                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7042                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7043                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7044                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7045                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7046                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7047                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7048                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7049                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7050                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7051                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7052                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7053                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7054                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7055                 </links>
7056         </class>
7057
7058         <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">
7059                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7060                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7061                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7062                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7063                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7064                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7065                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7066                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7067                 </fields>
7068                 <links>
7069                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7070                 </links>
7071                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7072                         <actions>
7073                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7074                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7075                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7076                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7077                         </actions>
7078                 </permacrud>
7079         </class>
7080         <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">
7081                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7082                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7083                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7084                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7085                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7086                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7087                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7088                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7089                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7090                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7091                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7092                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7093                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7094                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7095                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7096                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7097                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7098                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7099                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7100                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7101                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7102                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7103                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7104                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7105                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7106                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7107                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7108                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7109                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7110                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7111                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7112                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7113                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7114                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7115                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7116                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7117                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7118                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7119                 </fields>
7120                 <links>
7121                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7122                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7123                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7124                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7125                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7126                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7127                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7128                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7129                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7130                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7131                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7132                 </links>
7133                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7134                         <actions>
7135                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7136                         </actions>
7137                 </permacrud>
7138         </class>
7139         <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">
7140                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7141                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7142                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7143                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7144                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7145                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7146                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7147                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7148                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7149                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7150                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7151                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7152                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7153                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7154                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7155                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7156                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7157                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7158                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7159                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7160                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7161                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7162                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7163                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7164                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7165                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7166                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7167                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7168                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7169                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7170                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7171                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7172                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7173                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7174                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7175                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7176                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7177                 </fields>
7178                 <links>
7179                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7180                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7181                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7182                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7183                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7184                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7185                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7186                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7187                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7188                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7189                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7190                 </links>
7191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7192                         <actions>
7193                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7194                         </actions>
7195                 </permacrud>
7196         </class>
7197
7198         <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">
7199                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7200                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7201                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7202                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7203                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7204                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7205                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7206                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7207                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7208                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7209                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7210                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7211                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7212                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7213                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7214                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7215                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7216                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7217                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7218                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7219                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7220                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7221                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7222                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7223                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7224                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7225                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7226                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7227                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7228                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7229                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7230                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7231                 </fields>
7232                 <links>
7233                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7234                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7235                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7236                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7237                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7238                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7239                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7240                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7241                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7242                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7243                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7244                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7245                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7246                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7247                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7248                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7249                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7250                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7251                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7252                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7253                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7254                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7255                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7256                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7257                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7258                 </links>
7259         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7260             <actions>
7261                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7262                 <retrieve />
7263                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7264                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7265             </actions>
7266         </permacrud>
7267         </class>
7268         <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">
7269                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7270                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7271                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7272                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7273                 </fields>
7274                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7275                         <actions>
7276                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7277                                 <retrieve/>
7278                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7279                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7280                         </actions>
7281                 </permacrud>
7282         </class>
7283         <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">
7284                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7285                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7286                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7287                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7288                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7289                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7290                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7291                 </fields>
7292                 <links>
7293                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7294                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7295                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7296                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7297                 </links>
7298                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7299                         <actions>
7300                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7301                                 <retrieve/>
7302                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7303                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7304                         </actions>
7305                 </permacrud>
7306         </class>
7307         <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">
7308                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7309                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7310                         <field name="btype" reporter:datatype="text"/>
7311                         <field name="id" reporter:datatype="id" />
7312                         <field name="name"  reporter:datatype="text"/>
7313                         <field name="description" reporter:datatype="text"/>
7314                         <field name="owner" reporter:datatype="link"/>
7315                         <field name="pub" reporter:datatype="bool"/>
7316                         <field name="create_time" reporter:datatype="timestamp" />
7317                         <field name="owning_lib" reporter:datatype="org_unit" />
7318                 </fields>
7319                 <links>
7320                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7321                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7322                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7323                 </links>
7324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7325                         <actions>
7326                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7327                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7328                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7329                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7330                         </actions>
7331                 </permacrud>
7332         </class>
7333         <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">
7334                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7335                         <field name="id" reporter:datatype="id" />
7336                         <field name="bucket" reporter:datatype="link"/>
7337                         <field name="note" reporter:datatype="text" />
7338                 </fields>
7339                 <links>
7340                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7341                 </links>
7342         </class>
7343         <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">
7344                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7345                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7346                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7347                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7348                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7349                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7350                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7351                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7352                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7353                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7354                 </fields>
7355                 <links>
7356                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7357                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7358                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7359                 </links>
7360                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7361                         <actions>
7362                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7363                         </actions>
7364                 </permacrud>
7365         </class>
7366         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7367                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7368                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7369                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7370                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7371                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7372                 </fields>
7373                 <links>
7374                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7375                 </links>
7376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7377                         <actions>
7378                                 <retrieve permission="VIEW_USER user_request.view">
7379                                         <context link="usr" field="home_ou" />
7380                                 </retrieve>
7381                         </actions>
7382                 </permacrud>
7383         </class>
7384     <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">
7385         <fields oils_persist:primary="field">
7386             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7387             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7388             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7389         </fields>
7390         <links/>
7391         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7392             <actions>
7393                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7394                 <retrieve />
7395                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7396                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7397             </actions>
7398         </permacrud>
7399     </class>
7400         <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">
7401                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7402                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7403                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7404                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7405                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7406                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7407                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7408                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7409                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7410                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7411                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7412                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7413                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7414                 </fields>
7415                 <links>
7416                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7417                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7418                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7419                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7420                 </links>
7421         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7422             <actions>
7423                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7424                 <retrieve />
7425                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7426                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7427             </actions>
7428         </permacrud>
7429         </class>
7430         <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">
7431                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7432                         <field name="field" reporter:datatype="link"/>
7433                         <field name="id" reporter:datatype="id" />
7434                         <field name="source" reporter:datatype="link"/>
7435                         <field name="value"  reporter:datatype="text"/>
7436                 </fields>
7437                 <links>
7438                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7439                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7440                 </links>
7441         </class>
7442         <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">
7443                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7444                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7445                         <field name="btype" reporter:datatype="text"/>
7446                         <field name="id" reporter:datatype="id" />
7447                         <field name="name"  reporter:datatype="text"/>
7448                         <field name="description" reporter:datatype="text"/>
7449                         <field name="owner" reporter:datatype="link"/>
7450                         <field name="pub" reporter:datatype="bool"/>
7451                         <field name="create_time" reporter:datatype="timestamp" />
7452                         <field name="owning_lib" reporter:datatype="org_unit" />
7453                 </fields>
7454                 <links>
7455                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7456                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7457                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7458                 </links>
7459                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7460                         <actions>
7461                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7462                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7463                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7464                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7465                         </actions>
7466                 </permacrud>
7467         </class>
7468         <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">
7469                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7470                         <field name="id" reporter:datatype="id" />
7471                         <field name="bucket" reporter:datatype="link"/>
7472                         <field name="note" reporter:datatype="text" />
7473                 </fields>
7474                 <links>
7475                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7476                 </links>
7477         </class>
7478         <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">
7479                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7480                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7481                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7482                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7483                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7484                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7485                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7486                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7487                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7488                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7489                 </fields>
7490                 <links>
7491                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7492                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7493                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7494                 </links>
7495         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7496             <actions>
7497                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7498                     <context link="xact" jump="usr" field="home_ou"/>
7499                 </retrieve>
7500                         </actions>
7501                 </permacrud>
7502         </class>
7503         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7504                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7505                         <field name="id" reporter:datatype="id" />
7506                         <field name="ind1" />
7507                         <field name="ind2" />
7508                         <field name="record" />
7509                         <field name="subfield" />
7510                         <field name="tag" />
7511                         <field name="value" />
7512                 </fields>
7513                 <links>
7514                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7515                 </links>
7516         </class>
7517         <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">
7518                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7519                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7520                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7521                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7522                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7523                 </fields>
7524                 <links>
7525                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7526                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7527                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7528                 </links>
7529         </class>
7530         <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">
7531                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7532                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7533                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7534                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7535                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7536                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7537                 </fields>
7538                 <links>
7539                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7540                 </links>
7541         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7542             <actions>
7543                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7544                 <retrieve/>
7545                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7546                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7547             </actions>
7548         </permacrud>
7549
7550         </class>
7551         <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">
7552                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7553                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7554                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7555                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7556                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7557                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7558                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7559                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7560                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7561                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7562                 </fields>
7563                 <links>
7564                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7565                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7566                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7567                 </links>
7568         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7569             <actions>
7570                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7571                 <retrieve/>
7572                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7573                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7574             </actions>
7575         </permacrud>
7576         </class>
7577         <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">
7578                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7579                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7580                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7581                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7582                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7583                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7584                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7585                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7586                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7587                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7588                 </fields>
7589                 <links>
7590                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7591                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7592                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7593                 </links>
7594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7595                 <actions>
7596                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7597                     <retrieve/>
7598                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7599                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7600                 </actions>
7601              </permacrud>
7602         </class>
7603         <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">
7604                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7605                         <field name="balance_owed" reporter:datatype="money" />
7606                         <field name="total_owed" reporter:datatype="money" />
7607                         <field name="total_paid" reporter:datatype="money" />
7608                         <field name="usr" reporter:datatype="link"/>
7609                 </fields>
7610                 <links>
7611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7612                 </links>
7613         </class>
7614     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7615                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7616                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7617                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7618                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7619                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7620                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7621                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7622                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7623                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7624                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7625                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7626                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7627                 </fields>
7628                 <links>
7629                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7630                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7631                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7632                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7633                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7634                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7635                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7636                 </links>
7637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7638             <actions>
7639                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7640             </actions>
7641         </permacrud>
7642         </class>
7643         <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">
7644                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7645                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7646                         <field name="quality" reporter:datatype="int" />
7647                         <field name="source" reporter:datatype="text"/>
7648                         <field name="transcendant" reporter:datatype="bool"/>
7649                         <field name="can_have_copies" reporter:datatype="bool"/>
7650                 </fields>
7651                 <links/>
7652         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7653             <actions>
7654                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7655                 <retrieve/>
7656                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7657                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7658             </actions>
7659         </permacrud>
7660         </class>
7661         <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">
7662                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7663                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7664                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7665                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7666                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7667                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7668                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7669                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7670                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7671                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7672                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7673                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7674                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7675                 </fields>
7676                 <links>
7677                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7678                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7679                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7680                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7681                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7682                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7683                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7684                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7685                 </links>
7686                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7687                         <actions>
7688                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7689                                         <context link="usr" field="home_ou" />
7690                                 </retrieve>
7691                         </actions>
7692                 </permacrud>
7693         </class>
7694         <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">
7695                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7696                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7697                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7698                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7699                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7700                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7701                 </fields>
7702                 <links>
7703                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7704                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7705                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7706                 </links>
7707         </class>
7708         <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">
7709                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7710                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7711                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7712                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7713                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7714                 </fields>
7715                 <links>
7716                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7717                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7718                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7719                 </links>
7720         </class>
7721         <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">
7722                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7723                         <field name="bucket" reporter:datatype="link"/>
7724                         <field name="id" reporter:datatype="id" />
7725                         <field name="target_user" reporter:datatype="link"/>
7726                         <field name="create_time" reporter:datatype="timestamp" />
7727                         <field name="pos" reporter:datatype="int" />
7728                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7729                 </fields>
7730                 <links>
7731                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7732                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7733             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7734                 </links>
7735                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7736                         <actions>
7737                                 <retrieve permission="ADMIN_USER_BUCKET">
7738                     <context link="bucket" field="owning_lib"/>
7739                 </retrieve>
7740             </actions>
7741         </permacrud>
7742         </class>
7743         <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">
7744                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7745                         <field name="id" reporter:datatype="id" />
7746                         <field name="staff" reporter:datatype="link"/>
7747                         <field name="bucket" reporter:datatype="link"/>
7748                         <field name="target" reporter:datatype="int" />
7749                         <field name="hold_type" reporter:datatype="text" />
7750                         <field name="run_date" reporter:datatype="timestamp" />
7751                         <field name="cancelled" reporter:datatype="timestamp" />
7752                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7753                 </fields>
7754                 <links>
7755                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7756                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7757                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7758                 </links>
7759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7760                         <actions>
7761                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7762                 <retrieve/>
7763                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7764                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7765             </actions>
7766         </permacrud>
7767         </class>
7768         <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">
7769                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7770                         <field name="id" reporter:datatype="id" />
7771                         <field name="batch_hold_event" reporter:datatype="link"/>
7772                         <field name="hold" reporter:datatype="link"/>
7773                 </fields>
7774                 <links>
7775                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7776                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7777                 </links>
7778                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7779                         <actions>
7780                 <retrieve/>
7781             </actions>
7782         </permacrud>
7783         </class>
7784         <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">
7785                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7786                         <field name="id" reporter:datatype="id" />
7787                         <field name="item" reporter:datatype="link"/>
7788                         <field name="note" reporter:datatype="text" />
7789                 </fields>
7790                 <links>
7791                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7792                 </links>
7793         </class>
7794         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7795                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7796                         <field name="balance_owed" reporter:datatype="money" />
7797                         <field name="total_owed" reporter:datatype="money" />
7798                         <field name="total_paid" reporter:datatype="money" />
7799                         <field name="usr" reporter:datatype="link"/>
7800                 </fields>
7801                 <links>
7802                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7803                 </links>
7804         </class>
7805         <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">
7806                 <fields oils_persist:primary="code" oils_persist:sequence="">
7807                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7808                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7809                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7810                 </fields>
7811                 <links/>
7812         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7813             <actions>
7814                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7815                 <retrieve/>
7816                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7817                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7818             </actions>
7819         </permacrud>
7820         </class>
7821         <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">
7822                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7823                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7824                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7825                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7826                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7827                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7828                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7829                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7830                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7831                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7832                 </fields>
7833                 <links>
7834                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7835                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7836                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7837                 </links>
7838         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7839             <actions>
7840                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7841                     <context link="xact" jump="usr" field="home_ou"/>
7842                 </retrieve>
7843                         </actions>
7844                 </permacrud>
7845         </class>
7846         <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">
7847                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7848                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7849                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7850                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7851                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7852                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7853                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7854                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7855                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7856                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7857                 </fields>
7858                 <links>
7859                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7860                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7861                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7862                 </links>
7863         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7864             <actions>
7865                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7866                     <context link="xact" jump="usr" field="home_ou"/>
7867                 </retrieve>
7868                         </actions>
7869                 </permacrud>
7870         </class>
7871         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7872                 <fields oils_persist:primary="id" oils_persist:sequence="">
7873                         <field name="checkin_lib" reporter:datatype="link"/>
7874                         <field name="checkin_staff" reporter:datatype="link"/>
7875                         <field name="checkin_time" reporter:datatype="timestamp"/>
7876                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7877                         <field name="circ_staff" reporter:datatype="link"/>
7878                         <field name="desk_renewal" reporter:datatype="bool"/>
7879                         <field name="due_date" reporter:datatype="timestamp"/>
7880                         <field name="duration" reporter:datatype="interval"/>
7881                         <field name="duration_rule" reporter:datatype="link"/>
7882                         <field name="fine_interval" reporter:datatype="interval"/>
7883                         <field name="id" reporter:datatype="id" />
7884                         <field name="max_fine" reporter:datatype="money" />
7885                         <field name="max_fine_rule" reporter:datatype="link"/>
7886                         <field name="opac_renewal" reporter:datatype="bool"/>
7887                         <field name="phone_renewal" reporter:datatype="bool"/>
7888                         <field name="recurring_fine" reporter:datatype="money" />
7889                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7890                         <field name="renewal_remaining" reporter:datatype="int" />
7891             <field name="grace_period" reporter:datatype="interval" />
7892                         <field name="stop_fines" reporter:datatype="text"/>
7893                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7894                         <field name="target_copy" reporter:datatype="link"/>
7895                         <field name="usr" reporter:datatype="link"/>
7896                         <field name="xact_finish" reporter:datatype="timestamp" />
7897                         <field name="xact_start" reporter:datatype="timestamp" />
7898                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7899                         <field name="auto_renewal" reporter:datatype="bool"/>
7900                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7901                 </fields>
7902                 <links>
7903                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7904                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7905                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7906                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7907                 </links>
7908         </class>
7909         <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">
7910                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7911                         <field name="field" reporter:datatype="link"/>
7912                         <field name="id" reporter:datatype="id" />
7913                         <field name="source" reporter:datatype="link"/>
7914                         <field name="value" reporter:datatype="text"/>
7915                 </fields>
7916                 <links>
7917                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7918                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7919                 </links>
7920         </class>
7921         <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">
7922                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7923                         <field name="high" reporter:datatype="money" />
7924                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7925                         <field name="low" reporter:datatype="money" />
7926                         <field name="name" reporter:datatype="text"/>
7927                         <field name="normal" reporter:datatype="money" />
7928                         <field name="recurrence_interval" reporter:datatype="interval"/>
7929             <field name="grace_period" reporter:datatype="interval" />
7930                 </fields>
7931                 <links/>
7932         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7933             <actions>
7934                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7935                 <retrieve/>
7936                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7937                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7938             </actions>
7939         </permacrud>
7940         </class>
7941         <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">
7942                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7943                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7944                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7945                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7946                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7947                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7948                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7949                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7950                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7951                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7952                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7953                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7954                 </fields>
7955                 <links>
7956                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7957                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7958                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7959                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7960                 </links>
7961         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7962             <actions>
7963                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7964                     <context link="xact" jump="usr" field="home_ou"/>
7965                 </retrieve>
7966                         </actions>
7967                 </permacrud>
7968         </class>
7969         <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">
7970                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7971                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7972                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7973                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7974                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7975                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7976                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7977                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7978                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7979                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7980                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7981                 </fields>
7982                 <links>
7983                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7984                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7985                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7986                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7987                 </links>
7988         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7989             <actions>
7990                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7991                     <context link="xact" jump="usr" field="home_ou"/>
7992                 </retrieve>
7993                         </actions>
7994                 </permacrud>
7995         </class>
7996         <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">
7997                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7998                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
7999                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8000                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8001                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8002                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8003                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8004                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8005                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8006                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8007                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8008                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8009                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8010                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8011                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8012                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8013                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8014                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8015                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8016                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8017                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8018                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8019                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8020                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8021                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8022                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8023                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8024                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8025                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8026                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8027                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8028                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8029                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8030                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8031                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8032                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8033                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8034                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8035                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8036                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8037                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8038                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8039                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8040                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8041                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8042                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8043                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8044                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8045                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8046                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8047                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8048                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8049                 </fields>
8050                 <links>
8051                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8052                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8053                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8054                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8055                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8056                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8057                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8058                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8059                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8060                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8061                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8062                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8063                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8064                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8065                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8066                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8067                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8068                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8069                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8070                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8071                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8072                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8073                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8074                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8075                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8076                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8077                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8078                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8079                 </links>
8080         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8081             <actions>
8082                 <create permission="CREATE_COPY">
8083                     <context link="call_number" field="owning_lib"/>
8084                 </create>
8085                 <retrieve/>
8086                 <update permission="UPDATE_COPY">
8087                     <context link="call_number" field="owning_lib"/>
8088                 </update>
8089                 <delete permission="DELETE_COPY">
8090                     <context link="call_number" field="owning_lib"/>
8091                 </delete>
8092             </actions>
8093         </permacrud>
8094         </class>
8095
8096         <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">
8097                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8098                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8099                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8100                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8101                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8102                 </fields>
8103                 <links>
8104                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8105                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8106                 </links>
8107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8108                         <actions>
8109                 <create permission="STAFF_LOGIN"/>
8110                 <retrieve/>
8111                 <update permission="STAFF_LOGIN"/>
8112                 <delete permission="STAFF_LOGIN"/>
8113                         </actions>
8114                 </permacrud>
8115         </class>
8116
8117         <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">
8118                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8119             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8120                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8121                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8122                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8123                 </fields>
8124                 <links>
8125                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8126                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8127                 </links>
8128         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8129             <actions>
8130                                 <retrieve/>
8131             </actions>
8132         </permacrud>
8133         </class>
8134
8135         <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">
8136                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8137                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8138                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8139                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8140                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8141                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8142                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8143                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8144                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8145                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8146                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8147                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8148                 </fields>
8149                 <links>
8150                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8151                 </links>
8152         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8153             <actions>
8154                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8155                 <retrieve/>
8156                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8157                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8158             </actions>
8159         </permacrud>
8160         </class>
8161
8162         <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">
8163                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8164                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8165                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8166                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8167                 </fields>
8168                 <links>
8169                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8170                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8171                 </links>
8172         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8173             <actions>
8174                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8175                 <retrieve/>
8176                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8177                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8178             </actions>
8179         </permacrud>
8180         </class>
8181
8182         <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">
8183                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8184                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8185                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8186                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8187                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8188                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8189                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8190                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8191                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8192                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8193                 </fields>
8194                 <links>
8195                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8196                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8197                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8198                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8199                 </links>
8200         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8201             <actions>
8202                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8203                     <context link="copy" field="circ_lib"/>
8204                 </create>
8205                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8206                     <context link="copy" field="circ_lib"/>
8207                                 </retrieve>
8208                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8209                     <context link="copy" field="circ_lib"/>
8210                                 </update>
8211                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8212                     <context link="copy" field="circ_lib"/>
8213                                 </delete>
8214             </actions>
8215         </permacrud>
8216         </class>
8217
8218         <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">
8219                 <fields oils_persist:primary="id">
8220                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8221                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8222                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8223                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8224                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8225                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8226                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8227                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8228                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8229                 </fields>
8230                 <links>
8231                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8232                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8233                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8234                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8235                 </links>
8236         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8237             <actions>
8238                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8239                     <context link="copy" field="circ_lib"/>
8240                 </create>
8241                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8242                     <context link="copy" field="circ_lib"/>
8243                                 </retrieve>
8244                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8245                     <context link="copy" field="circ_lib"/>
8246                                 </update>
8247                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8248                     <context link="copy" field="circ_lib"/>
8249                                 </delete>
8250             </actions>
8251         </permacrud>
8252         </class>
8253
8254         <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">
8255                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8256                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8257                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8258                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8259                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8260                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8261                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8262                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8263                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8264                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8265                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8266                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8267                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8268                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8269                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8270                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8271                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8272                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8273                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8274                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8275                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8276                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8277                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8278                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8279                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8280                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8281                 </fields>
8282                 <links>
8283                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8284                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8285                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8286                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8287                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8288                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8289                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8290                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8291                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8292                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8293                 </links>
8294                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8295                         <actions>
8296                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8297                                 <retrieve />
8298                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8299                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8300                         </actions>
8301                 </permacrud>
8302         </class>
8303
8304         <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">
8305                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8306                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8307                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8308                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8309                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8310                 </fields>
8311                 <links/>
8312         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8313             <actions>
8314                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8315                 <retrieve/>
8316                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8317                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8318             </actions>
8319         </permacrud>
8320         </class>
8321         <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">
8322                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8323                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8324                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8325                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8326                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8327                 </fields>
8328                 <links/>
8329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8330             <actions>
8331                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8332                 <retrieve/>
8333                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8334                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8335             </actions>
8336         </permacrud>
8337         </class>
8338         <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">
8339                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8340                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8341                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8342                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8343                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8344                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8345                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8346                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8347                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8348                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8349                 </fields>
8350                 <links>
8351                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8352                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8353                 </links>
8354         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8355             <actions>
8356                 <create permission="CREATE_PERM" global_required="true"/>
8357                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8358                 <update permission="UPDATE_PERM" global_required="true"/>
8359                 <delete permission="DELETE_PERM" global_required="true"/>
8360             </actions>
8361         </permacrud>
8362         </class>
8363         <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">
8364                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8365                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8366                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8367                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8368                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8369                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8370                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8371                 </fields>
8372                 <links>
8373                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8374                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8375                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8376                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8377                 </links>
8378                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8379                         <actions>
8380                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8381                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8382                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8383                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8384                         </actions>
8385                 </permacrud>
8386         </class>
8387         <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">
8388                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8389                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8390                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8391                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8392                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8393                 </fields>
8394                 <links>
8395                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8396                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8397                 </links>
8398         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8399             <actions>
8400                 <create permission="ADMIN_SURVEY">
8401                     <context link="question" jump="survey" field="owner"/>
8402                 </create>
8403                 <retrieve/>
8404                 <update permission="ADMIN_SURVEY">
8405                     <context link="question" jump="survey" field="owner"/>
8406                 </update>
8407                 <delete permission="ADMIN_SURVEY">
8408                     <context link="question" jump="survey" field="owner"/>
8409                 </delete>
8410             </actions>
8411         </permacrud>
8412         </class>
8413         <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">
8414                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8415                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8416                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8417                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8418                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8419                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8420                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8421                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8422                 </fields>
8423                 <links>
8424                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8425                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8426                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8427                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8428                 </links>
8429                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8430                         <actions>
8431                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8432                         </actions>
8433                 </permacrud>
8434         </class>
8435         <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">
8436                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8437                         <field name="balance_owed" reporter:datatype="money" />
8438                         <field name="total_owed" reporter:datatype="money" />
8439                         <field name="total_paid" reporter:datatype="money" />
8440                         <field name="usr" reporter:datatype="link"/>
8441                 </fields>
8442                 <links>
8443                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8444                 </links>
8445         </class>
8446         <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">
8447                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8448                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8449                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8450                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8451                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8452                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8453                 </fields>
8454                 <links>
8455                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8456                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8457                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8458                 </links>
8459         </class>
8460         <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">
8461                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8462                         <field name="field" reporter:datatype="link"/>
8463                         <field name="id" reporter:datatype="id" />
8464                         <field name="source" reporter:datatype="link"/>
8465                         <field name="value" reporter:datatype="text"/>
8466                 </fields>
8467                 <links>
8468                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8469                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8470                 </links>
8471         </class>
8472         <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">
8473                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8474                         <field name="field" reporter:datatype="link"/>
8475                         <field name="id" reporter:datatype="id" />
8476                         <field name="source" reporter:datatype="link"/>
8477                         <field name="value" reporter:datatype="text"/>
8478                 </fields>
8479                 <links>
8480                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8481                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8482                 </links>
8483         </class>
8484         <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">
8485                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8486                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8487                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8488                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8489                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8490                 </fields>
8491                 <links>
8492                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8493                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8494                 </links>
8495         </class>
8496         <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">
8497                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8498                         <field name="depth" reporter:datatype="int" />
8499                         <field name="grantable" reporter:datatype="bool"/>
8500                         <field name="grp" reporter:datatype="link"/>
8501                         <field name="id" reporter:datatype="id" />
8502                         <field name="perm" reporter:datatype="link"/>
8503                 </fields>
8504                 <links>
8505                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8506                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8507                 </links>
8508         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8509             <actions>
8510                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8511                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8512                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8513                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8514             </actions>
8515         </permacrud>
8516         </class>
8517         <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">
8518                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8519                         <field name="items" oils_persist:virtual="true" />
8520                         <field name="btype" reporter:datatype="text"/>
8521                         <field name="id" reporter:datatype="id" />
8522                         <field name="name" reporter:datatype="text"/>
8523                         <field name="description" reporter:datatype="text"/>
8524                         <field name="owner" reporter:datatype="link"/>
8525                         <field name="pub" reporter:datatype="bool"/>
8526                         <field name="create_time" reporter:datatype="timestamp" />
8527                         <field name="owning_lib" reporter:datatype="org_unit" />
8528                 </fields>
8529                 <links>
8530                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8531                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8532                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8533                 </links>
8534                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8535                         <actions>
8536                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8537                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8538                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8539                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8540                         </actions>
8541                 </permacrud>
8542         </class>
8543         <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">
8544                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8545                         <field name="id" reporter:datatype="id" />
8546                         <field name="bucket" reporter:datatype="link"/>
8547                         <field name="note" reporter:datatype="text" />
8548                 </fields>
8549                 <links>
8550                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8551                 </links>
8552         </class>
8553         <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">
8554                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8555                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8556                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8557                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8558                 </fields>
8559                 <links>
8560                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8561                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8562                 </links>
8563         </class>
8564         <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">
8565                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8566                         <field name="depth" reporter:datatype="int"/>
8567                         <field name="grantable" reporter:datatype="bool"/>
8568                         <field name="id" reporter:datatype="id" />
8569                         <field name="perm" reporter:datatype="link"/>
8570                         <field name="usr" reporter:datatype="link"/>
8571                 </fields>
8572                 <links>
8573                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8574                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8575                 </links>
8576         </class>
8577         <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">
8578                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8579                         <field name="object_id" reporter:datatype="text"/>
8580                         <field name="grantable" reporter:datatype="bool"/>
8581                         <field name="id" reporter:datatype="id" />
8582                         <field name="perm" reporter:datatype="link"/>
8583                         <field name="usr" reporter:datatype="link"/>
8584                         <field name="object_type" reporter:datatype="text"/>
8585                 </fields>
8586                 <links>
8587                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8588                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8589                 </links>
8590         </class>
8591         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8592                 <fields oils_persist:primary="id" oils_persist:sequence="">
8593                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8594                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8595                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8596                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8597                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8598                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8599                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8600                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8601                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8602                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8603                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8604                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8605                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8606                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8607                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8608                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8609                 </fields>
8610                 <links>
8611                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8612                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8613                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8614                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8615                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8616                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8617                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8618                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8619                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8620                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8621                 </links>
8622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8623             <actions>
8624                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8625                     <context link="xact" jump="usr" field="home_ou"/>
8626                 </retrieve>
8627                         </actions>
8628                 </permacrud>
8629         </class>
8630         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8631                 oils_obj:fieldmapper="money::aged_payment" 
8632                 oils_persist:tablename="money.aged_payment" 
8633                 reporter:label="Payments: Aged">
8634                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8635                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8636                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8637                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8638                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8639                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8640                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8641                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8642                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8643                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8644                         <field name="billing" reporter:datatype="link"/>
8645                 </fields>
8646                 <links>
8647                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8648                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8649                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8650                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8651                 </links>
8652                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8653                         <actions>
8654                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8655                                         <context link="xact" field="usr_home_ou"/>
8656                                 </retrieve>
8657                         </actions>
8658                 </permacrud>
8659         </class>
8660         <class id="mallp" controller="open-ils.cstore" 
8661                 oils_obj:fieldmapper="money::all_payments" 
8662                 oils_persist:tablename="money.all_payments" 
8663                 oils_persist:readonly="true" reporter:core="true"
8664                 reporter:label="Payments: All">
8665                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8666                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8667                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8668                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8669                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8670                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8671                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8672                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8673                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8674                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8675                         <field name="billing" reporter:datatype="link"/>
8676                 </fields>
8677                 <links>
8678                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8679                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8680                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8681                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8682                 </links>
8683         </class>
8684
8685         <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">
8686                 <fields oils_persist:primary="id" oils_persist:sequence="">
8687                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8688                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8689                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8690                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8691                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8692                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8693                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8694                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8695                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8696                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8697                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8698                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8699                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8700                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8701                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8702                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8703                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8704                 </fields>
8705                 <links>
8706                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8707                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8708                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8709                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8710                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8711                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8712                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8713                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8714                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8715                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8716                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8717                 </links>
8718                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8719                         <actions>
8720                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8721                                         <context link="xact" jump="usr" field="home_ou"/>
8722                                 </retrieve>
8723                         </actions>
8724                 </permacrud>
8725         </class>
8726         <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">
8727                 <fields oils_persist:primary="id" oils_persist:sequence="">
8728                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8729                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8730                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8731                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8732                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8733                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8734                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8735                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8736                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8737                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8738                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8739                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8740                 </fields>
8741                 <links>
8742                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8743                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8744                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8745                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8746                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8747                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8748                 </links>
8749         </class>
8750         <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">
8751                 <fields oils_persist:primary="id" oils_persist:sequence="">
8752                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8753                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8754                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8755                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8756                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8757                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8758                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8759                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8760                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8761                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8762                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8763                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8764                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8765                 </fields>
8766                 <links>
8767                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8768                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8769                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8770                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8771                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8772                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8773                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8774                 </links>
8775         </class>
8776         <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">
8777                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8778                         <field name="bucket" reporter:datatype="link"/>
8779                         <field name="id" reporter:datatype="id" />
8780                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8781                         <field name="create_time" reporter:datatype="timestamp" />
8782                         <field name="pos" reporter:datatype="int" />
8783                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8784                 </fields>
8785                 <links>
8786                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8787                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8788             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8789                 </links>
8790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8791                         <actions>
8792                                 <retrieve permission="ADMIN_COPY_BUCKET">
8793                     <context link="bucket" field="owning_lib"/>
8794                 </retrieve>
8795             </actions>
8796         </permacrud>
8797         </class>
8798         <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">
8799                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8800                         <field name="id" reporter:datatype="id" />
8801                         <field name="item" reporter:datatype="link"/>
8802                         <field name="note" reporter:datatype="text" />
8803                 </fields>
8804                 <links>
8805                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8806                 </links>
8807         </class>
8808         <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">
8809                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8810                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8811                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8812                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8813                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8814                 </fields>
8815                 <links>
8816                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8817                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8818                 </links>
8819                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8820                         <actions>
8821                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8822                         </actions>
8823                 </permacrud>
8824         </class>
8825     <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">
8826         <fields oils_persist:primary="field">
8827             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8828             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8829             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8830         </fields>
8831         <links/>
8832         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8833             <actions>
8834                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8835                 <retrieve />
8836                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8837                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8838             </actions>
8839         </permacrud>
8840     </class>
8841         <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">
8842                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8843                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8844                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8845                 </fields>
8846                 <links/>
8847         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8848             <actions>
8849                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8850                 <retrieve/>
8851                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8852                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8853             </actions>
8854         </permacrud>
8855         </class>
8856
8857
8858         <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">
8859                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8860                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8861                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8862                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8863                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8864                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8865                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8866                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8867                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8868                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8869                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8870                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8871                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8872                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8873                 </fields>
8874                 <links>
8875                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8876                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8877                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8878                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8879                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8880                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8881                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8882                 </links>
8883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8884             <actions>
8885                 <create permission="TRANSIT_COPY">
8886                     <context link="target_copy" field="owner"/>
8887                 </create>
8888                 <retrieve/>
8889                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8890                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8891             </actions>
8892         </permacrud>
8893         </class>
8894         <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">
8895                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8896                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8897                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8898                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8899                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8900                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8901                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8902                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8903                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8904                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8905                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8906                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8907                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8908                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8909                 </fields>
8910                 <links>
8911                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8912                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8913                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8914                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8915                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8916                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8917                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8918                 </links>
8919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8920             <actions>
8921                 <create permission="TRANSIT_COPY" context_field="owner">
8922                     <context link="target_copy" field="circ_lib"/>
8923                 </create>
8924                 <retrieve/>
8925                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8926                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8927             </actions>
8928         </permacrud>
8929         </class>
8930         <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">
8931                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8932                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8933                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8934                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8935                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8936                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8937                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8938                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8939                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8940                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8941                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8942                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8943                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8944                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8945                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8946                 </fields>
8947                 <links>
8948                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8949                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8950                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8951                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8952                 </links>
8953         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8954             <actions>
8955                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8956                     <context link="xact" jump="usr" field="home_ou"/>
8957                 </retrieve>
8958                         </actions>
8959                 </permacrud>
8960         </class>
8961         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
8962                 oils_obj:fieldmapper="money::aged_billing" 
8963                 oils_persist:tablename="money.aged_billing" 
8964                 reporter:label="Aged Billing Line Item">
8965                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8966                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8967                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8968                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8969                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8970                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8971                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8972                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8973                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8974                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8975                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8976                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8977                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8978                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8979                 </fields>
8980                 <links>
8981                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8982                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8983                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8984                 </links>
8985                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8986                         <actions>
8987                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8988                                         <context link="xact" field="usr_home_ou"/>
8989                                 </retrieve>
8990                         </actions>
8991                 </permacrud>
8992         </class>
8993         <class id="mallb" controller="open-ils.cstore" 
8994                 oils_obj:fieldmapper="money::all_billings" 
8995                 oils_persist:tablename="money.all_billings" 
8996                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
8997                 <fields oils_persist:primary="id" oils_persist:sequence="">
8998                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8999                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9000                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9001                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9002                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9003                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9004                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9005                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9006                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9007                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9008                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9009                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9010                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9011                 </fields>
9012                 <links>
9013                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9014                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9015                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9016                 </links>
9017         </class>
9018         <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">
9019                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9020                         <field name="grp" />
9021                         <field name="id" reporter:datatype="id" />
9022                         <field name="usr" />
9023                 </fields>
9024                 <links>
9025                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9026                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9027                 </links>
9028         </class>
9029         <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">
9030                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9031                         <field name="id" reporter:datatype="id" />
9032                         <field name="fq_field" reporter:datatype="text"/>
9033                         <field name="identity_value" reporter:datatype="text"/>
9034                         <field name="translation" reporter:datatype="text"/>
9035                         <field name="string" reporter:datatype="text"/>
9036                 </fields>
9037                 <links>
9038                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9039                 </links>
9040         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9041             <actions>
9042                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9043                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9044                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9045                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9046             </actions>
9047         </permacrud>
9048         </class>
9049         <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">
9050                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9051                         <field name="id" reporter:datatype="id" />
9052                         <field name="fm_class" reporter:datatype="text"/>
9053                         <field name="field" reporter:datatype="text"/>
9054                         <field name="owner" reporter:datatype="org_unit"/>
9055                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
9056                 </fields>
9057                 <links>
9058                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9059                 </links>
9060         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9061             <actions>
9062                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9063                 <retrieve/>
9064                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9065                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9066             </actions>
9067         </permacrud>
9068         </class>
9069         <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">
9070                 <fields oils_persist:primary="code">
9071                         <field name="code" reporter:datatype="id" />
9072                         <field name="marc_code" reporter:datatype="text"/>
9073                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9074                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9075                         <field name="rtl" reporter:datatype="bool"/>
9076                 </fields>
9077                 <links/>
9078         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9079             <actions>
9080                 <create permission="CREATE_LOCALE" global_required="true"/>
9081                 <retrieve/>
9082                 <update permission="UPDATE_LOCALE" global_required="true"/>
9083                 <delete permission="DELETE_LOCALE" global_required="true"/>
9084             </actions>
9085         </permacrud>
9086         </class>
9087         <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">
9088                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9089                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9090                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9091                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9092                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9093                 </fields>
9094                 <links>
9095                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9096                 </links>
9097         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9098             <actions>
9099                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9100                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9101                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9102                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9103             </actions>
9104         </permacrud>
9105         </class>
9106
9107         <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">
9108                 <fields oils_persist:primary="id">
9109                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9110                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9111                 </fields>
9112                 <links/>
9113         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9114             <actions>
9115                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9116                 <retrieve/>
9117                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9118                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9119             </actions>
9120         </permacrud>
9121         </class>
9122
9123         <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">
9124                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9125                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9126                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9127                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9128                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9129                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9130                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9131                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9132                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9133                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9134                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9135                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9136                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9137                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9138                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9139                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9140                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9141                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9142                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9143                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9144                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9145                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9146                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9147                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9148                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9149                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9150                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9151                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9152                 </fields>
9153                 <links>
9154                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9155                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9156                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9157                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9158                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9159                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9160                 </links>
9161         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9162             <actions>
9163                 <create permission="user_request.create">
9164                     <context link="usr" field="home_ou"/>
9165                                 </create>
9166                 <retrieve permission="user_request.view">
9167                     <context link="usr" field="home_ou"/>
9168                                 </retrieve>
9169                 <update permission="user_request.update">
9170                     <context link="usr" field="home_ou"/>
9171                                 </update>
9172                 <delete permission="user_request.delete">
9173                     <context link="usr" field="home_ou"/>
9174                                 </delete>
9175             </actions>
9176         </permacrud>
9177         </class>
9178
9179         <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">
9180         <oils_persist:source_definition><![CDATA[
9181             SELECT r.*, CASE
9182                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9183                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9184                         WHEN l.state = 'received' THEN 5 -- Received
9185                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9186                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9187                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9188                         WHEN l.id IS NULL THEN 1 -- New
9189                         ELSE 0 -- Error
9190                     END AS request_status
9191                     ,u.home_ou
9192             FROM      acq.user_request r
9193             JOIN actor.usr u ON (r.usr = u.id)
9194             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9195             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9196             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9197         ]]></oils_persist:source_definition>
9198                 <fields oils_persist:primary="id">
9199                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9200                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9201                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9202                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9203                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9204                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9205                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9206                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9207                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9208                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9209                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9210                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9211                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9212                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9213                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9214                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9215                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9216                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9217                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9218                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9219                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9220                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9221                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9222                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9223                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9224                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9225                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9226                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9227                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9228                 </fields>
9229                 <links>
9230                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9231                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9232                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9233                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9234                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9235                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9236                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9237                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9238                 </links>
9239         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9240             <actions>
9241                 <retrieve permission="user_request.view">
9242                     <context link="usr" field="home_ou"/>
9243                                 </retrieve>
9244             </actions>
9245         </permacrud>
9246         </class>
9247
9248         <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">
9249                 <fields oils_persist:primary="id">
9250                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9251                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9252                 </fields>
9253                 <links/>
9254         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9255             <actions>
9256                 <retrieve/>
9257             </actions>
9258         </permacrud>
9259         </class>
9260
9261         <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">
9262                 <fields oils_persist:primary="code">
9263                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9264                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9265                 </fields>
9266                 <links/>
9267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9268             <actions>
9269                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9270                 <retrieve/>
9271                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9272                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9273             </actions>
9274         </permacrud>
9275         </class>
9276
9277         <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">
9278                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9279                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9280                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9281                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9282                         <field reporter:label="Ratio" name="ratio" />
9283                 </fields>
9284                 <links>
9285                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9286                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9287                 </links>
9288                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9289                         <actions>
9290                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9291                                 <retrieve/>
9292                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9293                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9294                         </actions>
9295                 </permacrud>
9296         </class>
9297
9298         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9299                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9300                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9301                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9302                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9303                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9304                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9305                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9306                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9307                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9308                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9309                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9310                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9311                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9312                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9313                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9314                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9315                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9316                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9317                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9318                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9319                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9320                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9321                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9322                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9323                 </fields>
9324                 <links>
9325                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9326                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9327                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9328                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9329                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9330                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9331                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9332                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9333                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9334                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9335                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9336                 </links>
9337         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9338             <actions>
9339                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9340                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9341                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9342                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9343             </actions>
9344         </permacrud>
9345         </class>
9346
9347         <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">
9348                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9349                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9350                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9351                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9352                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9353                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9354                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9355                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9356                 </fields>
9357                 <links>
9358                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9359                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9360                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9361                 </links>
9362         </class>
9363
9364         <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">
9365                 <fields oils_persist:primary="code">
9366                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9367                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9368                 </fields>
9369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9370             <actions>
9371                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9372                 <retrieve/>
9373                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9374                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9375             </actions>
9376                 </permacrud>
9377         </class>
9378
9379         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9380                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9381                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9382                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9383                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9384                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9385                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9386                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9387                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9388                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9389                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9390                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9391                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9392                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9393                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9394                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9395                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9396                 </fields>
9397                 <links>
9398                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9399                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9400                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9401                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9402                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9403                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9404                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9405                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9406                 </links>
9407         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9408             <actions>
9409                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9410                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9411                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9412                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9413             </actions>
9414         </permacrud>
9415         </class>
9416
9417         <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">
9418                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9419                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9420                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9421                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9422                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9423                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9424                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9425                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9426                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9427                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9428                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9429                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9430                 </fields>
9431                 <links>
9432                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9433                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9434                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9435                 </links>
9436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9437             <actions>
9438                 <create   permission="ADMIN_INVOICE">
9439                                         <context link="invoice" field="receiver"/>
9440                                 </create>
9441                 <retrieve permission="ADMIN_INVOICE">
9442                                         <context link="invoice" field="receiver"/>
9443                                 </retrieve>
9444                 <update   permission="ADMIN_INVOICE">
9445                                         <context link="invoice" field="receiver"/>
9446                                 </update>
9447                                 <delete   permission="ADMIN_INVOICE">
9448                                         <context link="invoice" field="receiver"/>
9449                                 </delete>
9450             </actions>
9451         </permacrud>
9452         </class>
9453
9454         <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">
9455                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9456                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9457                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9458                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9459                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9460                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9461                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9462                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9463                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9464                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9465                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9466                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9467                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9468                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9469                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9470                 </fields>
9471                 <links>
9472                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9473                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9474                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9475                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9476                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9477                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
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="acqpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_address" oils_persist:tablename="acq.provider_address" reporter:label="Provider Address">
9498                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9499                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9500                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9501                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9502                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9503                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9504                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9505                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9506                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9507                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9508                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9509                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9510                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9511                 </fields>
9512                 <links>
9513                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9514                 </links>
9515         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9516             <actions>
9517                 <create permission="ADMIN_PROVIDER">
9518                     <context link="provider" field="owner"/>
9519                 </create>
9520                 <retrieve permission="ADMIN_PROVIDER">
9521                     <context link="provider" field="owner"/>
9522                 </retrieve>
9523                 <update permission="ADMIN_PROVIDER">
9524                     <context link="provider" field="owner"/>
9525                 </update>
9526                 <delete permission="ADMIN_PROVIDER">
9527                     <context link="provider" field="owner"/>
9528                 </delete>
9529             </actions>
9530         </permacrud>
9531         </class>
9532
9533         <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">
9534                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9535                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9536                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9537                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9538                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9539                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9540                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9541                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9542         </fields>
9543                 <links>
9544                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9545                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9546                 </links>
9547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9548             <actions>
9549                 <create permission="ADMIN_PROVIDER">
9550                     <context link="provider" field="owner"/>
9551                 </create>
9552                 <retrieve permission="ADMIN_PROVIDER">
9553                     <context link="provider" field="owner"/>
9554                 </retrieve>
9555                 <update permission="ADMIN_PROVIDER">
9556                     <context link="provider" field="owner"/>
9557                 </update>
9558                 <delete permission="ADMIN_PROVIDER">
9559                     <context link="provider" field="owner"/>
9560                 </delete>
9561             </actions>
9562         </permacrud>
9563     </class>
9564         <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">
9565                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9566                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9567                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9568                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9569                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9570                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9571                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9572                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9573                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9574                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9575                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9576                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9577                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9578                 </fields>
9579                 <links>
9580                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9581                 </links>
9582         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9583             <actions>
9584                 <create permission="ADMIN_PROVIDER">
9585                     <context link="contact" jump='provider' field="owner"/>
9586                 </create>
9587                 <retrieve permission="ADMIN_PROVIDER">
9588                     <context link="contact" jump='provider' field="owner"/>
9589                 </retrieve>
9590                 <update permission="ADMIN_PROVIDER">
9591                     <context link="contact" jump='provider' field="owner"/>
9592                 </update>
9593                 <delete permission="ADMIN_PROVIDER">
9594                     <context link="contact" jump='provider' field="owner"/>
9595                 </delete>
9596             </actions>
9597         </permacrud>
9598         </class>
9599
9600         <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">
9601                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9602                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9603                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9604                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9605                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9606                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9607                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9608                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9609                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9610                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9611                 </fields>
9612                 <links>
9613                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9614                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9615                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9616                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9617                 </links>
9618         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9619             <actions>
9620                 <create permission="ADMIN_ACQ_FUND">
9621                     <context link="src_fund" field="org"/>
9622                 </create>
9623                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9624                     <context link="src_fund" field="org"/>
9625                     <context link="dest_fund" field="org"/>
9626                 </retrieve>
9627                 <update permission="ADMIN_ACQ_FUND">
9628                     <context link="src_fund" field="org"/>
9629                 </update>
9630                 <delete permission="ADMIN_ACQ_FUND">
9631                     <context link="src_fund" field="org"/>
9632                 </delete>
9633             </actions>
9634         </permacrud>
9635         </class>
9636
9637         <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">
9638                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9639                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9640                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9641                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9642                 </fields>
9643                 <links>
9644             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9645                 </links>
9646                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9647                         <actions>
9648                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9649                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9650                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9651                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9652                         </actions>
9653                 </permacrud>
9654         </class>
9655
9656         <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">
9657                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9658                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9659                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9660                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9661                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9662                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9663                 </fields>
9664                 <links>
9665                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9666                 </links>
9667                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9668                         <actions>
9669                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9670                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9671                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9672                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9673                         </actions>
9674                 </permacrud>
9675         </class>
9676
9677         <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">
9678                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9679                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9680                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9681                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9682                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9683                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9684                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9685                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9686                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9687                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9688                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9689                 </fields>
9690                 <links>
9691                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9692                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9693             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9694             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9695                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9696                 </links>
9697         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9698             <actions>
9699                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9700                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9701                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9702                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9703             </actions>
9704         </permacrud>
9705         </class>
9706
9707         <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">
9708                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9709                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9710                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9711                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9712                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9713                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9714                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9715                 </fields>
9716                 <links>
9717                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9718                 </links>
9719                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9720                         <actions>
9721                                 <create permission="ADMIN_FUNDING_SOURCE">
9722                     <context link="funding_source" field="owner"/>
9723                 </create>
9724                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9725                     <context link="funding_source" field="owner"/>
9726                 </retrieve>
9727                                 <update permission="ADMIN_FUNDING_SOURCE">
9728                     <context link="funding_source" field="owner"/>
9729                 </update>
9730                                 <delete permission="ADMIN_FUNDING_SOURCE">
9731                     <context link="funding_source" field="owner"/>
9732                 </delete>
9733                         </actions>
9734                 </permacrud>
9735         </class>
9736
9737         <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">
9738                 <fields oils_persist:primary="id">
9739                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9740                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9741                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9742                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9743                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9744                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9745                 </fields>
9746                 <links>
9747                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9748                 </links>
9749         </class>
9750
9751         <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">
9752                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9753                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9754                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9755                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9756                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9757                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9758                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9759                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9760                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9761                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9762                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9763                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9764                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9765                 </fields>
9766                 <links>
9767                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9768                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9769                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9770                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9771                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9772                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9773                 </links>
9774                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9775                         <actions>
9776                                 <create permission="ADMIN_ACQ_FUND">
9777                     <context link="fund" field="org"/>
9778                 </create>
9779                                 <retrieve permission="ADMIN_ACQ_FUND">
9780                     <context link="fund" field="org"/>
9781                 </retrieve>
9782                                 <update permission="ADMIN_ACQ_FUND">
9783                     <context link="fund" field="org"/>
9784                 </update>
9785                                 <delete permission="ADMIN_ACQ_FUND">
9786                     <context link="fund" field="org"/>
9787                 </delete>
9788                         </actions>
9789                 </permacrud>
9790         </class>
9791
9792         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9793                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9794                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9795                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9796                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9797                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9798                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9799                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9800                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9801                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9802                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9803                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9804                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9805                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9806                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9807                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9808                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9809                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9810                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9811                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9812                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9813                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9814                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9815                 </fields>
9816                 <links>
9817                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9818                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9819             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9820             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9821             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9822             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9823             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9824             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9825             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9826             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9827             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9828                 </links>
9829         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9830             <actions>
9831                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9832                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9833                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9834                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9835             </actions>
9836         </permacrud>
9837         </class>
9838
9839         <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">
9840                 <fields oils_persist:primary="fund">
9841                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9842                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9843                 </fields>
9844                 <links>
9845                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9846                 </links>
9847         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9848             <actions>
9849                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9850                                         <context link="fund" field="org" />
9851                 </retrieve>
9852             </actions>
9853         </permacrud>
9854         </class>
9855
9856         <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">
9857                 <fields oils_persist:primary="fund">
9858                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9859                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9860                 </fields>
9861                 <links>
9862                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9863                 </links>
9864         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9865             <actions>
9866                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9867                                         <context link="fund" field="org" />
9868                 </retrieve>
9869             </actions>
9870         </permacrud>
9871         </class>
9872
9873         <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">
9874                 <fields oils_persist:primary="fund">
9875                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9876                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9877                 </fields>
9878                 <links>
9879                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9880                 </links>
9881         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9882             <actions>
9883                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9884                                         <context link="fund" field="org" />
9885                 </retrieve>
9886             </actions>
9887         </permacrud>
9888         </class>
9889
9890         <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">
9891                 <fields oils_persist:primary="fund">
9892                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9893                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9894                 </fields>
9895                 <links>
9896                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9897                 </links>
9898         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9899             <actions>
9900                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9901                                         <context link="fund" field="org" />
9902                 </retrieve>
9903             </actions>
9904         </permacrud>
9905         </class>
9906
9907         <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">
9908                 <fields oils_persist:primary="fund">
9909                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9910                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
9911                 </fields>
9912                 <links>
9913                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9914                 </links>
9915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9916             <actions>
9917                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9918                                         <context link="fund" field="org" />
9919                 </retrieve>
9920             </actions>
9921         </permacrud>
9922         </class>
9923
9924    <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">
9925         <fields oils_persist:primary="fund">
9926             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9927             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9928         </fields>
9929         <links>
9930             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9931         </links>
9932     </class>
9933
9934    <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">
9935         <fields oils_persist:primary="fund">
9936             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9937             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
9938         </fields>
9939         <links>
9940             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9941         </links>
9942     </class>
9943
9944    <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">
9945         <fields oils_persist:primary="fund">
9946             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9947             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9948         </fields>
9949         <links>
9950             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9951         </links>
9952     </class>
9953
9954    <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">
9955         <fields oils_persist:primary="fund">
9956             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9957             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
9958         </fields>
9959         <links>
9960             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9961         </links>
9962     </class>
9963
9964    <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">
9965         <fields oils_persist:primary="fund">
9966             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9967             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
9968         </fields>
9969         <links>
9970             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9971         </links>
9972     </class>
9973
9974         <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">
9975                 <fields oils_persist:primary="funding_source">
9976                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9977                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
9978                 </fields>
9979                 <links>
9980                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9981                 </links>
9982         </class>
9983
9984         <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">
9985                 <fields oils_persist:primary="funding_source">
9986                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9987                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
9988                 </fields>
9989                 <links>
9990                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9991                 </links>
9992         </class>
9993
9994         <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">
9995                 <fields oils_persist:primary="funding_source">
9996                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9997                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
9998                 </fields>
9999                 <links>
10000                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10001                 </links>
10002         </class>
10003
10004         <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">
10005                 <fields oils_persist:primary="fund">
10006                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10007                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10008                 </fields>
10009                 <links>
10010                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10011                 </links>
10012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10013             <actions>
10014                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10015                                         <context link="fund" field="org" />
10016                 </retrieve>
10017             </actions>
10018         </permacrud>
10019     </class>
10020     <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">
10021         <oils_persist:source_definition><![CDATA[
10022             SELECT
10023                 acqf.*,
10024                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10025                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10026                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10027                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10028             FROM
10029                 acq.fund acqf
10030                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10031                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10032                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10033                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10034         ]]></oils_persist:source_definition>
10035         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10036             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10037             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10038             <field reporter:label="Name" name="name" reporter:datatype="text" />
10039             <field reporter:label="Year" name="year" reporter:datatype="int" />
10040             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10041             <field reporter:label="Code" name="code" reporter:datatype="text" />
10042             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10043             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10044             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10045             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10046             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10047
10048             <!-- non fund-native fields -->
10049             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10050             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10051             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10052             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10053         </fields>
10054         <links>
10055             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10056             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10057             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10058         </links>
10059         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10060             <actions>
10061                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10062             </actions>
10063         </permacrud>
10064         </class>
10065         <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">
10066                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10067                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10068                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10069                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10070                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10071                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10072                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10073                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10074                 </fields>
10075                 <links>
10076                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10077                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10078                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10079                 </links>
10080                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10081                         <actions>
10082                                 <create permission="ADMIN_ACQ_FUND">
10083                     <context link="fund" field="org"/>
10084                 </create>
10085                                 <retrieve permission="ADMIN_ACQ_FUND">
10086                     <context link="fund" field="org"/>
10087                 </retrieve>
10088                                 <update permission="ADMIN_ACQ_FUND">
10089                     <context link="fund" field="org"/>
10090                 </update>
10091                                 <delete permission="ADMIN_ACQ_FUND">
10092                     <context link="fund" field="org"/>
10093                 </delete>
10094                         </actions>
10095                 </permacrud>
10096         </class>
10097
10098     <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">
10099         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10100             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10101             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10102             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10103             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10104             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10105             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10106             <field reporter:label="Note" name="note" reporter:datatype="text" />
10107             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10108         </fields>
10109         <links>
10110             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10111             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10112             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10113         </links>
10114                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10115                         <actions>
10116                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10117                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10118                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10119                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10120                         </actions>
10121                 </permacrud>
10122     </class>
10123
10124         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10125                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10126                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10127                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10128                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10129                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10130                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10131                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10132                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10133                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10134                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10135                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10136                 </fields>
10137                 <links>
10138                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10139                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10140                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10141                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10142                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10143                 </links>
10144                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10145                         <actions>
10146                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10147                         </actions>
10148                 </permacrud>
10149         </class>
10150
10151         <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">
10152                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10153                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10154                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10155                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10156                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10157                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10158                 </fields>
10159                 <links>
10160                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10161                 </links>
10162                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10163                         <actions>
10164                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10165                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10166                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10167                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10168                         </actions>
10169                 </permacrud>
10170         </class>
10171
10172         <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">
10173                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10174                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10175                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10176                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10177                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10178                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10179                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10180                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10181                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10182                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10183                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10184                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10185                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10186                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10187                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10188                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10189                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10190                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10191                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10192                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10193                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10194                 </fields>
10195                 <links>
10196                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10197                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10198                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10199                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10200                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10201                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10202                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10203                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10204                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10205                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10206                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10207                 </links>
10208                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10209                         <actions>
10210                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10211                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10212                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10213                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10214                         </actions>
10215                 </permacrud>
10216         </class>
10217
10218         <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">
10219                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10220                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10221                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10222                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10223                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10224                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10225                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10226                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10227                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10228                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10229                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10230                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10231                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10232                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10233                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10234                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10235                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10236                 </fields>
10237                 <links>
10238                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10239                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10240                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10241                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10242                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10243                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10244                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10245                 </links>
10246                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10247             <actions>
10248                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10249             </actions>
10250                 </permacrud>
10251         </class>
10252
10253         <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">
10254                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10255                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10256                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10257                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10258                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10259                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10260                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10261                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10262                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10263                 </fields>
10264                 <links>
10265                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10266                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10267                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10268                 </links>
10269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10270             <actions>
10271                 <create permission="CREATE_PURCHASE_ORDER">
10272                     <context link="purchase_order" field="ordering_agency"/>
10273                 </create>
10274                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10275                     <context link="purchase_order" field="ordering_agency"/>
10276                 </retrieve>
10277                 <update permission="CREATE_PURCHASE_ORDER">
10278                     <context link="purchase_order" field="ordering_agency"/>
10279                 </update>
10280                 <delete permission="CREATE_PURCHASE_ORDER">
10281                     <context link="purchase_order" field="ordering_agency"/>
10282                 </delete>
10283             </actions>
10284                 </permacrud>
10285         </class>
10286
10287         <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">
10288                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10289                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10290                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10291                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10292                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10293                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10294                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10295                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10296                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10297                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10298                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10299                 </fields>
10300                 <links>
10301                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10302                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10303                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10304                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10305                 </links>
10306                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10307             <actions>
10308                 <create permission="CREATE_PURCHASE_ORDER">
10309                     <context link="purchase_order" field="ordering_agency"/>
10310                 </create>
10311                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10312                     <context link="purchase_order" field="ordering_agency"/>
10313                 </retrieve>
10314                 <update permission="CREATE_PURCHASE_ORDER">
10315                     <context link="purchase_order" field="ordering_agency"/>
10316                 </update>
10317                 <delete permission="CREATE_PURCHASE_ORDER">
10318                     <context link="purchase_order" field="ordering_agency"/>
10319                 </delete>
10320             </actions>
10321                 </permacrud>
10322         </class>
10323
10324         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10325                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10326                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10327                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10328                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10329                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10330                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10331                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10332                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10333                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10334                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10335                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10336                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10337                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10338                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10339                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10340                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10341                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10342                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10343                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10344                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10345                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10346                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10347                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10348                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10349                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10350                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10351                 </fields>
10352                 <links>
10353                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10354                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10355                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10356                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10357                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10358                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10359                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10360                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10361                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10362                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10363                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10364                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10365                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10366                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10367                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10368                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10369                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10370                 </links>
10371                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10372                         <actions>
10373                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10374                                         <context link="purchase_order" field="ordering_agency"/>
10375                                         <context link="picklist" field="org_unit"/>
10376                                 </retrieve>
10377                         </actions>
10378                 </permacrud>
10379         </class>
10380
10381         <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">
10382                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10383                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10384                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10385                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10386                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10387                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10388                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10389                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10390                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10391                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10392                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10393                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10394                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10395                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10396                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10397                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10398                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10399                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10400                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10401                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10402                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10403                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10404                 </fields>
10405                 <links>
10406                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10407                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10408                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10409                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10410                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10411                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10412                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10413                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10414                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10415                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10416                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10417                 </links>
10418                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10419                         <actions>
10420                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10421                                         <context link="purchase_order" field="ordering_agency"/>
10422                                         <context link="picklist" field="org_unit"/>
10423                                 </retrieve>
10424                         </actions>
10425                 </permacrud>
10426         </class>
10427
10428         <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">
10429                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10430                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
10431                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10432                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10433                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10434                 </fields>
10435                 <links>
10436                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10437                 </links>
10438                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10439                         <actions>
10440                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10441                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10442                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10443                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10444                         </actions>
10445                 </permacrud>
10446         </class>
10447
10448         <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">
10449                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10450                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10451                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10452                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10453                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10454                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10455                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10456                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10457                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10458                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10459                 </fields>
10460                 <links>
10461                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10462                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10463                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10464                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10465                 </links>
10466         </class>
10467
10468         <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">
10469                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10470                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10471                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10472                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10473                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10474                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10475                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10476                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10477                 </fields>
10478                 <links>
10479                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10480                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10481                 </links>
10482         </class>
10483
10484         <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">
10485                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10486                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10487                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10488                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10489                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10490                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10491                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10492                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10493                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10494                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10495                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10496                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10497                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10498                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10499                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10500                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10501                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10502                 </fields>
10503                 <links>
10504                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10505                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10506                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10507                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10508                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10509                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10510                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10511                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10512                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10513                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10514                 </links>
10515         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10516             <actions>
10517                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10518                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10519                     <context link="lineitem" jump="picklist" field="org_unit"/>
10520                 </retrieve>
10521             </actions>
10522         </permacrud>
10523         </class>
10524
10525         <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">
10526                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10527                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10528                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10529                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10530                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10531                 </fields>
10532                 <links/>
10533                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10534                         <actions>
10535                                 <retrieve />
10536                         </actions>
10537                 </permacrud>
10538         </class>
10539
10540         <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">
10541                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10542                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10543                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10544                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10545                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10546                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10547             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10548                 </fields>
10549                 <links/>
10550         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10551             <actions>
10552                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10553                 <retrieve />
10554                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10555                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10556             </actions>
10557         </permacrud>
10558         </class>
10559
10560         <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">
10561                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10562                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10563                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10564                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10565                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10566                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10567                 </fields>
10568                 <links/>
10569         </class>
10570         <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">
10571                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10572                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10573                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10574                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10575                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10576                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10577                 </fields>
10578                 <links>
10579                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10580                 </links>
10581         </class>
10582
10583         <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">
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"  oils_obj:required="true" />
10587                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10588                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10589                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10590                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10591         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10592
10593             </fields>
10594             <links>
10595                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10596             </links>
10597             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10598                 <actions>
10599                     <create permission="ADMIN_PROVIDER">
10600                         <context link="provider" field="owner"/>
10601                     </create>
10602                     <retrieve permission="ADMIN_PROVIDER">
10603                         <context link="provider" field="owner"/>
10604                     </retrieve>
10605                     <update permission="ADMIN_PROVIDER">
10606                         <context link="provider" field="owner"/>
10607                     </update>
10608                     <delete permission="ADMIN_PROVIDER">
10609                         <context link="provider" field="owner"/>
10610                     </delete>
10611                 </actions>
10612             </permacrud>
10613         </class>
10614         
10615         <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">
10616             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10617                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10618                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10619                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10620                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10621             </fields>
10622             <links>
10623                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10624             </links>
10625             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10626                 <actions>
10627                     <create permission="ADMIN_PROVIDER">
10628                         <context link="provider" field="owner"/>
10629                     </create>
10630                     <retrieve permission="ADMIN_PROVIDER">
10631                         <context link="provider" field="owner"/>
10632                     </retrieve>
10633                     <update permission="ADMIN_PROVIDER">
10634                         <context link="provider" field="owner"/>
10635                     </update>
10636                     <delete permission="ADMIN_PROVIDER">
10637                         <context link="provider" field="owner"/>
10638                     </delete>
10639                 </actions>
10640             </permacrud>
10641         </class>
10642         
10643         <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">
10644             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10645                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10646                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10647                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10648                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10649                 </fields>
10650                 <links/>
10651         </class>
10652
10653         <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">
10654                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10655                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10656                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10657                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10658                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10659                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10660                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10661                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10662                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10663                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10664                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10665                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10666                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10667                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10668                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10669                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10670                 </fields>
10671                 <links>
10672                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10673                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10674                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10675                 </links>
10676         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10677             <actions>
10678                 <create permission="ADMIN_PROVIDER">
10679                     <context link="provider" field="owner"/>
10680                 </create>
10681                 <retrieve permission="ADMIN_PROVIDER">
10682                     <context link="provider" field="owner"/>
10683                 </retrieve>
10684                 <update permission="ADMIN_PROVIDER">
10685                     <context link="provider" field="owner"/>
10686                 </update>
10687                 <delete permission="ADMIN_PROVIDER">
10688                     <context link="provider" field="owner"/>
10689                 </delete>
10690             </actions>
10691         </permacrud>
10692         </class>
10693
10694         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10695                 oils_obj:fieldmapper="acq::edi_attr" 
10696                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10697                 <fields oils_persist:primary="key">
10698                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10699                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10700                 </fields>
10701         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10702             <actions>
10703                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10704                 <retrieve/>
10705                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10706                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10707             </actions>
10708         </permacrud>
10709         </class>
10710         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10711                 oils_obj:fieldmapper="acq::edi_attr_set" 
10712                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10713                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10714                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10715                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10716                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10717                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10718                 </fields>
10719                 <links>
10720                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10721                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10722                 </links>
10723         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10724             <actions>
10725                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10726                 <retrieve/>
10727                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10728                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10729             </actions>
10730         </permacrud>
10731         </class>
10732         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10733                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10734                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10735                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10736                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10737                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10738                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10739                 </fields>
10740                 <links>
10741                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10742                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10743                 </links>
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
10754
10755         <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">
10756                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10757                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10758                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10759                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10760                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10761                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10762                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10763                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10764                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10765                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10766                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10767                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10768                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10769                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10770                 </fields>
10771                 <links>
10772                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10773                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10774                 </links>
10775         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10776             <actions>
10777                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10778                     <context link="account" jump="provider" field="owner"/>
10779                 </retrieve>
10780                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10781                     <context link="account" jump="provider" field="owner"/>
10782                 </update>
10783                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10784                     <context link="account" jump="provider" field="owner"/>
10785                 </delete>
10786             </actions>
10787         </permacrud>
10788         </class>
10789
10790
10791         <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">
10792                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10793                         <field name="id" reporter:datatype="id" />
10794                         <field name="parent" reporter:datatype="link"/>
10795                         <field name="owner" reporter:datatype="link"/>
10796                         <field name="create_time" reporter:datatype="timestamp"/>
10797                         <field name="name" reporter:datatype="text"/>
10798                         <field name="shared" reporter:datatype="bool"/>
10799                         <field name="share_with" reporter:datatype="link"/>
10800                         <field name="simple_reporter" reporter:datatype="bool"/>
10801                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10802                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10803                 </fields>
10804                 <links>
10805                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10806                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10807                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10808                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10809                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10810                 </links>
10811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10812             <actions>
10813                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10814                     <context link="owner" field="home_ou"/>
10815                 </create>
10816                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10817                     <context link="owner" field="home_ou"/>
10818                 </retrieve>
10819                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10820                     <context link="owner" field="home_ou"/>
10821                 </update>
10822                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10823                     <context link="owner" field="home_ou"/>
10824                 </delete>
10825             </actions>
10826         </permacrud>
10827         </class>
10828         <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">
10829                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10830                         <field name="id" reporter:datatype="id" />
10831                         <field name="parent" reporter:datatype="link"/>
10832                         <field name="owner" reporter:datatype="link"/>
10833                         <field name="create_time" reporter:datatype="timestamp"/>
10834                         <field name="name" reporter:datatype="text"/>
10835                         <field name="shared" reporter:datatype="bool"/>
10836                         <field name="share_with" reporter:datatype="link"/>
10837                         <field name="simple_reporter" reporter:datatype="bool"/>
10838                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10839                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10840                 </fields>
10841                 <links>
10842                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10843                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10844                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10845                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10846                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10847                 </links>
10848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10849             <actions>
10850                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10851                     <context link="owner" field="home_ou"/>
10852                 </create>
10853                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10854                     <context link="owner" field="home_ou"/>
10855                 </retrieve>
10856                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10857                     <context link="owner" field="home_ou"/>
10858                 </update>
10859                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10860                     <context link="owner" field="home_ou"/>
10861                 </delete>
10862             </actions>
10863         </permacrud>
10864         </class>
10865         <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">
10866                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10867                         <field name="id" reporter:datatype="id" />
10868                         <field name="parent" reporter:datatype="link"/>
10869                         <field name="owner" reporter:datatype="link"/>
10870                         <field name="create_time" reporter:datatype="timestamp"/>
10871                         <field name="name" reporter:datatype="text"/>
10872                         <field name="shared" reporter:datatype="bool"/>
10873                         <field name="share_with" reporter:datatype="link"/>
10874                         <field name="simple_reporter" reporter:datatype="bool"/>
10875                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10876                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10877                 </fields>
10878                 <links>
10879                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10880                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10881                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10882                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10883                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10884                 </links>
10885         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10886             <actions>
10887                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10888                     <context link="owner" field="home_ou"/>
10889                 </create>
10890                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10891                     <context link="owner" field="home_ou"/>
10892                 </retrieve>
10893                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10894                     <context link="owner" field="home_ou"/>
10895                 </update>
10896                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10897                     <context link="owner" field="home_ou"/>
10898                 </delete>
10899             </actions>
10900         </permacrud>
10901         </class>
10902         <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">
10903                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10904                         <field name="id" reporter:datatype="id" />
10905                         <field name="owner" reporter:datatype="link"/>
10906                         <field name="create_time" reporter:datatype="timestamp"/>
10907                         <field name="name" reporter:datatype="text"/>
10908                         <field name="data" reporter:datatype="text"/>
10909                         <field name="folder" reporter:datatype="link"/>
10910                         <field name="description" reporter:datatype="text"/>
10911                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10912                 </fields>
10913                 <links>
10914                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10915                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10916                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10917                 </links>
10918         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10919             <actions>
10920                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10921                     <context link="owner" field="home_ou"/>
10922                 </create>
10923                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10924                     <context link="owner" field="home_ou"/>
10925                 </retrieve>
10926                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10927                     <context link="owner" field="home_ou"/>
10928                 </update>
10929                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10930                     <context link="owner" field="home_ou"/>
10931                 </delete>
10932             </actions>
10933         </permacrud>
10934         </class>
10935         <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">
10936                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
10937                         <field name="id" reporter:datatype="id" />
10938                         <field name="owner" reporter:datatype="link"/>
10939                         <field name="create_time" reporter:datatype="timestamp"/>
10940                         <field name="template" reporter:datatype="link"/>
10941                         <field name="data" reporter:datatype="text"/>
10942                         <field name="folder" reporter:datatype="link"/>
10943                         <field name="recur" reporter:datatype="bool"/>
10944                         <field name="recurrence" reporter:datatype="interval"/>
10945                         <field name="name" reporter:datatype="text"/>
10946                         <field name="description" reporter:datatype="text"/>
10947                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
10948                 </fields>
10949                 <links>
10950                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10951                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10952                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
10953                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
10954                 </links>
10955         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10956             <actions>
10957                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10958                     <context link="owner" field="home_ou"/>
10959                 </create>
10960                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10961                     <context link="owner" field="home_ou"/>
10962                 </retrieve>
10963                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10964                     <context link="owner" field="home_ou"/>
10965                 </update>
10966                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10967                     <context link="owner" field="home_ou"/>
10968                 </delete>
10969             </actions>
10970         </permacrud>
10971         </class>
10972         <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">
10973                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
10974                         <field reporter:label="Id" name="id" reporter:datatype="id" />
10975                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
10976                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10977                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
10978                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
10979                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
10980                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
10981                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
10982                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
10983                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
10984                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
10985                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
10986                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
10987                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
10988                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
10989                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
10990                 </fields>
10991                 <links>
10992                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
10993                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
10994                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
10995                 </links>
10996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10997             <actions>
10998                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10999                     <context link="runner" field="home_ou"/>
11000                 </create>
11001                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11002                     <context link="runner" field="home_ou"/>
11003                 </retrieve>
11004                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11005                     <context link="runner" field="home_ou"/>
11006                 </update>
11007                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11008                     <context link="runner" field="home_ou"/>
11009                 </delete>
11010             </actions>
11011         </permacrud>
11012         </class>
11013     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11014            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11015            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11016                 <fields oils_persist:primary="run">
11017             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11018             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11019             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11020             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11021             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11022             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11023             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11024             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11025             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11026             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11027             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11028             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11029             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11030             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11031             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11032             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11033                 </fields>
11034                 <links>
11035             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11036             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11037             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11038             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11039             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11040             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11041             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11042             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11043             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11044                 </links>
11045         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11046             <actions>
11047                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11048                     <context link="runner" field="home_ou"/>
11049                 </retrieve>
11050             </actions>
11051         </permacrud>
11052     </class>
11053         <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">
11054                 <fields oils_persist:primary="id">
11055                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11056                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11057                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11058                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11059                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11060                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11061                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11062                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11063                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11064                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11065                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11066                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11067                 </fields>
11068                 <links>
11069                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11070                 </links>
11071                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11072                         <actions>
11073                                 <retrieve />
11074                         </actions>
11075                 </permacrud>
11076         </class>
11077         <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">
11078                 <fields oils_persist:primary="id">
11079                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11080                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11081                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11082                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11083                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11084                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11085                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11086                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11087                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11088                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11089                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11090                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11091                 </fields>
11092                 <links>
11093                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11094                 </links>
11095         </class>
11096         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11097                 <fields oils_persist:primary="id">
11098                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11099                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11100                         <field reporter:label="Fingerprint" name="fingerprint" />
11101                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11102                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11103                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11104                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11105                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11106                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11107                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11108                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11109                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11110                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11111                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11112                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11113                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11114                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11115                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11116                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11117                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11118                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11119                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11120                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11121                 </fields>
11122                 <links>
11123                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11124                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11125                 </links>
11126         </class>
11127         <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">
11128                 <fields oils_persist:primary="id">
11129                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11130                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11131                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11132                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11133                 </fields>
11134                 <links>
11135                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11136                 </links>
11137         </class>
11138         <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">
11139                 <fields oils_persist:primary="id">
11140                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11141                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11142                 </fields>
11143                 <links>
11144                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11145                 </links>
11146         </class>
11147         <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">
11148                 <fields oils_persist:primary="id">
11149                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11150                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11151                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11152                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11153                 </fields>
11154                 <links>
11155                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11156                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11157                 </links>
11158                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11159                         <actions>
11160                                 <retrieve permission="VIEW_HOLD">
11161                                         <context link="id" field="pickup_lib"/>
11162                                 </retrieve>
11163                         </actions>
11164                 </permacrud>
11165         </class>
11166         <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">
11167                 <fields oils_persist:primary="xact">
11168                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11169                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11170                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11171                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11172                 </fields>
11173                 <links>
11174                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11175                 </links>
11176         </class>
11177         <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">
11178                 <fields oils_persist:primary="xact">
11179                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11180                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11181                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11182                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11183                 </fields>
11184                 <links>
11185                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11186                 </links>
11187         </class>
11188         <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)">
11189                 <fields oils_persist:primary="id">
11190                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11191                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11192                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11193                 </fields>
11194                 <links>
11195                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11196                 </links>
11197         </class>
11198         <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">
11199                 <fields oils_persist:primary="id">
11200                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11201                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11202                 </fields>
11203                 <links>
11204                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11205                 </links>
11206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11207                         <actions>
11208                                 <retrieve permission="STAFF_LOGIN">
11209                                         <context link="id" field="circ_lib"/>
11210                                 </retrieve>
11211                         </actions>
11212                 </permacrud>
11213         </class>
11214         <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">
11215                 <fields oils_persist:primary="bibid">
11216                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11217                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11218                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11219                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11220                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11221                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11222                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11223                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11224                 </fields>
11225                 <links>
11226                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11227                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11228                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11229                 </links>
11230         </class>
11231         <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">
11232                 <fields oils_persist:primary="copy_id">
11233                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11234                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11235                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11236                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11237                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11238                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11239                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11240                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11241                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11242                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11243                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11244                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11245                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11246                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11247                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11248                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11249                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11250                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11251                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11252                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11253                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11254                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11255                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11256                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11257                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11258                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11259                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11260                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11261                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11262                 </fields>
11263                 <links>
11264                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11265                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11266                 </links>
11267         </class>
11268         <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">
11269                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11270                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11271                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11272                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11273                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11274                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11275                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11276                 </fields>
11277                 <links>
11278                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11279                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11280                 </links>
11281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11282                         <actions>
11283                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11284                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11285                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11286                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11287                         </actions>
11288                 </permacrud>
11289         </class>
11290         <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">
11291                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11292                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11293                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11294                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11295                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11296                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11297                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11298                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11299                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11300                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11301                 </fields>
11302                 <links>
11303                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11304                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11305                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11306                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11307                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11308                 </links>
11309                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11310                         <actions>
11311                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11312                                         <context link="formula" field="owner"/>
11313                                 </create>
11314                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11315                                         <context link="formula" field="owner"/>
11316                                 </retrieve>
11317                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11318                                         <context link="formula" field="owner"/>
11319                                 </update>
11320                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11321                                         <context link="formula" field="owner"/>
11322                                 </delete>
11323                         </actions>
11324                 </permacrud>
11325         </class>
11326
11327         <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">
11328                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11329                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11330                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11331                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11332                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11333                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11334                 </fields>
11335                 <links>
11336                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11337                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11338                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11339                 </links>
11340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11341                         <actions>
11342                                 <create permission="CREATE_PURCHASE_ORDER">
11343                                         <context link="formula" field="owner"/>
11344                 </create>
11345                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11346                                         <context link="formula" field="owner"/>
11347                 </retrieve>
11348                                 <update permission="CREATE_PURCHASE_ORDER">
11349                                         <context link="formula" field="owner"/>
11350                 </update>
11351                                 <delete permission="CREATE_PURCHASE_ORDER">
11352                                         <context link="formula" field="owner"/>
11353                 </delete>
11354                         </actions>
11355                 </permacrud>
11356         </class>
11357
11358         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11359                 <fields oils_persist:primary="id">
11360                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11361                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11362                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11363                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11364                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11365                 </fields>
11366                 <links>
11367                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11368                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11369                 </links>
11370         </class>
11371
11372         <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">
11373                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11374                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11375                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11376                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11377                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11378                 </fields>
11379                 <links>
11380                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11381                 </links>
11382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11383                         <actions>
11384                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11385                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11386                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11387                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11388                         </actions>
11389                 </permacrud>
11390         </class>
11391
11392         <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">
11393                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11394                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11395                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11396                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11397                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11398                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11399                 </fields>
11400                 <links>
11401                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11402                 </links>
11403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11404                         <actions>
11405                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11406                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11407                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11408                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11409                         </actions>
11410                 </permacrud>
11411         </class>
11412
11413         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11414                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11415                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11416                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11417                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11418                 </fields>
11419                 <links>
11420                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11421                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11422                 </links>
11423         </class>
11424
11425         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11426                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11427                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11428                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11429                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11430                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11431                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11432                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11433                 </fields>
11434                 <links>
11435                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11436                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11437                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11438                 </links>
11439         </class>
11440
11441         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11442                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11443                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11444                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11445                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11446                 </fields>
11447                 <links>
11448                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11449                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11450                 </links>
11451         </class>
11452
11453         <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">
11454                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11455                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11456                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11457                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11458                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11459                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11460                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11461                 </fields>
11462                 <links>
11463                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11464                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11465                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11466                 </links>
11467         </class>
11468
11469         <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">
11470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11471                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11472                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11473                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11474                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11475                 </fields>
11476                 <links>
11477                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11478                 </links>
11479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11480             <actions>
11481                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11482                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11483                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11484                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11485             </actions>
11486                 </permacrud>
11487         </class>
11488
11489         <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">
11490                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11491                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11492                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11493                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11494                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11495                 </fields>
11496                 <links>
11497                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11498                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11499                 </links>
11500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11501                         <actions>
11502                                 <create permission="ADMIN_CLAIM_POLICY">
11503                                         <context link="claim_policy" field="org_unit"/>
11504                 </create>
11505                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11506                                         <context link="claim_policy" field="org_unit"/>
11507                 </retrieve>
11508                                 <update permission="ADMIN_CLAIM_POLICY">
11509                                         <context link="claim_policy" field="org_unit"/>
11510                 </update>
11511                                 <delete permission="ADMIN_CLAIM_POLICY">
11512                                         <context link="claim_policy" field="org_unit"/>
11513                 </delete>
11514                         </actions>
11515                 </permacrud>
11516         </class>
11517
11518     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11519         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11520             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11521             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11522             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11523             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11524             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11525             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11526             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11527             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11528             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11529             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11530             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11531             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11532             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11533             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11534             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11535             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11536                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11537                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11538                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11539         </fields>
11540         <links>
11541             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11542             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11543         </links>
11544     </class>
11545
11546     <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">
11547         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11548             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11549             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11550             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11551             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11552             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11553         </fields>
11554     </class>
11555
11556     <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">
11557         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11558             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11559             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11560             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11561             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11562             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11563             <field reporter:label="City" name="city" reporter:datatype="text"/>
11564             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11565             <field reporter:label="State" name="state" reporter:datatype="text"/>
11566             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11567             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11568             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11569         </fields>
11570     </class>
11571
11572     <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">
11573         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11574             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11575             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11576             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11577             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11578             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11579             <field reporter:label="City" name="city" reporter:datatype="text"/>
11580             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11581             <field reporter:label="State" name="state" reporter:datatype="text"/>
11582             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11583             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11584             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11585         </fields>
11586     </class>
11587
11588     <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">
11589         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11590             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11591             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11592             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11593             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11594             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11595             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11596         </fields>
11597     </class>
11598
11599     <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">
11600         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_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="User Setting Code" name="setting" reporter:datatype="text"/>
11605             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11606             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11607         </fields>
11608     </class>
11609
11610         <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">
11611                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11612                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11613                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11614                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11615                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11616                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11617                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11618                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11619                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11620                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11621                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11622                 </fields>
11623                 <links>
11624                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11625                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11626                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11627                 </links>
11628                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11629                         <actions>
11630                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11631                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11632                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11633                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11634                         </actions>
11635                 </permacrud>
11636         </class>
11637
11638         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11639                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11640                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11641                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11642                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11643                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11644                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11645                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11646                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11647                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11648                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11649                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11650                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11651                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11652                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11653                 </fields>
11654                 <links>
11655                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11656                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11657                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11658                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11659                 </links>
11660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11661                         <actions>
11662                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11663                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11664                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11665                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11666                         </actions>
11667                 </permacrud>
11668         </class>
11669
11670         <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">
11671                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11672                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11673                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11674                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11675                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11676                 </fields>
11677                 <links>
11678                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11679                 </links>
11680                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11681                         <actions>
11682                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11683                     <context link="fieldset" field="owning_lib"/>
11684                 </create>
11685                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11686                     <context link="fieldset" field="owning_lib"/>
11687                 </retrieve>
11688                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11689                     <context link="fieldset" field="owning_lib"/>
11690                 </update>
11691                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11692                     <context link="fieldset" field="owning_lib"/>
11693                 </delete>
11694                         </actions>
11695                 </permacrud>
11696         </class>
11697
11698     <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">
11699         <fields>
11700             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11701             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11702             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11703         </fields>
11704                 <links>
11705                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11706                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11707                 </links>
11708     </class>
11709
11710     <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">
11711         <fields>
11712             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11713             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11714         </fields>
11715                 <links>
11716                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11717                 </links>
11718     </class>
11719
11720     <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">
11721         <fields>
11722             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11723             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11724             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11725         </fields>
11726                 <links>
11727                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11728                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11729                 </links>
11730     </class>
11731
11732     <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">
11733         <fields>
11734             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11735             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11736         </fields>
11737                 <links>
11738                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11739                 </links>
11740     </class>
11741
11742     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11743                 <oils_persist:source_definition><![CDATA[
11744
11745             SELECT  DISTINCT l.*
11746               FROM  action.unfulfilled_hold_loops l
11747                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11748               WHERE l.count = m.max
11749
11750                 ]]></oils_persist:source_definition>
11751         <fields>
11752             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11753             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11754             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11755         </fields>
11756                 <links>
11757                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11758                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11759                 </links>
11760     </class>
11761
11762         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11763                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11764                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11765                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11766                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11767                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11768                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11769                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11770                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11771                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11772                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11773                 </fields>
11774                 <links>
11775                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11776                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11777                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11778                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11779                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11780                 </links>
11781         </class>
11782
11783         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11784                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11785                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11786                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11787                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11788                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11789                 </fields>
11790                 <links>
11791                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11792                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11793                 </links>
11794         </class>
11795
11796         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11797                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11798                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11799                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11800                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11801                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11802                 </fields>
11803                 <links>
11804                 </links>
11805         </class>
11806
11807         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11808                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11809                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11810                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11811                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11812                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11813                 </fields>
11814                 <links>
11815                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11816                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11817                 </links>
11818         </class>
11819         
11820         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11821                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11822                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11823                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11824                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11825                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11826                 </fields>
11827                 <links>
11828                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11829                 </links>
11830         </class>
11831         
11832         <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">
11833                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11834                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11835                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11836                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11837                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11838                 </fields>
11839                 <links>
11840                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11841                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11842                 </links>
11843         </class>
11844
11845         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11846                 <fields oils_persist:primary="name">
11847                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11848                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11849                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11850                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11851                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11852                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11853                 </fields>
11854                 <links>
11855                 </links>
11856         </class>
11857
11858         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11859                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11860                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11861                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11862                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11863                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11864                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11865                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11866                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11867                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11868                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11869                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11870                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11871                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11872                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11873                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11874                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11875                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11876                 </fields>
11877                 <links>
11878                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11879                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11880                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11881                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11882                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11883                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11884                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11885                 </links>
11886         </class>
11887
11888         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11889                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11890                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11891                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11892                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11893                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11894                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
11895                 </fields>
11896                 <links>
11897                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11898                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11899                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11900                 </links>
11901         </class>
11902
11903         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11904                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11905                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11906                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
11907                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11908                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11909                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11910                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11911                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11912                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11913                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11914                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11915                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11916                 </fields>
11917                 <links>
11918                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11919                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11920                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11921                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11922                 </links>
11923         </class>
11924
11925         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11926                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11927                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11928                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
11929                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11930                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11931                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
11932                 </fields>
11933                 <links>
11934                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
11935                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
11936                 </links>
11937         </class>
11938
11939         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
11940                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
11941                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
11942                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11943                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11944                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11945                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
11946                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
11947                 </fields>
11948                 <links>
11949                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11950                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11951                 </links>
11952         </class>
11953
11954         <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">
11955                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
11956                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
11957                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11958                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11959                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11960                 </fields>
11961                 <links>
11962                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11963                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11964                 </links>
11965         </class>
11966
11967         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
11968                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11969                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11970                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11971                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11972                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11973                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11974                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11975                 </fields>
11976                 <links>
11977                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11978                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11979                 </links>
11980         </class>
11981
11982         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
11983                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11984                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11985                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11986                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11987                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11988                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11989                 </fields>
11990                 <links>
11991                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11992                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11993                 </links>
11994         </class>
11995
11996         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
11997                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11998                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11999                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12000                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12001                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12002                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12003                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12004                 </fields>
12005                 <links>
12006                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12007                 </links>
12008         </class>
12009
12010         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case 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="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast 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="Left Operand" name="left_operand" reporter:datatype="link"/>
12032                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12033                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12034                 </fields>
12035                 <links>
12036                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12037                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12038                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12039                 </links>
12040         </class>
12041
12042         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12043                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12044                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12045                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12046                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12047                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12048                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12049                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12050                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12051                 </fields>
12052                 <links>
12053                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12054                 </links>
12055         </class>
12056
12057         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12058                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12059                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12060                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12061                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12062                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12063                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12064                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12065                 </fields>
12066                 <links>
12067                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12068                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12069                 </links>
12070         </class>
12071
12072         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12073                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12074                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12075                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12076                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12077                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12078                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12079                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12080                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12081                 </fields>
12082                 <links>
12083                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12084                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12085                 </links>
12086         </class>
12087
12088         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12089                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12090                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12091                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12092                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12093                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12094                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12095                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12096                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12097                 </fields>
12098                 <links>
12099                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12100                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12101                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12102                 </links>
12103         </class>
12104
12105         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12106                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12107                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12108                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12109                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12110                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12111                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12112                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12113                 </fields>
12114                 <links>
12115                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12116                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12117                 </links>
12118         </class>
12119
12120         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12121                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12122                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12123                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12124                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12125                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12126                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12127                 </fields>
12128                 <links>
12129                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12130                 </links>
12131         </class>
12132
12133         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12134                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12135                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12136                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12137                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12138                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12139                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12140                 </fields>
12141                 <links>
12142                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12143                 </links>
12144         </class>
12145
12146         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12147                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12148                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12149                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12150                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12151                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12152                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12153                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12154                         <field reporter:label="Right Operand" name="right_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                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12161                 </links>
12162         </class>
12163
12164         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12165                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12166                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12167                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12168                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12169                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12170                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12171                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12172                 </fields>
12173                 <links>
12174                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12175                 </links>
12176         </class>
12177
12178         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12179                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12180                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12181                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12182                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12183                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12184                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12185                 </fields>
12186                 <links>
12187                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12188                 </links>
12189         </class>
12190
12191         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12192                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12193                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12194                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12195                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12196                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12197                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12198                 </fields>
12199                 <links>
12200                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12201                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12202                 </links>
12203         </class>
12204
12205         <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">
12206                 <fields oils_persist:primary="id">
12207                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12208                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12209                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12210                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12211                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12212                 </fields>
12213                 <links>
12214                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12215                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12216                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12217                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12218                 </links>
12219         </class>
12220
12221         <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">
12222                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12223                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12224                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12225                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12226                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12227                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12228                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12229                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12230                 </fields>
12231                 <links/>
12232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12233                         <actions>
12234                                 <retrieve/>
12235                         </actions>
12236                 </permacrud>
12237         </class>
12238
12239         <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">
12240                 <fields oils_persist:primary="ptype_key">
12241                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12242                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12243                 </fields>
12244                 <links/>
12245                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12246                         <actions>
12247                                 <retrieve/>
12248                         </actions>
12249                 </permacrud>
12250         </class>
12251
12252         <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">
12253                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12254                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12255                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12256                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12257                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12258                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12259                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12260                 </fields>
12261                 <links>
12262                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12263                 </links>
12264                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12265                         <actions>
12266                                 <retrieve/>
12267                         </actions>
12268                 </permacrud>
12269         </class>
12270
12271         <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">
12272                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12273                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12274                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12275                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12276                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12277                 </fields>
12278                 <links>
12279                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12280                 </links>
12281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12282                         <actions>
12283                                 <retrieve/>
12284                         </actions>
12285                 </permacrud>
12286         </class>
12287
12288     <class
12289         id="uvs"
12290         controller="open-ils.cstore open-ils.pcrud"
12291         oils_obj:fieldmapper="url_verify::session"
12292         oils_persist:tablename="url_verify.session"
12293         reporter:label="URL Verification Session"
12294     >
12295         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12296             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12297             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12298                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12299             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12300             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12301             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12302             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12303             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12304             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12305         </fields>
12306
12307         <links>
12308             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12309             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12310             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12311             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12312             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12313         </links>
12314
12315         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12316             <actions>
12317                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12318             </actions>
12319         </permacrud>
12320
12321     </class>
12322
12323     <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">
12324         <oils_persist:source_definition><![CDATA[
12325             SELECT
12326                 cbrebi.id AS id,  -- so we can have a pkey in our view
12327                 uvs.id AS session,
12328                 uvs.owning_lib,
12329                 cbrebi.target_biblio_record_entry
12330             FROM url_verify.session uvs
12331             JOIN container.biblio_record_entry_bucket cbreb
12332                 ON (uvs.container = cbreb.id)
12333             JOIN container.biblio_record_entry_bucket_item cbrebi
12334                 ON (cbrebi.bucket = cbreb.id)
12335         ]]></oils_persist:source_definition>
12336         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12337             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12338             <field reporter:label="Session" name="session" reporter:datatype="link" />
12339             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12340             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12341         </fields>
12342         <links>
12343             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12344             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12345             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12346         </links>
12347         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12348             <actions>
12349                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12350             </actions>
12351         </permacrud>
12352     </class>
12353
12354     <class
12355         id="uvus"
12356         controller="open-ils.cstore open-ils.pcrud"
12357         oils_obj:fieldmapper="url_verify::url_selector"
12358         oils_persist:tablename="url_verify.url_selector"
12359         reporter:label="URL Verification URL Selector"
12360     >
12361         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12362             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12363             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12364                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12365             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12366         </fields>
12367
12368         <links>
12369             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12370             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12371         </links>
12372
12373         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12374             <actions>
12375                 <create permission="URL_VERIFY">
12376                     <context link="session" field="owning_lib"/>
12377                 </create>
12378                 <retrieve permission="URL_VERIFY">
12379                     <context link="session" field="owning_lib"/>
12380                 </retrieve>
12381                 <update permission="URL_VERIFY">
12382                     <context link="session" field="owning_lib"/>
12383                 </update>
12384                 <delete permission="URL_VERIFY">
12385                     <context link="session" field="owning_lib"/>
12386                 </delete>
12387             </actions>
12388         </permacrud>
12389
12390     </class>
12391
12392     <class
12393         id="uvu"
12394         controller="open-ils.cstore open-ils.pcrud"
12395         oils_obj:fieldmapper="url_verify::url"
12396         oils_persist:tablename="url_verify.url"
12397         reporter:label="URL Verification URL"
12398     >
12399         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12400             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12401                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12402                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12403                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12404                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12405             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12406             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12407             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12408             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12409             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12410             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12411             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12412             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12413             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12414             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12415             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12416             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12417             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12418         </fields>
12419
12420         <links>
12421             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12422             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12423             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12424             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12425             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12426         </links>
12427
12428         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12429             <actions>
12430                 <create permission="URL_VERIFY">
12431                     <context link="session" field="owning_lib"/>
12432                 </create>
12433                 <retrieve permission="URL_VERIFY">
12434                     <context link="session" field="owning_lib"/>
12435                 </retrieve>
12436                 <update permission="URL_VERIFY">
12437                     <context link="session" field="owning_lib"/>
12438                 </update>
12439                 <delete permission="URL_VERIFY">
12440                     <context link="session" field="owning_lib"/>
12441                 </delete>
12442             </actions>
12443         </permacrud>
12444
12445     </class>
12446
12447     <class
12448         id="uvva"
12449         controller="open-ils.cstore open-ils.pcrud"
12450         oils_obj:fieldmapper="url_verify::verification_attempt"
12451         oils_persist:tablename="url_verify.verification_attempt"
12452         reporter:label="URL Verification Attempt"
12453     >
12454         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12455             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12456                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12457                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12458             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12459             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12460         </fields>
12461
12462         <links>
12463             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12464             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12465         </links>
12466
12467         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12468             <actions>
12469                 <create permission="URL_VERIFY">
12470                     <context link="session" field="owning_lib"/>
12471                 </create>
12472                 <retrieve permission="URL_VERIFY">
12473                     <context link="session" field="owning_lib"/>
12474                 </retrieve>
12475                 <update permission="URL_VERIFY">
12476                     <context link="session" field="owning_lib"/>
12477                 </update>
12478                 <delete permission="URL_VERIFY">
12479                     <context link="session" field="owning_lib"/>
12480                 </delete>
12481             </actions>
12482         </permacrud>
12483
12484     </class>
12485
12486     <class
12487         id="uvuv"
12488         controller="open-ils.cstore open-ils.pcrud"
12489         oils_obj:fieldmapper="url_verify::url_verification"
12490         oils_persist:tablename="url_verify.url_verification"
12491         reporter:label="URL Verification"
12492     >
12493         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12494             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12495                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12496                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12497             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12498             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12499             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12500             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12501                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12502         </fields>
12503
12504         <links>
12505             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12506             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12507             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
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="attempt" jump="session" field="owning_lib"/>
12514                 </create>
12515                 <retrieve permission="URL_VERIFY">
12516                     <context link="attempt" jump="session" field="owning_lib"/>
12517                 </retrieve>
12518                 <update permission="URL_VERIFY">
12519                     <context link="attempt" jump="session" field="owning_lib"/>
12520                 </update>
12521                 <delete permission="URL_VERIFY">
12522                     <context link="attempt" jump="session" field="owning_lib"/>
12523                 </delete>
12524             </actions>
12525         </permacrud>
12526
12527     </class>
12528
12529         <class
12530                 id="cfdi"
12531                 controller="open-ils.cstore open-ils.pcrud"
12532                 oils_obj:fieldmapper="config::filter_dialog_interface"
12533                 oils_persist:tablename="config.filter_dialog_interface"
12534                 reporter:label="FilterDialog Interface">
12535                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12536                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12537                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12538                 </fields>
12539                 <links>
12540                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12541                 </links>
12542                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12543                         <actions>
12544                                 <retrieve />
12545                         </actions>
12546                 </permacrud>
12547         </class>
12548
12549         <class
12550                 id="cfdfs"
12551                 controller="open-ils.cstore open-ils.pcrud"
12552                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12553                 oils_persist:tablename="config.filter_dialog_filter_set"
12554                 reporter:label="FilterDialog Filter Set">
12555                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12556                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12557                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12558                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12559                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12560                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12561                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12562                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12563                 </fields>
12564                 <links>
12565                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12566                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12567                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12568                 </links>
12569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12570                         <actions>
12571                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12572                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12573                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12574                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12575                         </actions>
12576                 </permacrud>
12577
12578         </class>
12579
12580         <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">
12581                 <fields oils_persist:primary="code">
12582                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12583                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12584                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12585                 </fields>
12586                 <links/>
12587                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12588                         <actions>
12589                                 <retrieve/>
12590                         </actions>
12591                 </permacrud>
12592         </class>
12593
12594         <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">
12595                 <oils_persist:source_definition><![CDATA[
12596
12597             SELECT  b.id,
12598                     MAX(dcp.edit_date) AS last_delete_date
12599              FROM   biblio.record_entry b
12600                     JOIN asset.call_number cn ON (cn.record = b.id)
12601                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12602              WHERE  NOT b.deleted
12603              GROUP BY b.id
12604              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12605
12606                 ]]></oils_persist:source_definition>
12607                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12608                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12609                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12610                 </fields>
12611                 <links>
12612                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12613                 </links>
12614                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12615                         <actions>
12616                                 <retrieve/>
12617                         </actions>
12618                 </permacrud>
12619         </class>
12620
12621         <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">
12622                 <fields oils_persist:primary="id">
12623                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12624                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12625                 </fields>
12626                 <links/>
12627                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12628                         <actions>
12629                                 <retrieve/>
12630                         </actions>
12631                 </permacrud>
12632         </class>
12633
12634         <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">
12635                 <fields oils_persist:primary="id">
12636                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12637                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12638                 </fields>
12639                 <links/>
12640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12641                         <actions>
12642                                 <retrieve/>
12643                         </actions>
12644                 </permacrud>
12645         </class>
12646
12647
12648         <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">
12649                 <oils_persist:source_definition><![CDATA[
12650                 SELECT
12651                     x.id,
12652                     COALESCE( y.copy_count, 0 ) AS copy_count,
12653                     x.hold_count AS hold_count,
12654                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12655                 FROM
12656                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12657                         FROM
12658                             action.hold_request ahr
12659                             JOIN reporter.hold_request_record rhrr USING (id)
12660                         WHERE
12661                             ahr.cancel_time IS NULL
12662                             AND ahr.fulfillment_time IS NULL
12663                         GROUP BY bib_record
12664                     )x
12665                     JOIN
12666                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12667                         FROM
12668                             action.hold_request ahr
12669                             JOIN reporter.hold_request_record rhrr USING (id)
12670                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12671                         WHERE
12672                             ahr.cancel_time IS NULL
12673                             AND ahr.fulfillment_time IS NULL
12674                             AND ahr.capture_time IS NULL
12675                             AND ahr.frozen IS FALSE
12676                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12677                             AND ahr.hold_type != 'M'
12678                            GROUP BY bib_record
12679                     )y
12680                     USING (id)
12681                 ]]></oils_persist:source_definition>
12682                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12683                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12684                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12685                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12686                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12687                 </fields>
12688                 <links>
12689                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12690                 </links>
12691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12692                         <actions>
12693                                 <retrieve/>
12694                         </actions>
12695                 </permacrud>
12696         </class>
12697
12698         <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">
12699                 <oils_persist:source_definition><![CDATA[
12700             SELECT *,
12701                 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,
12702                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12703             FROM
12704                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12705                     FROM
12706                         action.hold_request ahr
12707                         JOIN reporter.hold_request_record rhrr USING (id)
12708                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12709                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12710                     WHERE
12711                         ahr.cancel_time IS NULL
12712                         AND ahr.fulfillment_time IS NULL
12713                     GROUP BY bib_record, pickup_lib
12714                 )x
12715                 JOIN
12716                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12717                     FROM
12718                         action.hold_request ahr
12719                         JOIN reporter.hold_request_record rhrr USING (id)
12720                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12721                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12722                     WHERE
12723                         ahr.cancel_time IS NULL
12724                         AND ahr.fulfillment_time IS NULL
12725                         AND ahr.capture_time IS NULL
12726                         AND ahr.frozen IS FALSE
12727                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12728                         AND ahr.hold_type != 'M'
12729                     GROUP BY bib_record, pickup_lib
12730                 )y
12731                 USING(id,pickup_lib)
12732                 JOIN
12733                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12734                     FROM
12735                         action.hold_request ahr
12736                         JOIN reporter.hold_request_record rhrr USING (id)
12737                     WHERE
12738                         ahr.cancel_time IS NULL
12739                         AND ahr.fulfillment_time IS NULL
12740                     GROUP BY bib_record
12741                 )z
12742                 USING (id)
12743                 JOIN
12744                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12745                     FROM
12746                         action.hold_request ahr
12747                         JOIN reporter.hold_request_record rhrr USING (id)
12748                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12749                     WHERE
12750                         ahr.cancel_time IS NULL
12751                         AND ahr.fulfillment_time IS NULL
12752                         AND ahr.capture_time IS NULL
12753                         AND ahr.frozen IS FALSE
12754                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12755                         AND ahr.hold_type != 'M'
12756                         GROUP BY bib_record
12757                 )u
12758                 USING (id)
12759                 ]]></oils_persist:source_definition>
12760                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12761                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12762                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12763                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12764                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12765                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12766                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12767                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12768                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12769                 </fields>
12770                 <links>
12771                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12772                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12773                 </links>
12774                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12775                         <actions>
12776                                 <retrieve/>
12777                         </actions>
12778                 </permacrud>
12779         </class>
12780
12781         <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">
12782                 <oils_persist:source_definition><![CDATA[
12783             SELECT *,
12784                 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,
12785                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12786             FROM
12787                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12788                     FROM
12789                         action.hold_request ahr
12790                         JOIN actor.usr au ON (ahr.usr = au.id)
12791                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12792                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12793                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12794                     WHERE
12795                         ahr.cancel_time IS NULL
12796                         AND ahr.fulfillment_time IS NULL
12797                     GROUP BY bib_record, home_ou
12798                 )x
12799                 JOIN
12800                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12801                     FROM
12802                         action.hold_request ahr
12803                         JOIN actor.usr au ON (ahr.usr = au.id)
12804                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12805                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12806                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12807                     WHERE
12808                         ahr.cancel_time IS NULL
12809                         AND ahr.fulfillment_time IS NULL
12810                         AND ahr.capture_time IS NULL
12811                         AND ahr.frozen IS FALSE
12812                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12813                         AND ahr.hold_type != 'M'
12814                     GROUP BY bib_record, home_ou
12815                 )y
12816                 USING (id,home_ou)
12817                 JOIN
12818                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12819                     FROM
12820                         action.hold_request ahr
12821                         JOIN reporter.hold_request_record rhrr USING (id)
12822                     WHERE
12823                         ahr.cancel_time IS NULL
12824                         AND ahr.fulfillment_time IS NULL
12825                     GROUP BY bib_record
12826                 )z
12827                 USING (id)
12828                 JOIN
12829                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12830                     FROM
12831                         action.hold_request ahr
12832                         JOIN reporter.hold_request_record rhrr USING (id)
12833                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12834                     WHERE
12835                         ahr.cancel_time IS NULL
12836                         AND ahr.fulfillment_time IS NULL
12837                         AND ahr.capture_time IS NULL
12838                         AND ahr.frozen IS FALSE
12839                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12840                         AND ahr.hold_type != 'M'
12841                     GROUP BY bib_record
12842                 )u
12843                 USING (id)
12844         ]]></oils_persist:source_definition>
12845         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12846                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12847                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12848                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12849                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12850                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12851                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12852                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12853                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12854         </fields>
12855         <links>
12856                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12857                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12858         </links>
12859         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12860                 <actions>
12861                         <retrieve/>
12862                 </actions>
12863         </permacrud>
12864 </class>
12865
12866         <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) ">
12867                 <oils_persist:source_definition><![CDATA[
12868                 WITH counts_at_ou AS (
12869                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12870                 FROM
12871                     (SELECT rhrr.bib_record AS id,
12872                             aou.id AS pickup_lib_or_desc,
12873                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12874                        FROM actor.org_unit aou
12875                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12876                             action.hold_request ahr
12877                             JOIN reporter.hold_request_record rhrr USING (id)
12878                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12879                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12880                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12881                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12882                             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
12883                       GROUP BY 1, 2
12884                 ) a
12885                 JOIN
12886                     (SELECT rhrr.bib_record AS id,
12887                             aou.id AS pickup_lib_or_desc,
12888                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12889                        FROM actor.org_unit aou
12890                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12891                             action.hold_request ahr
12892                             JOIN reporter.hold_request_record rhrr USING (id)
12893                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12894                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12895                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12896                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12897                             AND ahr.hold_type != 'M'
12898                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12899                             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
12900                       GROUP BY 1, 2
12901                 ) b
12902                 USING (id,pickup_lib_or_desc)
12903             )
12904             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
12905                    y.holds_everywhere, z.copy_count_everywhere,
12906                 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,
12907                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
12908             FROM counts_at_ou x
12909                 JOIN
12910                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12911                     FROM
12912                         action.hold_request ahr
12913                         JOIN reporter.hold_request_record rhrr USING (id)
12914                     WHERE
12915                         ahr.cancel_time IS NULL
12916                         AND ahr.fulfillment_time IS NULL
12917                     GROUP BY bib_record
12918                 )y
12919                 USING (id)
12920                 JOIN
12921                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12922                     FROM
12923                         action.hold_request ahr
12924                         JOIN reporter.hold_request_record rhrr USING (id)
12925                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12926                     WHERE
12927                         ahr.cancel_time IS NULL
12928                         AND ahr.fulfillment_time IS NULL
12929                         AND ahr.capture_time IS NULL
12930                         AND ahr.frozen IS FALSE
12931                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12932                         AND ahr.hold_type != 'M'
12933                         GROUP BY bib_record
12934                 )z
12935                 USING (id)
12936                 ]]></oils_persist:source_definition>
12937                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12938                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12939                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
12940                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
12941                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
12942                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12943                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12944                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
12945                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12946                 </fields>
12947                 <links>
12948                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12949                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
12950                 </links>
12951                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12952                         <actions>
12953                                 <retrieve/>
12954                         </actions>
12955                 </permacrud>
12956         </class>
12957
12958         <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">
12959                 <oils_persist:source_definition><![CDATA[
12960             SELECT
12961                 ac.id,
12962                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
12963                 MAX(actac.xact_start) AS last_circ
12964             FROM asset.copy ac
12965                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
12966             GROUP BY ac.id
12967
12968             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
12969             --SELECT
12970             --    ac.id,
12971             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
12972             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
12973             --FROM asset.copy ac
12974             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
12975             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
12976             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
12977                 ]]></oils_persist:source_definition>
12978                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12979                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
12980                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
12981                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
12982                 </fields>
12983                 <links>
12984                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
12985                 </links>
12986                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12987                         <actions>
12988                                 <retrieve/>
12989                         </actions>
12990                 </permacrud>
12991         </class>
12992
12993         <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">
12994                 <fields oils_persist:primary="id">
12995                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
12996                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
12997                 </fields>
12998                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12999                         <actions>
13000                                 <retrieve/>
13001                         </actions>
13002                 </permacrud>
13003         </class>
13004
13005         <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">
13006                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13007                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13008                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13009                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13010                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13011                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13012                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13013                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13014                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13015                 </fields>
13016                 <links>
13017                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13018                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13019                 </links>
13020                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13021                         <actions>
13022                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13023                                 <retrieve/>
13024                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13025                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13026                         </actions>
13027                 </permacrud>
13028         </class>
13029
13030         <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">
13031                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13032                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13033                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13034                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13035                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13036                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13037                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13038                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13039                 </fields>
13040                 <links>
13041                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13042                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13043                 </links>
13044                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13045                         <actions>
13046                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13047                                 <retrieve/>
13048                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13049                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13050                         </actions>
13051                 </permacrud>
13052         </class>
13053
13054
13055         <!-- ********************************************************************************************************************* -->
13056         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13057         <!-- ********************************************************************************************************************* -->
13058         <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">
13059                 <fields oils_persist:primary="id">
13060                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13061                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13062                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13063                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13064                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13065                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13066                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13067                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13068                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13069                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13070                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13071                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13072                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13073                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13074                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13075                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13076                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13077                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13078                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13079                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13080                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13081                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13082                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13083                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13084                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13085                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13086                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13087                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13088                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13089                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13090                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13091                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13092                 </fields>
13093                 <links>
13094                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13095                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13096                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13097                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13098                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13099                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13100                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13101                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13102                 </links>
13103         </class>
13104
13105         <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">
13106                 <fields oils_persist:primary="id">
13107                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13108                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13109                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13110                 </fields>
13111                 <links>
13112                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13113                 </links>
13114         </class>
13115
13116         <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">
13117                 <fields oils_persist:primary="id">
13118                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13119                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13120                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13121                 </fields>
13122                 <links>
13123                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13124                 </links>
13125         </class>
13126
13127         <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">
13128                 <fields oils_persist:primary="id">
13129                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13130
13131                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13132                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13133                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13134
13135                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13136                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13137                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13138
13139                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13140                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13141
13142                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13143                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13144                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13145
13146                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13147                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13148
13149                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13150                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13151                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13152
13153                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13154                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13155                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13156
13157                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13158                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13159                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13160                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13161
13162                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13163                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13164
13165                 </fields>
13166                 <links>
13167                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13168                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13169                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13170                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13171                 </links>
13172         </class>
13173
13174         <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">
13175                 <oils_persist:source_definition><![CDATA[
13176
13177             SELECT
13178                 po.ordering_agency AS ordering_agency,
13179                 po.id AS purchase_order,
13180                 li.id AS lineitem,
13181                 lid.id AS lineitem_detail,
13182                 cpa.id AS claim_policy_action
13183             FROM
13184                 acq.lineitem_detail lid
13185                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13186                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13187                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13188                 JOIN acq.claim_policy_action cpa ON (
13189                     cpa.claim_policy = cp.id
13190
13191                     -- we only care about claim policy actions whose claim
13192                     -- interval we'd reached or exceeded
13193                     AND (NOW() - cpa.action_interval) > po.order_date
13194
13195                     -- filter out all claim policy actions where claim events
13196                     -- have occurred on or after the action's action_interval
13197                     AND NOT EXISTS (
13198                         SELECT 1
13199                         FROM
13200                             acq.claim_event evt
13201                             JOIN acq.claim claim ON (
13202                                 claim.id = evt.claim
13203                                 AND claim.lineitem_detail = lid.id
13204                             )
13205                         WHERE
13206                             evt.event_date >= (po.order_date + cpa.action_interval)
13207                     )
13208                 )
13209             WHERE
13210                 lid.cancel_reason IS NULL
13211                 AND li.cancel_reason IS NULL -- belt/suspenders
13212                 AND po.cancel_reason IS NULL -- belt/suspenders
13213                 AND lid.recv_time IS NULL
13214                 AND po.state = 'on-order'
13215             ORDER BY 1, 2, 3, 4, 5
13216
13217                 ]]></oils_persist:source_definition>
13218                 <fields>
13219                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13220                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13221                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13222                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13223                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13224                 </fields>
13225                 <links>
13226                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13227                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13228                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13229                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13230                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13231                 </links>
13232         </class>
13233         <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">
13234                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13235                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13236                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13237                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13238                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13239                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13240                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13241                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13242                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13243                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13244                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13245                 </fields>
13246                 <links>
13247                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13248                 </links>
13249     </class>
13250         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13251                 <oils_persist:source_definition><![CDATA[
13252             SELECT * FROM acq.lineitem_summary 
13253                                 WHERE item_count > (invoice_count + cancel_count)
13254         ]]></oils_persist:source_definition>
13255                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13256                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13257                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13258                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13259                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13260                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13261                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13262                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13263                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13264                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13265                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13266                 </fields>
13267                 <links>
13268                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13269                 </links>
13270     </class>
13271         <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">
13272                 <oils_persist:source_definition><![CDATA[
13273
13274                         SELECT  t.*
13275                           FROM  action.transit_copy t
13276                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13277                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13278                           WHERE s.parent_ou <> d.parent_ou
13279
13280                 ]]></oils_persist:source_definition>
13281                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13282                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13283                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13284                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13285                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13286                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13287                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13288                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13289                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13290                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13291                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13292                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13293                 </fields>
13294                 <links>
13295                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13296                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13297                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13298                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13299                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13300                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13301                 </links>
13302         </class>
13303
13304     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13305                 <oils_persist:source_definition><![CDATA[
13306
13307         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13308                 SELECT
13309                         cp.id as copy,
13310                         COUNT(circ.id),
13311                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13312                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13313                 FROM
13314                         asset.copy cp
13315                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13316                 GROUP BY 1, 3, 4
13317                 UNION ALL
13318                 SELECT
13319                         cp.id as copy,
13320                         COUNT(circ.id),
13321                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13322                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13323                 FROM
13324                         asset.copy cp
13325                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13326                 GROUP BY 1, 3, 4
13327                 UNION ALL
13328                 SELECT
13329                         id as copy,
13330                         circ_count,
13331                         -1 AS year,
13332                         false as is_renewal
13333                 FROM
13334                         extend_reporter.legacy_circ_count
13335         )x GROUP BY 1, 3, 4
13336
13337                 ]]></oils_persist:source_definition>
13338         <fields>
13339             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13340             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13341             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13342             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13343         </fields>
13344                 <links>
13345                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13346                 </links>
13347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13348                         <actions>
13349                                 <retrieve/>
13350                         </actions>
13351                 </permacrud>
13352     </class>
13353
13354         <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">
13355                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13356                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13357                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13358                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13359                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13360                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13361                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13362                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13363                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13364                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13365                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13366                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13367                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13368                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13369                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13370                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13371                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13372                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13373                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13374                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13375                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13376                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13377                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13378                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13379                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13380                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13381                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13382                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13383                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13384                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13385                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13386                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13387                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13388                 </fields>
13389                 <links>
13390                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13391                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13392                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13393                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13394                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13395                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13396                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13397                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13398                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13399                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13400                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13401                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13402                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13403                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13404                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13405                 </links>
13406         </class>
13407
13408     <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">
13409         <fields oils_persist:primary="id">
13410             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13411             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13412             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13413             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13414             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13415             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13416             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13417             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13418             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13419             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13420             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13421             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13422             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13423             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13424             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13425             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13426             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13427             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13428             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13429             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13430             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13431             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13432             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13433             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13434             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13435             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13436             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13437             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13438             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13439             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13440             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13441             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13442             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13443             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13444         </fields>
13445         <links>
13446             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13447             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13448             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13449             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13450             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13451             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13452             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13453             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13454         </links>
13455     </class>
13456
13457     <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">
13458         <fields oils_persist:primary="id">
13459             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13460             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13461             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13462             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13463         </fields>
13464         <links>
13465             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13466             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13467         </links>
13468     </class>
13469
13470     <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">
13471         <fields oils_persist:primary="owning_lib">
13472             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13473             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13474             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13475         </fields>
13476         <links>
13477             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13478         </links>
13479     </class>
13480
13481     <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">
13482         <fields oils_persist:primary="id">
13483             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13484             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13485             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13486             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13487             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13488         </fields>
13489         <links>
13490             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13491             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13492             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13493         </links>
13494     </class>
13495
13496     <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">
13497         <fields oils_persist:primary="circ_lib">
13498             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13499             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13500             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13501             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13502         </fields>
13503         <links>
13504             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13505             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13506         </links>
13507     </class>
13508
13509     <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">
13510         <fields oils_persist:primary="id">
13511             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13512             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13513             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13514             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13515             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13516         </fields>
13517         <links>
13518             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13519             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13520             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13521         </links>
13522     </class>
13523
13524     <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">
13525         <fields oils_persist:primary="home_ou">
13526             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13527             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13528             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13529             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13530         </fields>
13531         <links>
13532             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13533             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13534         </links>
13535     </class>
13536         <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">
13537                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13538                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13539                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13540                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13541                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13542                 </fields>
13543                 <links>
13544                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13545                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13546                 </links>
13547                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13548                         <actions>
13549                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13550                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13551                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13552                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13553                         </actions>
13554                 </permacrud>
13555         </class>
13556         <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">
13557                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13558                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13559                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13560                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13561                 </fields>
13562                 <links>
13563                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13564                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13565                         </links>
13566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13567                 <actions>
13568                                 <create permission="ADMIN_ACQ_FUND_TAG">
13569                                         <context link="tag" field="owner"/>
13570                                 </create>
13571                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13572                                         <context link="tag" field="owner"/>
13573                                 </retrieve>
13574                                 <update permission="ADMIN_ACQ_FUND_TAG">
13575                                         <context link="tag" field="owner"/>
13576                                 </update>
13577                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13578                                         <context link="tag" field="owner"/>
13579                                 </delete>
13580                         </actions>
13581                 </permacrud>
13582         </class>
13583         <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">
13584                 <oils_persist:source_definition><![CDATA[
13585                 SELECT
13586                         poi.purchase_order AS purchase_order,
13587                         ii.invoice AS invoice,
13588                         NULL AS lineitem,
13589                         poi.id AS po_item,
13590                         NULL AS picklist
13591                 FROM
13592                         acq.po_item poi
13593                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13594                 UNION SELECT
13595                         jub.purchase_order AS purchase_order,
13596                         ie.invoice AS invoice,
13597                         jub.id AS lineitem,
13598                         NULL AS po_item,
13599                         jub.picklist AS picklist
13600                 FROM
13601                         acq.lineitem jub
13602                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13603                 UNION SELECT
13604                         ii.purchase_order AS purchase_order,
13605                         ii.invoice AS invoice,
13606                         NULL AS lineitem,
13607                         NULL AS po_item,
13608                         NULL AS picklist
13609                 FROM
13610                         acq.invoice_item ii
13611                 WHERE ii.po_item IS NULL
13612                 UNION SELECT
13613                         ie.purchase_order AS purchase_order,
13614                         ie.invoice AS invoice,
13615                         NULL AS lineitem,
13616                         NULL AS po_item,
13617                         NULL AS picklist
13618                 FROM
13619                         acq.invoice_entry ie
13620                 WHERE ie.lineitem IS NULL
13621                 UNION SELECT
13622                         NULL AS purchase_order,
13623                         NULL AS invoice,
13624                         jub.id AS lineitem,
13625                         NULL AS po_item,
13626                         jub.picklist AS picklist
13627                 FROM
13628                         acq.lineitem jub
13629                 WHERE jub.purchase_order IS NULL
13630                 ]]></oils_persist:source_definition>
13631                 <fields>
13632                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13633                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13634                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13635                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13636                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13637                 </fields>
13638                 <links>
13639                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13640                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13641                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13642                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13643                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13644                 </links>
13645         </class>
13646         <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">
13647                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13648                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13649                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13650                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13651                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13652                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13653                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13654                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13655                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13656                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13657                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13658                 </fields>
13659                 <links>
13660                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13661                 </links>
13662                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13663                         <actions>
13664                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13665                                 <retrieve/>
13666                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13667                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13668                         </actions>
13669                 </permacrud>
13670         </class>
13671
13672         <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">
13673                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13674                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13675                         <field name="date_applied" reporter:datatype="timestamp"/>
13676                         <field name="org" reporter:datatype="org_unit"/>
13677                         <field name="original_value" reporter:datatype="text"/>
13678                         <field name="new_value" reporter:datatype="text"/>
13679                         <field name="field_name" reporter:datatype="link"/>
13680                 </fields>
13681                 <links>
13682                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13683                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13684                 </links>
13685         </class>
13686         <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">
13687                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13688                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13689                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13690                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13691                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13692                 </fields>
13693                 <links>
13694                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13695                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13696                 </links>
13697         </class>
13698         <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">
13699                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13700                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13701                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13702                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13703                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13704                 </fields>
13705                 <links>
13706                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13707                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13708                 </links>
13709         </class>
13710         <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">
13711                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13712                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13713                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13714                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13715                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13716                 </fields>
13717                 <links>
13718                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13719                 </links>
13720                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13721                         <actions>
13722                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13723                                 <retrieve/>
13724                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13725                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13726                         </actions>
13727                 </permacrud>
13728         </class>
13729         <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">
13730                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13731                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13732                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13733                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13734                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13735                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13736                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13737                 </fields>
13738                 <links>
13739                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13740                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13741                 </links>
13742                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13743                         <actions>
13744                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13745                                 <retrieve/>
13746                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13747                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13748                         </actions>
13749                 </permacrud>
13750         </class>
13751         <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">
13752                 <fields oils_persist:primary="code">
13753                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13754                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13755                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13756                 </fields>
13757                 <links>
13758                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13759                 </links>
13760                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13761                         <actions>
13762                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13763                                 <retrieve/>
13764                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13765                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13766                         </actions>
13767                 </permacrud>
13768         </class>
13769         <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">
13770                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13771                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13772                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13773                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13774                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13775                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13776                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13777                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13778                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13779                 </fields>
13780                 <links>
13781                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13782                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13783                 </links>
13784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13785                         <actions>
13786                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13787                                 <retrieve/>
13788                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13789                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13790                         </actions>
13791                 </permacrud>
13792         </class>
13793         <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">
13794                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13795                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13796                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13797                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13798                 </fields>
13799                 <links>
13800                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13801                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13802                 </links>
13803                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13804                         <actions>
13805                                 <create permission="UPDATE_COPY">
13806                     <context link="copy" field="circ_lib"/>
13807                 </create>
13808                                 <retrieve/>
13809                                 <update permission="UPDATE_COPY">
13810                     <context link="copy" field="circ_lib"/>
13811                 </update>
13812                                 <delete permission="UPDATE_COPY">
13813                     <context link="copy" field="circ_lib"/>
13814                 </delete>
13815                         </actions>
13816                 </permacrud>
13817         </class>
13818         <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">
13819         <oils_persist:source_definition><![CDATA[
13820         SELECT ahcm.target_copy AS id,count(*) AS count
13821          FROM
13822          action.hold_request ahr,
13823          action.hold_copy_map ahcm
13824          WHERE
13825          ahr.cancel_time IS NULL AND
13826          ahr.fulfillment_time IS NULL AND
13827          ahr.capture_time IS NULL AND
13828          ahr.id = ahcm.hold
13829          GROUP BY ahcm.target_copy
13830         ]]></oils_persist:source_definition>
13831         <fields oils_persist:primary="id">
13832             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13833             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13834         </fields>
13835         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13836             <actions>
13837                <retrieve/>
13838             </actions>
13839         </permacrud>
13840         </class>
13841
13842         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13843                 oils_obj:fieldmapper="config::workstation_setting_type" 
13844                 oils_persist:tablename="config.workstation_setting_type" 
13845                 reporter:label="Workstation Setting Type">
13846                 <fields oils_persist:primary="name">
13847                         <field name="name" reporter:datatype="text"/>
13848                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13849                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13850                         <field name="datatype" reporter:datatype="text"/>
13851                         <field name="fm_class" reporter:datatype="text"/>
13852                         <field name="grp" reporter:datatype="link"/>
13853                 </fields>
13854                 <links>
13855                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13856                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13857                 </links>
13858                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13859                         <actions>
13860                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13861                                 <retrieve/>
13862                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13863                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13864                         </actions>
13865                 </permacrud>
13866         </class>
13867
13868         <!-- no pcrud access is granted for now, because it's assumed these
13869                          setting values will be applied and retrived via the API. -->
13870         <class id="awss" 
13871                 controller="open-ils.cstore"
13872                 oils_obj:fieldmapper="actor::workstation_setting" 
13873                 oils_persist:tablename="actor.workstation_setting" 
13874                 reporter:label="Workstation Setting">
13875                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13876                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13877                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13878                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13879                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
13880                 </fields>
13881                 <links>
13882                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13883                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13884                 </links>
13885         </class>
13886
13887         <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">
13888         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13889                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
13890                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
13891                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
13892         </fields>
13893         </class>
13894
13895         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
13896                 oils_obj:fieldmapper="config::print_template" 
13897                 oils_persist:tablename="config.print_template" 
13898                 reporter:label="Print Templates">
13899                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13900                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
13901                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13902                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13903                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13904                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13905                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13906                         <field name="content_type" reporter:datatype="text"/>
13907                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13908                 </fields>
13909                 <links>
13910                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13911                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13912                 </links>
13913                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13914                         <actions>
13915                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13916                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
13917                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13918                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13919                         </actions>
13920                 </permacrud>
13921         </class>
13922
13923         <class id="cct" 
13924                 controller="open-ils.cstore open-ils.pcrud"
13925                 oils_obj:fieldmapper="config::carousel_type" 
13926                 oils_persist:tablename="config.carousel_type" 
13927                 reporter:label="Carousel Types">
13928                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
13929                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
13930                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13931                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
13932                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
13933                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
13934                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
13935                 </fields>
13936                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13937                         <actions>
13938                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13939                                 <retrieve/>
13940                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13941                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13942                         </actions>
13943                 </permacrud>
13944         </class>
13945
13946         <class id="cc" 
13947                 controller="open-ils.cstore open-ils.pcrud"
13948                 oils_obj:fieldmapper="container::carousel" 
13949                 oils_persist:tablename="container.carousel" 
13950                 reporter:label="Carousels">
13951                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
13952                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
13953                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
13954                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
13955                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13956                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
13957                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
13958                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
13959                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
13960                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
13961                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
13962                         <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 -->
13963                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
13964                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
13965                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
13966                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
13967                 </fields>
13968                 <links>
13969                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
13970                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13971                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
13972                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13973                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
13974                 </links>
13975                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13976                         <actions>
13977                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
13978                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
13979                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
13980                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
13981                         </actions>
13982                 </permacrud>
13983         </class>
13984
13985         <class id="ccou" 
13986                 controller="open-ils.cstore open-ils.pcrud"
13987                 oils_obj:fieldmapper="container::carousel_org_unit" 
13988                 oils_persist:tablename="container.carousel_org_unit" 
13989                 reporter:label="Carousels Visible at Library">
13990                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
13991                         <field reporter:label="ID" name="id" reporter:datatype="id" />
13992                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
13993                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
13994                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
13995                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
13996                 </fields>
13997                 <links>
13998                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
13999                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14000                 </links>
14001                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14002                         <actions>
14003                                 <create permission="ADMIN_CAROUSEL">
14004                                     <context link="carousel" field="owner" />
14005                                 </create>
14006                                 <retrieve permission="ADMIN_CAROUSEL">
14007                                     <context link="carousel" field="owner" />
14008                                 </retrieve>
14009                                 <update permission="ADMIN_CAROUSEL">
14010                                     <context link="carousel" field="owner" />
14011                                 </update>
14012                                 <delete permission="ADMIN_CAROUSEL">
14013                                     <context link="carousel" field="owner" />
14014                                 </delete>
14015                         </actions>
14016                 </permacrud>
14017         </class>
14018
14019         <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">
14020                 <fields oils_persist:primary="name">
14021                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14022                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14023                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14024                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14025                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14026                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14027                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14028                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14029                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14030                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14031                 </fields>
14032                 <links>
14033                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14034                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14035                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14036                 </links>
14037                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14038                         <actions>
14039                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14040                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14041                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14042                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14043                         </actions>
14044                 </permacrud>
14045         </class>
14046         <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">
14047                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14048                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14049                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14050                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14051                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14052                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14053                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14054                 </fields>
14055                 <links>
14056                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14057                 </links>
14058                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14059                         <actions>
14060                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14061                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14062                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14063                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14064                         </actions>
14065                 </permacrud>
14066         </class>
14067
14068     <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">
14069         <fields oils_persist:primary="code">
14070             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14071             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14072         </fields>
14073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14074                         <actions>
14075                                 <retrieve/>
14076                         </actions>
14077                 </permacrud>
14078         </class>
14079
14080     <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">
14081         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14082             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14083             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14084             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14085             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14086             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14087             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14088             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14089             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14090                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14091         </fields>
14092                 <links>
14093                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14094                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14095                 </links>
14096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14097             <actions>
14098                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14099                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14100                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14101                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14102             </actions>
14103         </permacrud>
14104     </class>
14105
14106         <!-- Simple Reporter classes are currently used only by the SR UI -->
14107     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14108         <oils_persist:source_definition><![CDATA[
14109             SELECT
14110               -- Circ id; just for counting
14111               combcirc.id AS circ_id,
14112
14113               -- User info, currently limiting to what's available from action.all_circulation
14114               combcirc.usr_post_code AS usr_post_code,
14115               combcirc.usr_birth_year AS usr_bith_year,
14116               combcirc.usr_profile AS usr_profile_id,
14117               pgtu.name AS usr_profile,
14118               combcirc.usr_home_ou AS usr_home_ou_id,
14119               aouuh.shortname AS usr_home_ou_shortname,
14120               aouuh.name AS usr_home_ou_name,
14121               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14122               aouus.shortname AS usr_sys_shortname,
14123               aouus.name AS usr_sys_name,
14124
14125               -- Circ info
14126               -- Checkout
14127               combcirc.xact_start AS xact_start,
14128               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14129               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14130               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14131               combcirc.circ_lib AS circ_lib_id,
14132               aouco.shortname AS circ_lib_shortname,
14133               aouco.name AS circ_lib_name,
14134               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14135               aoucos.shortname AS circ_sys_shortname,
14136               aoucos.name AS circ_sys_name,
14137               auco.usrname AS circ_staff,
14138               awso.name AS checkout_workstation,
14139
14140               combcirc.due_date AS due_date,
14141               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14142               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14143               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14144
14145               -- Checkin
14146               combcirc.xact_finish AS xact_finish,
14147               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14148               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14149               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14150               aouci.shortname AS checkin_lib_shortname,
14151               aouci.name AS checkin_lib_name,
14152               auci.usrname AS checkin_staff,
14153               awsi.name AS checkin_workstation,
14154               aoucis.shortname AS checkin_sys_shortname,
14155               aoucis.name AS checkin_sys_name,
14156
14157               combcirc.checkin_time AS checkin_time,
14158
14159               -- Misc circ info
14160               combcirc.renewal_remaining AS renewal_remaining,
14161               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14162               combcirc.grace_period AS grace_period,
14163
14164               combcirc.stop_fines AS stop_fines,
14165               combcirc.stop_fines_time AS stop_fines_time,
14166
14167               combcirc.duration AS duration,
14168               combcirc.fine_interval AS fine_interval,
14169               combcirc.recurring_fine AS recurring_fine,
14170               combcirc.max_fine AS max_fine,
14171               combcirc.duration_rule AS duration_rule,
14172               combcirc.recurring_fine_rule AS recurring_fine_rule,
14173               combcirc.max_fine_rule AS max_fine_rule,
14174               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14175               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,
14176               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14177
14178               -- Copy info
14179               acp.barcode AS copy_barcode,
14180               acp.circ_modifier AS copy_circ_modifier_code,
14181               ccm.name AS copy_circ_modifier_name,
14182               acp.circ_lib AS copy_circ_lib_id,
14183               acp.location AS location_id,
14184               acpl.name AS location_name,
14185               aoucp.shortname AS copy_circ_lib_shortname,
14186               aoucp.name AS copy_circ_lib_name,
14187               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14188               aoucps.shortname AS copy_sys_shortname,
14189               aoucps.name AS copy_sys_name,
14190               combcirc.copy_owning_lib AS copy_owning_lib_id,
14191               aoucpo.shortname AS copy_owning_lib_shortname,
14192               aoucpo.name AS copy_owning_lib_name,
14193               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14194               acnp.label AS copy_call_number_prefix,
14195               acn.label AS copy_call_number_label,
14196               acns.label AS copy_call_number_suffix,
14197               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14198               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14199               acn.label_sortkey AS copy_call_number_label_sortkey,
14200               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14201               COALESCE(rmsr.title, acp.dummy_title) AS title,
14202               COALESCE(rmsr.author, acp.dummy_author) AS author,
14203               rmsr.publisher AS publisher,
14204               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14205               array_to_string(rmsr.isbn, ', ') AS isbn,
14206               array_to_string(rmsr.issn, ', ') AS issn,
14207               part.label AS part_label,
14208               part.label_sortkey AS part_label_sortkey,
14209               acn.record AS bib_id,
14210               rmsr.tcn_value AS tcn_value
14211
14212             FROM
14213               action.all_circulation combcirc
14214
14215               -- User
14216               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14217               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14218               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14219
14220               -- Circ
14221               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14222               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14223               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14224               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14225               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14226               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14227               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14228               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14229
14230               -- Copy / call / title
14231               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14232                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14233               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14234               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14235               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14236               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14237               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14238               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14239               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14240               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14241               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14242               LEFT JOIN (
14243                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14244                 FROM biblio.monograph_part bmp
14245                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14246                 WHERE NOT bmp.deleted
14247               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14248         ]]></oils_persist:source_definition>
14249         <field_groups>
14250             <group name="common" reporter:label="Common Fields"/>
14251             <group name="item" reporter:label="Item Fields"/>
14252             <group name="user" reporter:label="Patron Fields"/>
14253             <group name="title" reporter:label="Call Number and Title Fields"/>
14254             <group name="org" reporter:label="Libraries"/>
14255         </field_groups>
14256         <fields oils_persist:primary="circ_id">
14257             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14258             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14259             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14260             <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"/>
14261             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14262             <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"/>
14263             <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"/>
14264             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14265             <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"/>
14266             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14267             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14268             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14269             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14270             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14271             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14272             <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"/>
14273             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14274             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14275             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14276             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14277             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14278             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14279             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14280             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14281             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14282             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14283             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14284             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14285             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14286             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14287             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14288             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14289             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14290             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14291             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14292             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14293             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14294             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14295             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14296             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14297             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14298             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14299             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14300             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14301             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14302             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14303             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14304             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14305             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14306             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14307             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14308             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14309             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14310             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14311             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14312             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14313             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14314             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14315             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14316             <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"/>
14317             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14318             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14319             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14320             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14321             <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"/>
14322             <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"/>
14323             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14324             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14325             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14326             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14327             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14328             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14329             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14330             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14331             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14332             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14333             <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"/>
14334             <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"/>
14335             <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"/>
14336             <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"/>
14337             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14338             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14339             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14340             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14341             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14342             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14343             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14344             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14345             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14346             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14347         </fields>
14348         <links>
14349             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14350             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14351             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14352         </links>
14353     </class>
14354
14355     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14356         <oils_persist:source_definition><![CDATA[
14357             SELECT
14358               au.home_ou AS home_ou_filter,
14359               au.id AS user_id,
14360               cardp.barcode AS barcode_primary,
14361               au.usrname AS usrname,
14362               au.email AS email,
14363               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14364               au.prefix AS prefix,
14365               au.first_given_name AS first_given_name,
14366               au.second_given_name AS second_given_name,
14367               au.family_name AS family_name,
14368               au.suffix AS suffix,
14369               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14370               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14371               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14372               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14373               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14374               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14375               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14376               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14377               au.profile AS profile_id,
14378               pgt.name AS profile,
14379               au.alias AS alias,
14380               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14381               au.day_phone AS day_phone,
14382               au.evening_phone AS evening_phone,
14383               au.other_phone AS other_phone,
14384               au.dob AS dob,
14385               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14386               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14387               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14388               au.active AS active,
14389               au.barred AS barred,
14390               au.deleted AS deleted,
14391               au.juvenile AS juvenile,
14392               au.claims_returned_count AS claims_returned_count,
14393               au.credit_forward_balance AS credit_forward_balance,
14394               au.create_date AS create_date,
14395               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14396               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14397               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14398               au.expire_date AS expire_date,
14399               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14400               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14401               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14402               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14403               au.last_update_time AS last_update_time,
14404               au.home_ou AS home_ou_id,
14405               aouh.shortname AS home_ou_shortname,
14406               aouh.name AS home_ou_name,
14407               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14408               aous.shortname AS home_sys_shortname,
14409               aous.name AS home_sys_name,
14410               auam.valid AS mailing_valid,
14411               auam.address_type AS mailing_address_type,
14412               auam.street1 AS mailing_street1,
14413               auam.street2 AS mailing_street2,
14414               auam.city AS mailing_city,
14415               auam.state AS mailing_state,
14416               auam.country AS mailing_country,
14417               auam.post_code AS mailing_post_code,
14418               auam.county AS mailing_county,
14419               auam.within_city_limits AS mailing_within_city_limits,
14420               auam.pending AS mailing_pending,
14421               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14422               auap.valid AS physical_valid,
14423               auap.address_type AS physical_address_type,
14424               auap.street1 AS physical_street1,
14425               auap.street2 AS physical_street2,
14426               auap.city AS physical_city,
14427               auap.state AS physical_state,
14428               auap.country AS physical_country,
14429               auap.post_code AS physical_post_code,
14430               auap.county AS physical_county,
14431               auap.within_city_limits AS physical_within_city_limits,
14432               auap.pending AS physical_pending,
14433               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14434               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14435               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14436               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14437               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14438               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14439               asceum1.stat_cat_entry AS legacy_stat_cat1,
14440               asceum2.stat_cat_entry AS legacy_stat_cat2,
14441
14442               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14443               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14444               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14445               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14446               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,
14447               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14448
14449             FROM
14450               actor.usr au
14451               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14452               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14453               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14454               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14455               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14456               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14457               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14458               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14459               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14460               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14461               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14462               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14463               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14464               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14465               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14466               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14467
14468             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14469               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14470               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14471               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14472               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14473               76,77,78,79,80,81
14474         ]]></oils_persist:source_definition>
14475         <field_groups>
14476             <group name="common" reporter:label="Common Fields"/>
14477             <group name="name" reporter:label="Name Fields"/>
14478             <group name="contact" reporter:label="Contact Fields"/>
14479             <group name="address" reporter:label="Address Related Fields"/>
14480             <group name="org" reporter:label="Libraries"/>
14481         </field_groups>
14482         <fields oils_persist:primary="user_id">
14483             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14484                 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"/>
14485             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14486             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14487             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14488             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14489             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14490             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14491             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14492             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14493             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14494             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14495             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14496             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14497             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14498             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14499             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14500             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14501             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14502             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14503             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14504             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14505             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14506             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14507             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14508             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14509             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14510             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14511             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14512             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14513             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14514             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14515             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14516             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14517             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14518             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14519             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14520             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14521             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14522             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14523             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14524             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14525             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14526             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14527             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14528             <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"/>
14529             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14530             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14531             <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"/>
14532             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14533             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14534             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14535             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14536             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14537             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14538             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14539             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14540             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14541             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14542             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14543             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14544             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14545             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14546             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14547             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14548             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14549             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14550             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14551             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14552             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14553             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14554             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14555             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14556             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14557             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14558             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14559             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14560             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14561             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14562             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14563             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14564             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14565             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14566             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14567             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14568             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14569             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14570         </fields>
14571         <links>
14572             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14573         </links>
14574     </class>
14575
14576     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14577         <oils_persist:source_definition><![CDATA[
14578             SELECT
14579               -- ids
14580               acp.id AS copy_id,
14581               acp.floating AS floating_id,
14582               acn.id AS acn_id,
14583               acp.circ_lib AS circ_lib_id,
14584               acp.status AS status_id,
14585               acp.location AS location_id,
14586               acp.age_protect AS age_protect_id,
14587               aous.id AS circ_sys_id,
14588               acn.owning_lib AS owning_lib_id,
14589               aouos.id AS owning_sys_id,
14590               awsi.id AS inv_workstation_id,
14591
14592               -- OUs
14593               aou.shortname AS circ_lib_shortname,
14594               aou.name AS circ_lib_name,
14595               aous.shortname AS circ_sys_shortname,
14596               aous.name AS circ_sys_name,
14597               aouo.shortname AS owning_lib_shortname,
14598               aouo.name AS owning_lib_name,
14599               aouos.shortname AS owning_sys_shortname,
14600               aouos.name AS owning_sys_name,
14601
14602               -- dates
14603               acp.create_date AS create_date_time,
14604               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14605               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14606               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14607               acp.active_date AS active_date_time,
14608               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14609               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14610               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14611               acp.edit_date AS edit_date_time,
14612               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14613               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14614               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14615               acp.status_changed_time AS status_changed_time_time,
14616               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14617               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14618               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14619               ali.inventory_date AS latest_inv_date,
14620               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14621               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14622               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14623
14624               -- acp
14625               acp.barcode AS barcode,
14626               ccs.name AS status,
14627               acpl.name AS location_name,
14628                                                         acp.circ_modifier AS copy_circ_modifier_code,
14629                                                         ccm.name AS copy_circ_modifier_name,
14630               acp.price AS price,
14631               acp.cost AS acq_price,
14632               acp.deleted AS copy_deleted,
14633               acp.ref AS reference,
14634               acp.circulate AS copy_circulate,
14635               (acp.circulate AND acpl.circulate) AS circulate,
14636               acp.holdable AS copy_holdable,
14637               acp.deposit AS deposit,
14638               acp.deposit_amount AS deposit_amount,
14639               acp.alert_message AS alert_message,
14640               acp.opac_visible AS copy_opac_visible,
14641               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14642               crahp.name AS age_protect,
14643               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14644               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14645               acp.copy_number AS copy_number,
14646               acp.circ_as_type AS circ_as_type,
14647               acp.loan_duration AS loan_duration_int,
14648               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14649               acp.fine_level AS fine_level_int,
14650               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14651
14652               -- Call Number
14653               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14654               acnp.label AS copy_call_number_prefix,
14655               acn.label AS copy_call_number_label,
14656               acns.label AS copy_call_number_suffix,
14657               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14658               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14659               acn.label_sortkey AS copy_call_number_label_sortkey,
14660               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14661               racnd.dewey AS call_number_dewey,
14662               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14663               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14664               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14665               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14666
14667               -- Misc
14668               COALESCE(rmsr.title, acp.dummy_title) AS title,
14669               COALESCE(rmsr.author, acp.dummy_author) AS author,
14670               rmsr.publisher AS publisher,
14671               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14672               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14673               array_to_string(rmsr.issn, ', ') AS issn,
14674               part.label AS part_label,
14675               part.label_sortkey AS part_label_sortkey,
14676               acn.record AS bib_id,
14677               rmsr.tcn_value AS tcn_value,
14678               acn.deleted AS call_deleted,
14679               bre.deleted AS bib_deleted,
14680               ccs.holdable AS status_holdable,
14681               acpl.holdable AS location_holdable,
14682               acp.circulate AS location_circulate,
14683               awsi.name AS inventory_workstation,
14684               aucr.usrname AS creating_user,
14685               aued.usrname AS editing_user,
14686
14687               -- Aggregates
14688               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14689               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,
14690               COUNT(DISTINCT combcirc.id) AS circ_total,
14691               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14692
14693             FROM
14694               asset.copy acp
14695               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14696               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14697               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14698               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14699               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14700               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14701               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14702               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14703               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14704               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14705               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14706               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14707               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14708               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14709               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14710               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14711               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14712               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14713               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14714               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14715               LEFT JOIN (
14716                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14717                 FROM biblio.monograph_part bmp
14718                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14719                 WHERE NOT bmp.deleted
14720               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14721
14722             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14723               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14724               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14725               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14726               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14727               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14728               91,92,93,94,95,96
14729
14730         ]]></oils_persist:source_definition>
14731         <field_groups>
14732             <group name="common" reporter:label="Common Fields"/>
14733             <group name="dates" reporter:label="Date Fields"/>
14734             <group name="title" reporter:label="Call Number and Title Fields"/>
14735             <group name="org" reporter:label="Libraries"/>
14736         </field_groups>
14737         <fields oils_persist:primary="copy_id">
14738             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14739             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14740             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14741             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14742             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14743             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14744             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14745             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14746             <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"/>
14747             <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"/>
14748             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14749             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14750             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14751             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14752             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14753             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14754             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14755             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14756             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14757             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14758             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14759             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14760             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14761             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14762             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14763             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14764             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14765             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14766             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14767             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14768             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14769             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14770             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14771             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14772             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14773             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14774             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14775             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14776             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14777             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14778             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14779             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14780             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14781             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14782             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14783             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14784             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14785             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14786             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14787             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14788             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14789             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14790             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14791             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14792             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14793             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14794             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14795             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14796             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14797             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14798             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14799             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14800             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14801             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14802             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14803             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14804             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14805             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14806             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14807             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14808             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14809             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14810             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14811             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14812             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14813             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14814             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14815             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14816             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14817             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14818             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14819             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14820             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14821             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14822             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14823             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14824             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14825             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14826             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14827             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14828             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14829             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14830             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14831             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14832         </fields>
14833         <links>
14834             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14835             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14836             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14837             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14838             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14839             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14840         </links>
14841     </class>
14842
14843     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14844         <oils_persist:source_definition><![CDATA[
14845
14846             SELECT
14847               -- ids
14848               acp.id AS copy_id,
14849               acn.id AS acn_id,
14850               acp.circ_lib AS circ_lib_id,
14851               acp.status AS status_id,
14852               acp.location AS location_id,
14853               acp.age_protect AS age_protect_id,
14854               aous.id AS circ_sys_id,
14855               acn.owning_lib AS owning_lib_id,
14856               aouos.id AS owning_sys_id,
14857               awsi.id AS inv_workstation_id,
14858
14859               -- OUs
14860               aou.shortname AS circ_lib_shortname,
14861               aou.name AS circ_lib_name,
14862               aous.shortname AS circ_sys_shortname,
14863               aous.name AS circ_sys_name,
14864               aouo.shortname AS owning_lib_shortname,
14865               aouo.name AS owning_lib_name,
14866               aouos.shortname AS owning_sys_shortname,
14867               aouos.name AS owning_sys_name,
14868
14869               -- dates
14870               acp.create_date AS create_date_time,
14871               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14872               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14873               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14874               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14875               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14876               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14877               acp.active_date AS active_date_time,
14878               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14879               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14880               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14881               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14882               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14883               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14884               acp.edit_date AS edit_date_time,
14885               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14886               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14887               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14888               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14889               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14890               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14891               acp.status_changed_time AS status_changed_time_time,
14892               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14893               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14894               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14895               ali.inventory_date AS latest_inv_date,
14896               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14897               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14898               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14899               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14900               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14901               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14902
14903               -- acp
14904               acp.barcode AS barcode,
14905               ccs.name AS status,
14906               acpl.name AS location_name,
14907               acp.circ_modifier AS circ_modifier_code,
14908               ccm.name AS circ_modifier_name,
14909               acp.price AS price,
14910               acp.cost AS acq_price,
14911               acp.deleted AS copy_deleted,
14912               acp.ref AS reference,
14913               acp.circulate AS copy_circulate,
14914               (acp.circulate AND acpl.circulate) AS circulate,
14915               acp.holdable AS copy_holdable,
14916               acp.deposit AS deposit,
14917               acp.deposit_amount AS deposit_amount,
14918               acp.alert_message AS alert_message,
14919               acp.opac_visible AS copy_opac_visible,
14920               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14921               crahp.name AS age_protect,
14922               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14923               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14924               acp.copy_number AS copy_number,
14925               acp.circ_as_type AS circ_as_type,
14926               acp.loan_duration AS loan_duration_int,
14927               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14928               acp.fine_level AS fine_level_int,
14929               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14930
14931               -- Call Number
14932               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14933               acnp.label AS copy_call_number_prefix,
14934               acn.label AS copy_call_number_label,
14935               acns.label AS copy_call_number_suffix,
14936               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14937               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14938               acn.label_sortkey AS copy_call_number_label_sortkey,
14939               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14940               racnd.dewey AS call_number_dewey,
14941               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14942               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14943               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14944               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14945
14946               -- Misc
14947               COALESCE(rmsr.title, acp.dummy_title) AS title,
14948               COALESCE(rmsr.author, acp.dummy_author) AS author,
14949               rmsr.publisher AS publisher,
14950               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14951               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14952               array_to_string(rmsr.issn, ', ') AS issn,
14953               part.label AS part_label,
14954               part.label_sortkey AS part_label_sortkey,
14955               acn.record AS bib_id,
14956               rmsr.tcn_value AS tcn_value,
14957               acn.deleted AS call_deleted,
14958               bre.deleted AS bib_deleted,
14959               ccs.holdable AS status_holdable,
14960               acpl.holdable AS location_holdable,
14961               acp.circulate AS location_circulate,
14962               awsi.name AS inventory_workstation,
14963
14964               -- Aggregates
14965               -- may decide these price games aren't worth it, but estimated collection value is useful
14966               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,
14967               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
14968               MAX(combcirc.xact_start) AS last_circ_datetime,
14969               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
14970               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
14971               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
14972               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
14973               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
14974               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
14975               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
14976               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
14977               (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,
14978               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
14979               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
14980               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
14981               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
14982               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
14983               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
14984               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,
14985               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,
14986               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,
14987               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
14988
14989             FROM
14990               asset.copy acp
14991               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14992               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14993               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14994               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14995               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14996               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14997               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14998               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14999               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15000               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15001               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15002               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15003               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15004               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15005               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15006               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15007               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15008               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15009               LEFT JOIN (
15010                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15011                 FROM biblio.monograph_part bmp
15012                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15013                 WHERE NOT bmp.deleted
15014               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15015
15016             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15017               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15018               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15019               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15020               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15021               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15022               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15023
15024         ]]></oils_persist:source_definition>
15025         <field_groups>
15026             <group name="common" reporter:label="Common Fields"/>
15027             <group name="dates" reporter:label="Date Fields"/>
15028             <group name="inv" reporter:label="Inventory Fields"/>
15029             <group name="title" reporter:label="Call Number and Title Fields"/>
15030             <group name="org" reporter:label="Libraries"/>
15031         </field_groups>
15032         <fields oils_persist:primary="copy_id">
15033              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15034              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15035              <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"/>
15036              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15037              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15038              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15039              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15040              <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"/>
15041              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15042              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15043              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15044              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15045              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15046              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15047              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15048              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15049              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15050              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15051              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15052              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15053              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15054              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15055              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15056              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15057              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15058              <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"/>
15059              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15060              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15061              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15062              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15063              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15064              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15065              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15066              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15067              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15068              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15069              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15070              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15071              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15072              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15073              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15074              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15075              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15076              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15077              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15078              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15079              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15080              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15081              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15082              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15083              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15084              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15085              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15086              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15087              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15088              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15089              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15090              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15091              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15092              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15093              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15094              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15095              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15096              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15097              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15098              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15099              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15100              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15101              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15102              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15103              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15104              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15105              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15106              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15107              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15108              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15109              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15110              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15111              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15112              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15113              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15114              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15115              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15116              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15117              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15118              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15119              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15120              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15121              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15122              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15123              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15124              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15125              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15126              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15127              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15128              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15129              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15130              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15131              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15132              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15133              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15134              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15135              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15136              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15137              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15138              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15139              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15140              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15141              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15142              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15143              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15144              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15145              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15146              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15147              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15148              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15149              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15150              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15151              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15152              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15153              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15154              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15155              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15156              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15157              <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"/>
15158              <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"/>
15159              <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"/>
15160         </fields>
15161         <links>
15162             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15163             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15164             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15165             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15166             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15167         </links>
15168     </class>
15169
15170     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15171         <oils_persist:source_definition><![CDATA[
15172
15173             SELECT
15174               -- ids
15175               xact.id AS xact_id,
15176               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15177               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15178
15179               -- OUs
15180               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15181               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15182               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15183               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15184
15185               -- billings
15186               billings.total_amount AS billing_grand_total,
15187               billings.total_unvoided_amount AS billing_total,
15188
15189               billings.voided_billing_count AS billing_voided_count,
15190               billings.all_billing_types AS all_billing_types,
15191               billings.billing_types AS billing_types,
15192
15193               billings.total_voided_amount AS billing_total_voided,
15194               billings.total_overdue_amount AS billing_overdue_amount,
15195               billings.total_lost_amount AS billing_lost_amount,
15196               billings.total_long_od_amount AS billing_long_od_amount,
15197               billings.total_damaged_amount AS billing_damaged_amount,
15198               billings.total_deposit_amount AS billing_deposit_amount,
15199               billings.total_rental_amount AS billing_rental_amount,
15200
15201               -- payments
15202               payments.total_amount AS payment_grand_total,
15203               payments.total_unvoided_amount AS payment_total,
15204
15205               payments.voided_payment_count AS payment_voided_count,
15206               payments.all_payment_types AS all_payment_types,
15207               payments.payment_types AS payment_types,
15208
15209               payments.total_voided_amount AS payment_total_voided,
15210               payments.total_account_adjustment AS payment_account_adjustment_amount,
15211               payments.total_cash_payment AS payment_cash_amount,
15212               payments.total_check_payment AS payment_check_amount,
15213               payments.total_credit_card_payment AS payment_credit_card_amount,
15214               payments.total_debit_card_payment AS payment_debit_card_amount,
15215               payments.total_credit_payment AS payment_credit_amount,
15216               payments.total_forgive_payment AS payment_forgive_amount,
15217               payments.total_work_payment AS payment_work_amount,
15218               payments.total_goods_payment AS payment_goods_amount,
15219               payments.total_currency_payment AS payment_currency_amount,
15220               payments.total_non_currency_payment AS payment_non_currency_amount,
15221
15222               -- dates
15223               xact.xact_start AS xact_start,
15224               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15225               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15226               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15227               xact.xact_finish AS xact_finish,
15228               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15229               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15230               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15231               billings.earliest_billing_ts AS earliest_billing_ts,
15232               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15233               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15234               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15235               billings.latest_billing_ts AS latest_billing_ts,
15236               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15237               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15238               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15239               payments.earliest_payment_ts AS earliest_payment_ts,
15240               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15241               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15242               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15243               payments.latest_payment_ts AS latest_payment_ts,
15244               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15245               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15246               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15247
15248               -- Misc
15249               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15250               (xact.xact_finish IS NOT NULL) AS xact_closed
15251
15252             FROM
15253               money.billable_xact xact
15254               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15255               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15256               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15257               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15258               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15259               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15260
15261               -- oohh nooo.... If not done this way you encounter situations
15262               -- like multiplying billing totals x number of payments and
15263               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15264               LEFT JOIN (
15265                 SELECT
15266                   xact,
15267                   MIN(billing_ts) AS earliest_billing_ts,
15268                   MAX(billing_ts) AS latest_billing_ts,
15269
15270                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15271                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15272                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15273
15274                   SUM(amount) AS total_amount,
15275                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15276                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15277                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15278                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15279                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15280                   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.
15281                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15282                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15283
15284                 FROM
15285                   money.all_billings
15286                 GROUP BY 1
15287               ) billings ON (xact.id = billings.xact)
15288               -- Can't include accepting user or cash_drawer because that will "duplicate"
15289               -- rows if multiple staff accept payments on a single xact...
15290               LEFT JOIN (
15291                 SELECT
15292                   xact,
15293                   MIN(payment_ts) AS earliest_payment_ts,
15294                   MAX(payment_ts) AS latest_payment_ts,
15295
15296                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15297                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15298                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15299
15300                   SUM(amount) AS total_amount,
15301                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15302                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15303                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15304                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15305                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15306                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15307                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15308                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15309                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15310                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15311                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15312                   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,
15313                   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
15314
15315                 FROM
15316                   money.all_payments
15317                 GROUP BY 1
15318               ) payments ON (xact.id = payments.xact)
15319
15320         ]]></oils_persist:source_definition>
15321         <field_groups>
15322             <group name="common" reporter:label="Common Fields"/>
15323             <group name="bill" reporter:label="Billing Fields"/>
15324             <group name="pay" reporter:label="Payment Fields"/>
15325             <group name="dates" reporter:label="Date Fields"/>
15326             <group name="org" reporter:label="Libraries"/>
15327         </field_groups>
15328         <fields oils_persist:primary="xact_id">
15329              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15330              <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"/>
15331              <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"/>
15332              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15333              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15334              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15335              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15336              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15337              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15338              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15339              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15340              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15341              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15342              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15343              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15344              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15345              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15346              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15347              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15348              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15349              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15350              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15351              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15352              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15353              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15354              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15355              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15356              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15357              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15358              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15359              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15360              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15361              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15362              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15363              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15364              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15365              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15366              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15367              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15368              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15369              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15370              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15371              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15372              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15373              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15374              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15375              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15376              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15377              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15378              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15379              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15380              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15381              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15382              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15383              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15384              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15385              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15386              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15387              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15388              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15389              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15390              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15391         </fields>
15392     </class>
15393
15394         <!-- ********************************************************************************************************************* -->
15395 </IDL>
15396
15397 <!--
15398     vim:noet:ts=4:sw=4:
15399 -->