]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP2061136 - Stamping 1405 DB upgrade script
[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 <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">
74
75         <!-- Virtual classes -->
76
77         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio" oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list" oils_persist:tablename="oai.biblio">
78                 <fields oils_persist:primary="rec_id">
79                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
80                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
81                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
82                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
83                 </fields>
84         </class>
85         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority" oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list" oils_persist:tablename="oai.authority">
86                 <fields oils_persist:primary="rec_id">
87                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
88                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
89                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
90                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
91                 </fields>
92         </class>
93
94         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
95                 <fields>
96                         <field name="usr" oils_persist:virtual="true"/>
97                         <field name="forgive_payment" oils_persist:virtual="true"/>
98                         <field name="work_payment" oils_persist:virtual="true"/>
99                         <field name="credit_payment" oils_persist:virtual="true"/>
100                         <field name="goods_payment" oils_persist:virtual="true"/>
101                         <field name="account_adjustment" oils_persist:virtual="true"/>
102                 </fields>
103                 <links>
104                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
105                 </links>
106         </class>
107
108         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
109                 <fields>
110                         <field name="workstation" oils_persist:virtual="true"/>
111                         <field name="cash_payment" oils_persist:virtual="true"/>
112                         <field name="check_payment" oils_persist:virtual="true"/>
113                         <field name="credit_card_payment" oils_persist:virtual="true"/>
114                         <field name="debit_card_payment" oils_persist:virtual="true"/>
115                 </fields>
116                 <links>
117                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
118                 </links>
119         </class>
120
121         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
122                 <fields>
123                         <field name="id" oils_persist:virtual="true"/>
124                         <field name="children" oils_persist:virtual="true"/>
125                         <field name="owner_doc" oils_persist:virtual="true"/>
126                         <field name="intra_doc_id" oils_persist:virtual="true"/>
127                         <field name="parent_node" oils_persist:virtual="true"/>
128                         <field name="node_type" oils_persist:virtual="true"/>
129                         <field name="namespace_uri" oils_persist:virtual="true"/>
130                         <field name="name" oils_persist:virtual="true"/>
131                         <field name="value" oils_persist:virtual="true"/>
132                 </fields>
133         </class>
134
135         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
136                 <fields>
137                         <field name="title" oils_persist:virtual="true"/>
138                         <field name="author" oils_persist:virtual="true"/>
139                         <field name="doc_id" oils_persist:virtual="true"/>
140                         <field name="doc_type" oils_persist:virtual="true"/>
141                         <field name="pubdate" oils_persist:virtual="true"/>
142                         <field name="isbn" oils_persist:virtual="true"/>
143                         <field name="publisher" oils_persist:virtual="true"/>
144                         <field name="tcn" oils_persist:virtual="true"/>
145                         <field name="subject" oils_persist:virtual="true"/>
146                         <field name="types_of_resource" oils_persist:virtual="true"/>
147                         <field name="call_numbers" oils_persist:virtual="true"/>
148                         <field name="edition" oils_persist:virtual="true"/>
149                         <field name="online_loc" oils_persist:virtual="true"/>
150                         <field name="synopsis" oils_persist:virtual="true"/>
151                         <field name="physical_description" oils_persist:virtual="true"/>
152                         <field name="toc" oils_persist:virtual="true"/>
153                         <field name="copy_count" oils_persist:virtual="true"/>
154                         <field name="series" oils_persist:virtual="true"/>
155                         <field name="serials" oils_persist:virtual="true"/>
156                         <field name="foreign_copy_maps" oils_persist:virtual="true"/>
157                 </fields>
158         </class>
159
160         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
161                 <fields>
162                         <field name="err_msg" oils_persist:virtual="true"/>
163                         <field name="type" oils_persist:virtual="true"/>
164                 </fields>
165         </class>
166
167         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
168                 <fields>
169                         <field name="err_msg" oils_persist:virtual="true"/>
170                         <field name="type" oils_persist:virtual="true"/>
171                 </fields>
172         </class>
173
174         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
175                 <fields oils_persist:primary="matchpoint">
176                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
177                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
178                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
179                 </fields>
180                 <links>
181                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
182                 </links>
183         </class>
184
185         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
186                 <!-- when the time is right, turn me into a view.  -->
187                 <fields>
188                         <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
189                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
190                         <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
191                         <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
192                         <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
193                         <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
194                         <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
195                         <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
196                         <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
197                         <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
198                 </fields>
199         </class>
200
201         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
202                 <fields>
203                         <field name="public_name" oils_persist:virtual="true"/>
204                         <field name="target_url" oils_persist:virtual="true"/>
205                         <field name="target_coverage" oils_persist:virtual="true"/>
206                         <field name="target_embargo" oils_persist:virtual="true"/>
207                 </fields>
208         </class>
209
210         <!-- Actually in the DB -->
211         <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">
212                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
213                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
214                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
215                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
216                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
217                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
218                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
219                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
220                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
221                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
222                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
223                 </fields>
224                 <links>
225                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
226                 </links>
227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
228                         <actions>
229                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
230                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
231                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
232                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
233                         </actions>
234                 </permacrud>
235         </class>
236
237         <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">
238                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
239                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
240                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
241                         <field reporter:label="Field" name="field" reporter:datatype="text" oils_obj:required="true"/>
242                 </fields>
243                 <links>
244                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
245                 </links>
246                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
247                         <actions>
248                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
249                                         <context link="grp" field="owner"/>
250                                 </create>
251                                 <retrieve/>
252                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
253                                         <context link="grp" field="owner"/>
254                                 </update>
255                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
256                                         <context link="grp" field="owner"/>
257                                 </delete>
258                         </actions>
259                 </permacrud>
260         </class>
261
262         <class id="rrbs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="rating::record_badge_score" oils_persist:tablename="rating.record_badge_score" reporter:label="Statistical Popularity Badge">
263                 <fields oils_persist:primary="id" oils_persist:sequence="rating.record_badge_score_id_seq">
264                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
265                         <field reporter:label="Badge" name="badge" reporter:datatype="link" oils_obj:required="true"/>
266                         <field reporter:label="Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
267                         <field reporter:label="Score" name="score" reporter:datatype="int" oils_obj:required="true"/>
268                 </fields>
269                 <links>
270                         <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
271                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
272                 </links>
273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
274                         <actions>
275                                 <retrieve/>
276                         </actions>
277                 </permacrud>
278         </class>
279
280         <class id="rp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="rating::popularity_parameter" oils_persist:tablename="rating.popularity_parameter" reporter:label="Statistical Popularity Parameter">
281                 <fields oils_persist:primary="id" oils_persist:sequence="rating.popularity_parameter_id_seq">
282                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
283                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
284                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
285                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
286                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
287                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
288                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
289                 </fields>
290                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
291                         <actions>
292                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
293                                 <retrieve/>
294                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
295                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
296                         </actions>
297                 </permacrud>
298         </class>
299
300         <class id="rb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="rating::badge" oils_persist:tablename="rating.badge" reporter:label="Statistical Popularity Badge">
301                 <fields oils_persist:primary="id" oils_persist:sequence="rating.badge_id_seq">
302                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
303                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
304                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
305                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit" oils_obj:required="true"/>
306                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
307                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
308                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
309                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
310                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
311                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
312                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
313                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
314                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
315                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
316                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
317                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
318                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
319                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
320                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link" oils_obj:required="true"/>
321                 </fields>
322                 <links>
323                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
324                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
325                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
326                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
327                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
328                 </links>
329                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
330                         <actions>
331                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
332                                 <retrieve/>
333                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
334                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
335                         </actions>
336                 </permacrud>
337         </class>
338
339         <class id="vibtg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_group" oils_persist:tablename="vandelay.import_bib_trash_group" reporter:label="Import/Overlay Field Groups for Removal">
340                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
341                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
342                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
343                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
344                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
345                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
346                 </fields>
347                 <links>
348                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
349                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
350                 </links>
351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
352                         <actions>
353                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
354                                 <retrieve/>
355                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
356                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
357                         </actions>
358                 </permacrud>
359         </class>
360
361
362         <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">
363                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
364                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
365                         <field reporter:label="Import Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
366                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link" oils_obj:required="true"/>
367                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
368                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
369                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
370                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
371                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
372                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
373                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
374                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
375                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
376                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
377                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
378                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
379                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
380                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
381                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
382                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
383                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
384                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
385                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
386                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
387                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
388                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
389                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
390                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
391                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
392                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
393                 </fields>
394                 <links>
395                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
396                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
397                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
398                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
399                 </links>
400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
401                         <actions>
402                                 <create permission="CREATE_IMPORT_ITEM">
403                                         <context link="definition" field="owner"/>
404                                 </create>
405                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
406                                         <context link="definition" field="owner"/>
407                                 </retrieve>
408                                 <update permission="UPDATE_IMPORT_ITEM">
409                                         <context link="definition" field="owner"/>
410                                 </update>
411                                 <delete permission="DELETE_IMPORT_ITEM">
412                                         <context link="definition" field="owner"/>
413                                 </delete>
414                         </actions>
415                 </permacrud>
416         </class>
417
418         <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">
419                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
420                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
421                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
422                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
423                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
424                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
425                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
426                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
427                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
428                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
429                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
430                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
431                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
432                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
433                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
434                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
435                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
436                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
437                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
438                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
439                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
440                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
441                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
442                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
443                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
444                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
445                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
446                 </fields>
447                 <links>
448                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
449                 </links>
450                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
451                         <actions>
452                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
453                                 <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"/>
454                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
456                         </actions>
457                 </permacrud>
458         </class>
459
460         <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">
461                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
462                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
463                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
464                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
465                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
466                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
467                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
468                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
469                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
470                 </fields>
471                 <links>
472                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
473                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
474                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
475                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
476                 </links>
477                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
478                         <actions>
479                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
482                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
483                         </actions>
484                 </permacrud>
485         </class>
486
487         <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">
488                 <fields oils_persist:primary="code">
489                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id" oils_obj:required="true"/>
490                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
491                 </fields>
492                 <links>
493                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
494                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
495                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
496                 </links>
497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
498                         <actions>
499                                 <retrieve/>
500                         </actions>
501                 </permacrud>
502         </class>
503
504         <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">
505                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
506                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
507                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
509                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
510                         <field reporter:label="Queue" name="queue" reporter:datatype="link" oils_obj:required="true"/>
511                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
512                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
513                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
514                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
515                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
516                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
519                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
520                 </fields>
521                 <links>
522                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
523                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
524                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
525                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
526                         <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
527                         <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
528                         <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
529                 </links>
530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
531                         <actions>
532                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
535                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
536                         </actions>
537                 </permacrud>
538         </class>
539
540         <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">
541                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
542                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
543                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
544                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
545                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
546                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
547                 </fields>
548                 <links/>
549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
550                         <actions>
551                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
552                                 <retrieve/>
553                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
555                         </actions>
556                 </permacrud>
557         </class>
558
559         <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">
560                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
561                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
562                         <field reporter:label="Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
563                         <field reporter:label="Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
564                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
565                 </fields>
566                 <links>
567                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
568                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
569                 </links>
570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
571                         <actions>
572                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
575                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
576                         </actions>
577                 </permacrud>
578         </class>
579
580         <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">
581                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
582                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
583                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
584                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
585                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
586                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
587                 </fields>
588                 <links>
589                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
590                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
591                 </links>
592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
593                         <actions>
594                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
597                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
598                         </actions>
599                 </permacrud>
600         </class>
601
602         <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">
603                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
604                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
605                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
606                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
607                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
608                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
609                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
610                 </fields>
611                 <links>
612                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
613                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
614                 </links>
615                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
616                         <actions>
617                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
621                         </actions>
622                 </permacrud>
623         </class>
624
625         <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">
626                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
627                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
628                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
630                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
631                         <field reporter:label="Queue" name="queue" reporter:datatype="link" oils_obj:required="true"/>
632                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
633                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
634                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
635                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
636                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
638                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
639                 </fields>
640                 <links>
641                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
642                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
643                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
644                         <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
645                         <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
646                 </links>
647                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
648                         <actions>
649                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
653                         </actions>
654                 </permacrud>
655         </class>
656
657         <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">
658                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
659                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
660                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
661                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
662                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
663                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
664                 </fields>
665                 <links/>
666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
667                         <actions>
668                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
669                                 <retrieve/>
670                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
672                         </actions>
673                 </permacrud>
674         </class>
675
676         <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">
677                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
678                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
679                         <field reporter:label="Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
680                         <field reporter:label="Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
681                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
682                 </fields>
683                 <links>
684                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
685                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
686                 </links>
687                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
688                         <actions>
689                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
693                         </actions>
694                 </permacrud>
695         </class>
696
697         <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">
698                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
699                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
700                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
701                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
702                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
703                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
704                 </fields>
705                 <links>
706                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
707                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
708                 </links>
709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
710                         <actions>
711                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                         </actions>
716                 </permacrud>
717         </class>
718
719         <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">
720                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
721                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
722                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
723                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link" oils_obj:required="true"/>
724                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
725                 </fields>
726                 <links>
727                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
728                 </links>
729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
730                         <actions>
731                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
735                         </actions>
736                 </permacrud>
737         </class>
738
739         <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">
740                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
741                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
742                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
743                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
744                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
745                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
746                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
747                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
748                         <field reporter:label="Negate" name="negate" reporter:datatype="bool"/>
749                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
750                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
751                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
752                 </fields>
753                 <links>
754                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
755                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
756                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
757                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
758                 </links>
759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
760                         <actions>
761                                 <create permission="ADMIN_IMPORT_MATCH_SET">
762                                         <context link="match_set" field="owner"/>
763                                 </create>
764                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
765                                         <context link="match_set" field="owner"/>
766                                 </retrieve>
767                                 <update permission="ADMIN_IMPORT_MATCH_SET">
768                                         <context link="match_set" field="owner"/>
769                                 </update>
770                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
771                                         <context link="match_set" field="owner"/>
772                                 </delete>
773                         </actions>
774                 </permacrud>
775         </class>
776
777         <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">
778                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
779                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
780                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link" oils_obj:required="true"/>
781                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
782                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
783                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
784                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
785                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
786                 </fields>
787                 <links>
788                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
789                 </links>
790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
791                         <actions>
792                                 <create permission="ADMIN_IMPORT_MATCH_SET">
793                                         <context link="match_set" field="owner"/>
794                                 </create>
795                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
796                                         <context link="match_set" field="owner"/>
797                                 </retrieve>
798                                 <update permission="ADMIN_IMPORT_MATCH_SET">
799                                         <context link="match_set" field="owner"/>
800                                 </update>
801                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
802                                         <context link="match_set" field="owner"/>
803                                 </delete>
804                         </actions>
805                 </permacrud>
806         </class>
807
808         <class id="vst" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::session_tracker" oils_persist:tablename="vandelay.session_tracker" reporter:label="Vandelay Session Tracker">
809                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
810                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
811                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text" oils_obj:required="true"/>
812                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
813                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
814                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link" oils_obj:required="true"/>
815                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
816                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
817                                  queue or an auth queue and there's no IDL class for vandelay.queue .
818                                  parent table.
819                         -->
820                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int" oils_obj:required="true"/>
821                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
822                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
823                         <field reporter:label="State" name="state" reporter:datatype="text"/>
824                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
825                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
826                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
827                 </fields>
828                 <links>
829                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
830                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
831                 </links>
832                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
833                         <actions>
834                                 <!-- created by the API -->
835                                 <retrieve global_required="true" permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
836                                 <update global_required="true" permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
837                                         <context link="workstation" field="owning_lib"/>
838                                 </update>
839                                 <delete permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
840                                         <context link="workstation" field="owning_lib"/>
841                                 </delete>
842                         </actions>
843                 </permacrud>
844         </class>
845
846         <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">
847                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
848                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
849                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link" oils_obj:required="true"/>
850                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link" oils_obj:required="true"/>
851                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
852                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
853                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
854                 </fields>
855                 <links>
856                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
859                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
860                 </links>
861         </class>
862
863         <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">
864                 <fields oils_persist:primary="name">
865                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
866                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
867                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
868                         <field reporter:label="Enabled" name="enabled" reporter:datatype="bool"/>
869                 </fields>
870                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
871                         <actions>
872                                 <create permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
873                                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
874                                 <update permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
875                                 <delete permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
876                         </actions>
877                 </permacrud>
878         </class>
879
880         <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">
881                 <fields oils_persist:primary="id">
882                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
883                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
884                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
885                         <field reporter:label="Function" name="func" reporter:datatype="text" oils_obj:required="true"/>
886                         <field reporter:label="Required Parameter Count" name="param_count" reporter:datatype="int"/>
887                 </fields>
888                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
889                         <actions>
890                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
891                                 <retrieve/>
892                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
893                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
894                         </actions>
895                 </permacrud>
896         </class>
897
898         <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">
899                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
900                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
901                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
902                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link" oils_obj:required="true"/>
903                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
904                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
905                 </fields>
906                 <links>
907                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
908                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
909                 </links>
910                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
911                         <actions>
912                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
913                                 <retrieve/>
914                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
915                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
916                         </actions>
917                 </permacrud>
918         </class>
919
920         <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">
921                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
922                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
923                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
924                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
925                 </fields>
926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
927                         <actions>
928                                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
929                                 <retrieve/>
930                                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
931                                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
932                         </actions>
933                 </permacrud>
934         </class>
935
936         <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">
937                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
938                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
939                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
940                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
941                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
942                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
943                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
944                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
945                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
946                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
947                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
948                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
949                 </fields>
950                 <links>
951                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
952                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
953                 </links>
954                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
955                         <actions>
956                                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
957                                 <retrieve/>
958                                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
959                                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
960                         </actions>
961                 </permacrud>
962         </class>
963
964         <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">
965                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
966                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
967                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
968                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
969                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
970                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
971                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
972                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
973                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
974                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
975                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
976                 </fields>
977                 <links>
978                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
979                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
980                 </links>
981                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
982                         <actions>
983                                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
984                                 <retrieve/>
985                                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
986                                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
987                         </actions>
988                 </permacrud>
989         </class>
990
991         <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">
992                 <fields oils_persist:primary="name">
993                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label" oils_obj:required="true"/>
994                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
995                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
996                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
997                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
998                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
999                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1001                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1002                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1003                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1004                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1005                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1006                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1007                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1008                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1009                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1010                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1011                 </fields>
1012                 <links>
1013                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1014                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1015                 </links>
1016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1017                         <actions>
1018                                 <create permission="ADMIN_SVF" global_required="true"/>
1019                                 <retrieve/>
1020                                 <update permission="ADMIN_SVF" global_required="true"/>
1021                                 <delete permission="ADMIN_SVF" global_required="true"/>
1022                         </actions>
1023                 </permacrud>
1024         </class>
1025
1026         <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">
1027                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1028                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1029                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1030                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1031                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1032                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1033                 </fields>
1034                 <links/>
1035                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1036                         <actions>
1037                                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1038                                 <retrieve/>
1039                                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1040                                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1041                         </actions>
1042                 </permacrud>
1043         </class>
1044
1045         <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">
1046                 <fields oils_persist:primary="coded_value">
1047                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1048                         <field reporter:label="Defintion" name="definition" reporter:datatype="text" oils_obj:required="true"/>
1049                 </fields>
1050                 <links>
1051                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1052                 </links>
1053                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1054                         <actions>
1055                                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1056                                 <retrieve/>
1057                                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1058                                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1059                         </actions>
1060                 </permacrud>
1061         </class>
1062
1063         <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">
1064                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1065                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1066                         <field reporter:label="Attribute" name="attr" reporter:datatype="text" oils_obj:required="true"/>
1067                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1068                 </fields>
1069                 <links>
1070                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1071                 </links>
1072                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1073                         <actions>
1074                                 <retrieve/>
1075                         </actions>
1076                 </permacrud>
1077         </class>
1078
1079
1080         <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">
1081                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1082                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1083                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1084                         <field reporter:label="Attribute" name="attr" reporter:datatype="text" oils_obj:required="true"/>
1085                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1086                 </fields>
1087                 <links>
1088                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1089                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1090                 </links>
1091                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1092                         <actions>
1093                                 <retrieve/>
1094                         </actions>
1095                 </permacrud>
1096         </class>
1097
1098
1099         <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">
1100                 <fields oils_persist:primary="source">
1101                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1102                         <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 -->
1103                 </fields>
1104                 <links>
1105                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1106                 </links>
1107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1108                         <actions>
1109                                 <retrieve/>
1110                         </actions>
1111                 </permacrud>
1112         </class>
1113
1114         <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">
1115                 <fields>
1116                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1117                         <field reporter:label="Attribute" name="attr" reporter:datatype="text" oils_obj:required="true"/>
1118                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1119                 </fields>
1120                 <links>
1121                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1122                 </links>
1123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1124                         <actions>
1125                                 <retrieve/>
1126                         </actions>
1127                 </permacrud>
1128         </class>
1129
1130         <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">
1131                 <fields oils_persist:primary="id">
1132                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1133                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text" oils_obj:required="true"/>
1134                 </fields>
1135                 <links>
1136                         <link field="id" 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="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">
1146                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1147                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1148                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
1149                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link" oils_obj:required="true"/>
1150                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1151                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1152                 </fields>
1153                 <links>
1154                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1155                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1156                 </links>
1157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1158                         <actions>
1159                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1160                                 <retrieve/>
1161                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1162                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1163                         </actions>
1164                 </permacrud>
1165         </class>
1166
1167         <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">
1168                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1169                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true" reporter:selector="value"/>
1170                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link" oils_obj:required="true"/>
1171                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
1172                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
1173                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1174                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1175                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1176                         <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1177                         <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1178                         <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1179                 </fields>
1180                 <links>
1181                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1182                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1183                 </links>
1184                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1185                         <actions>
1186                                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1187                                 <retrieve/>
1188                                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1189                                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1190                         </actions>
1191                 </permacrud>
1192         </class>
1193
1194         <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">
1195                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1196                         <field name="id" reporter:datatype="id" reporter:label="ID"/>
1197                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
1198                         <field name="host" reporter:datatype="text" reporter:label="Host" oils_obj:required="true"/>
1199                         <field name="username" reporter:datatype="text" reporter:label="Username"/>
1200                         <field name="password" reporter:datatype="text" reporter:label="Password"/>
1201                         <field name="account" reporter:datatype="text" reporter:label="Account"/>
1202                         <field name="path" reporter:datatype="text" reporter:label="Path"/>
1203                         <field name="owner" reporter:datatype="link" reporter:label="Owner" oils_obj:required="true"/>
1204                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1205                 </fields>
1206                 <links>
1207                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1208                 </links>
1209                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1210                         <actions>
1211                                 <create permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1212                                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1213                                 <update permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1214                                 <delete permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1215                         </actions>
1216                 </permacrud>
1217         </class>
1218
1219         <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">
1220                 <fields oils_persist:primary="name">
1221                         <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id" oils_obj:required="true"/>
1222                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1223                         <field reporter:label="Host" name="host" reporter:datatype="text" oils_obj:required="true"/>
1224                         <field reporter:label="Port" name="port" reporter:datatype="int" oils_obj:required="true"/>
1225                         <field reporter:label="DB" name="db" reporter:datatype="text" oils_obj:required="true"/>
1226                         <field reporter:label="Record Format" name="record_format" reporter:datatype="text"/>
1227                         <field reporter:label="Transmission Format" name="transmission_format" reporter:datatype="text"/>
1228                         <field reporter:label="Auth" name="auth" reporter:datatype="bool"/>
1229                         <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
1230                         <field reporter:label="Use Permission" name="use_perm" reporter:datatype="link"/>
1231                 </fields>
1232                 <links>
1233                         <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1234                         <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1235                 </links>
1236                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1237                         <actions>
1238                                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1239                                 <retrieve/>
1240                                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1241                                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1242                         </actions>
1243                 </permacrud>
1244         </class>
1245
1246         <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">
1247                 <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1248                         <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1249                         <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
1250                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1251                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1252                         <field reporter:label="Code" name="code" reporter:datatype="int" oils_obj:required="true"/>
1253                         <field reporter:label="Format" name="format" reporter:datatype="int" oils_obj:required="true"/>
1254                         <field reporter:label="Truncation" name="truncation" reporter:datatype="int"/>
1255                 </fields>
1256                 <links>
1257                         <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1258                 </links>
1259                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1260                         <actions>
1261                                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1262                                 <retrieve/>
1263                                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1264                                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1265                         </actions>
1266                 </permacrud>
1267         </class>
1268
1269         <class id="czifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_index_field_map" oils_persist:tablename="config.z3950_index_field_map" reporter:label="Z39.50 Index Field Map">
1270                 <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1271                         <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1272                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1273                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1274                         <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1275                         <field reporter:label="Z39.50 Attribute" name="z3950_attr" reporter:datatype="link"/>
1276                         <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1277                 </fields>
1278                 <links>
1279                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1280                         <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1281                         <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1282                 </links>
1283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1284                         <actions>
1285                                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1286                                 <retrieve/>
1287                                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1288                                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1289                         </actions>
1290                 </permacrud>
1291         </class>
1292
1293
1294         <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">
1295                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1296                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1297                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1298                         <field reporter:label="Data" name="data" reporter:datatype="text" oils_obj:required="true"/>
1299                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1300                         <field reporter:label="Events" name="events" oils_persist:virtual="true" reporter:datatype="link"/>
1301                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true" reporter:datatype="link"/>
1302                         <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1303                 </fields>
1304                 <links>
1305                         <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1306                         <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1307                 </links>
1308                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1309                         <actions>
1310                                 <retrieve/>
1311                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1312                         </actions>
1313                 </permacrud>
1314         </class>
1315
1316         <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">
1317                 <fields oils_persist:primary="key">
1318                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key" oils_obj:required="true"/>
1319                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1320                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1321                         <field reporter:label="Passive" name="passive" reporter:datatype="bool"/>
1322                 </fields>
1323                 <links/>
1324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1325                         <actions>
1326                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1327                                 <retrieve/>
1328                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1329                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1330                         </actions>
1331                 </permacrud>
1332         </class>
1333
1334         <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">
1335                 <fields oils_persist:primary="module">
1336                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1337                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1338                 </fields>
1339                 <links/>
1340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1341                         <actions>
1342                                 <retrieve/>
1343                         </actions>
1344                 </permacrud>
1345         </class>
1346
1347         <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">
1348                 <fields oils_persist:primary="module">
1349                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1350                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1351                 </fields>
1352                 <links/>
1353                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1354                         <actions>
1355                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1356                                 <retrieve/>
1357                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1358                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1359                         </actions>
1360                 </permacrud>
1361         </class>
1362
1363         <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">
1364                 <fields oils_persist:primary="module">
1365                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1366                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1367                 </fields>
1368                 <links/>
1369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1370                         <actions>
1371                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1372                                 <retrieve/>
1373                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1374                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1375                         </actions>
1376                 </permacrud>
1377         </class>
1378
1379         <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">
1380                 <fields oils_persist:primary="module">
1381                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1382                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1383                 </fields>
1384                 <links/>
1385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1386                         <actions>
1387                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1388                                 <retrieve/>
1389                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1390                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1391                         </actions>
1392                 </permacrud>
1393         </class>
1394
1395         <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">
1396                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1397                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1398                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1399                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1400                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1401                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1402                 </fields>
1403                 <links>
1404                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1405                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1406                 </links>
1407                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1408                         <actions>
1409                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1410                                         <context link="event_def" field="owner"/>
1411                                 </create>
1412                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1413                                         <context link="event_def" field="owner"/>
1414                                 </retrieve>
1415                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1416                                         <context link="event_def" field="owner"/>
1417                                 </update>
1418                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1419                                         <context link="event_def" field="owner"/>
1420                                 </delete>
1421                         </actions>
1422                 </permacrud>
1423         </class>
1424
1425         <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">
1426                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1427                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1428                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1429                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
1430                         <field reporter:label="Hook" name="hook" reporter:datatype="link" oils_obj:required="true"/>
1431                         <field reporter:label="Validator" name="validator" reporter:datatype="link" oils_obj:required="true"/>
1432                         <field reporter:label="Reactor" name="reactor" reporter:datatype="link" oils_obj:required="true"/>
1433                         <field reporter:label="Success Cleanup" name="cleanup_success" reporter:datatype="link"/>
1434                         <field reporter:label="Failure Cleanup" name="cleanup_failure" reporter:datatype="link"/>
1435                         <field reporter:label="Processing Delay" name="delay" reporter:datatype="interval"/>
1436                         <field reporter:label="Max Event Validity Delay" name="max_delay" reporter:datatype="interval"/>
1437                         <field reporter:label="Processing Delay Context Field" name="delay_field" reporter:datatype="text"/>
1438                         <field reporter:label="Processing Group Context Field" name="group_field" reporter:datatype="text"/>
1439                         <field reporter:label="Template" name="template" reporter:datatype="text"/>
1440                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1441                         <field reporter:label="Granularity" name="granularity" reporter:datatype="text"/>
1442                         <field reporter:label="Opt-In User Field" name="usr_field" reporter:datatype="text"/>
1443                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting" reporter:datatype="link"/>
1444                         <field reporter:label="Event Repeatability Delay" name="repeat_delay" reporter:datatype="interval"/>
1445                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1446                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1447                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1448                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1449                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true" reporter:datatype="link"/>
1450                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true" reporter:datatype="link"/>
1451                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1452                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1453                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1454                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1455                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1456                 </fields>
1457                 <links>
1458                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1459                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1460                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1461                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1462                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1463                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1464                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1465                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1466                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1467                 </links>
1468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1469                         <actions>
1470                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1471                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1472                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1473                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1474                         </actions>
1475                 </permacrud>
1476         </class>
1477
1478         <class id="atevalt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::alternate_template" oils_persist:tablename="action_trigger.alternate_template" reporter:label="Alternate Action Trigger Templates">
1479                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1480                         <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1481                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1482                         <field reporter:label="Template" name="template" reporter:datatype="text"/>
1483                         <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1484                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1485                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1486                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1487                 </fields>
1488                 <links>
1489                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1490                         <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
1491                 </links>
1492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1493                         <actions>
1494                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1495                                         <context link="event_def" field="owner"/>
1496                                 </create>
1497                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1498                                         <context link="event_def" field="owner"/>
1499                                 </retrieve>
1500                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1501                                         <context link="event_def" field="owner"/>
1502                                 </update>
1503                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1504                                         <context link="event_def" field="owner"/>
1505                                 </delete>
1506                         </actions>
1507                 </permacrud>
1508         </class>
1509
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" oils_obj:required="true"/>
1516                         <field reporter:label="Hook" name="hook" reporter:datatype="link" oils_obj:required="true"/>
1517                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
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" oils_obj:required="true"/>
1539                         <field reporter:label="Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1540                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
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" oils_obj:required="true"/>
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" oils_obj:required="true"/>
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" oils_obj:required="true"/>
1798                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
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" oils_obj:required="true"/>
1817                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1818                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1819                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="true"/>
1837                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="true"/>
1855                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="true"/>
1871                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="true"/>
1887                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="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" oils_obj:required="true"/>
1920                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link" oils_obj:required="true"/>
1921                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
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" oils_obj:required="true"/>
1947                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="true"/>
1963                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="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" oils_obj:required="true"/>
1996                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float" oils_obj:required="true"/>
1997                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="float" oils_obj:required="true"/>
1998                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float" oils_obj:required="true"/>
1999                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float" oils_obj:required="true"/>
2000                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float" oils_obj:required="true"/>
2001                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float" oils_obj:required="true"/>
2002                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float" oils_obj:required="true"/>
2003                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2004                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2005                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2006                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2007                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2008                         <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2009                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float" oils_obj:required="true"/>
2010                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float" oils_obj:required="true"/>
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" oils_obj:required="true"/>
2027                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float" oils_obj:required="true"/>
2028                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float" oils_obj:required="true"/>
2029                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float" oils_obj:required="true"/>
2030                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float" oils_obj:required="true"/>
2031                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float" oils_obj:required="true"/>
2032                         <field reporter:label="Permission Group" name="grp" reporter:datatype="float" oils_obj:required="true"/>
2033                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float" oils_obj:required="true"/>
2034                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float" oils_obj:required="true"/>
2035                         <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float" oils_obj:required="true"/>
2036                         <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float" oils_obj:required="true"/>
2037                         <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float" oils_obj:required="true"/>
2038                         <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float" oils_obj:required="true"/>
2039                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float" oils_obj:required="true"/>
2040                         <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float" oils_obj:required="true"/>
2041                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float" oils_obj:required="true"/>
2042                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float" oils_obj:required="true"/>
2043                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float" oils_obj:required="true"/>
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" oils_obj:required="true"/>
2060                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
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" oils_obj:required="true"/>
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 reporter:label="Stop Blocked User?" name="stop_blocked_user" reporter:datatype="bool"/>
2105                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2106                 </fields>
2107                 <links>
2108                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2109                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2110                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2111                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2112                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2113                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2114                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2115                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2116                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2117                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2118                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2119                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2120                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2121                         <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2122                 </links>
2123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2124                         <actions>
2125                                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2126                                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2127                                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2128                                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2129                         </actions>
2130                 </permacrud>
2131         </class>
2132
2133         <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">
2134                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2135                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2136                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2137                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2138                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2139                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2140                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2141                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2142                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2143                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2144                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2145                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2146                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2147                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2148                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2149                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2150                         <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2151                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2152                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2153                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2154                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2155                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2156                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2157                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2158                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2159                         <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2160                         <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2161                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2162                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2163                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2164                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2165                         <field name="renew_extends_due_date" reporter:datatype="bool" reporter:label="Early Renewal Extends Due Date"/>
2166                         <field name="renew_extend_min_interval" reporter:datatype="interval" reporter:label="Early Renewal Minimum Duration Interval"/>
2167                 </fields>
2168                 <links>
2169                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2170                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2171                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2172                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2173                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2174                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2175                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2176                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2177                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2178                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2179                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2180                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2181                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2182                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2183                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2184                 </links>
2185                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2186                         <actions>
2187                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2188                                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2189                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2190                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2191                         </actions>
2192                 </permacrud>
2193         </class>
2194
2195         <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">
2196                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2197                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2198                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2199                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2200                 </fields>
2201                 <links/>
2202                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2203                         <actions>
2204                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2205                                 <retrieve/>
2206                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2207                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2208                         </actions>
2209                 </permacrud>
2210         </class>
2211
2212         <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">
2213                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2214                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2215                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2216                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
2217                         <field reporter:label="Items Out" name="items_out" reporter:datatype="int" oils_obj:required="true"/>
2218                         <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2219                         <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2220                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2221                 </fields>
2222                 <links>
2223                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2224                 </links>
2225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2226                         <actions>
2227                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2228                                 <retrieve/>
2229                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2230                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2231                         </actions>
2232                 </permacrud>
2233         </class>
2234
2235         <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">
2236                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2237                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2238                         <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link" oils_obj:required="true"/>
2239                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2240                         <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2241                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2242                 </fields>
2243                 <links>
2244                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2245                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2246                 </links>
2247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2248                         <actions>
2249                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2250                                         <context link="matchpoint" field="org_unit"/>
2251                                 </create>
2252                                 <retrieve/>
2253                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2254                                         <context link="matchpoint" field="org_unit"/>
2255                                 </update>
2256                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2257                                         <context link="matchpoint" field="org_unit"/>
2258                                 </delete>
2259                         </actions>
2260                 </permacrud>
2261         </class>
2262
2263         <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">
2264                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2265                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2266                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2267                         <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link" oils_obj:required="true"/>
2268                 </fields>
2269                 <links>
2270                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2271                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2272                 </links>
2273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2274                         <actions>
2275                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2276                                         <context link="limit_set" field="owning_lib"/>
2277                                 </create>
2278                                 <retrieve/>
2279                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2280                                         <context link="limit_set" field="owning_lib"/>
2281                                 </update>
2282                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2283                                         <context link="limit_set" field="owning_lib"/>
2284                                 </delete>
2285                         </actions>
2286                 </permacrud>
2287         </class>
2288         <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">
2289                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2290                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2291                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2292                         <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link" oils_obj:required="true"/>
2293                 </fields>
2294                 <links>
2295                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2296                         <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2297                 </links>
2298                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2299                         <actions>
2300                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2301                                         <context link="limit_set" field="owning_lib"/>
2302                                 </create>
2303                                 <retrieve/>
2304                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2305                                         <context link="limit_set" field="owning_lib"/>
2306                                 </update>
2307                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2308                                         <context link="limit_set" field="owning_lib"/>
2309                                 </delete>
2310                         </actions>
2311                 </permacrud>
2312         </class>
2313
2314         <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">
2315                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2316                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2317                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2318                         <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link" oils_obj:required="true"/>
2319                         <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2320                 </fields>
2321                 <links>
2322                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2323                         <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2324                 </links>
2325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2326                         <actions>
2327                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2328                                         <context link="limit_set" field="owning_lib"/>
2329                                 </create>
2330                                 <retrieve/>
2331                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                                         <context link="limit_set" field="owning_lib"/>
2333                                 </update>
2334                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2335                                         <context link="limit_set" field="owning_lib"/>
2336                                 </delete>
2337                         </actions>
2338                 </permacrud>
2339         </class>
2340
2341         <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">
2342                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2343                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2344                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2345                 </fields>
2346                 <links/>
2347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2348                         <actions>
2349                                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2350                                 <retrieve/>
2351                                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2352                                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2353                         </actions>
2354                 </permacrud>
2355         </class>
2356
2357         <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">
2358                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2359                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2360                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2361                         <field reporter:label="Question ID" name="id" reporter:datatype="id"/>
2362                         <field reporter:label="Question" name="question" reporter:datatype="text" oils_obj:required="true"/>
2363                         <field reporter:label="Survey" name="survey" reporter:datatype="link" oils_obj:required="true"/>
2364                 </fields>
2365                 <links>
2366                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2367                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2368                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2369                 </links>
2370                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2371                         <actions>
2372                                 <create permission="ADMIN_SURVEY">
2373                                         <context link="survey" field="owner"/>
2374                                 </create>
2375                                 <retrieve/>
2376                                 <update permission="ADMIN_SURVEY">
2377                                         <context link="survey" field="owner"/>
2378                                 </update>
2379                                 <delete permission="ADMIN_SURVEY">
2380                                         <context link="survey" field="owner"/>
2381                                 </delete>
2382                         </actions>
2383                 </permacrud>
2384         </class>
2385         <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">
2386                 <fields oils_persist:primary="id" oils_persist:sequence="">
2387                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2388                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2389                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2390                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2391                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2392                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2393                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2394                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2395                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2396                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2397                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2398                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp"/>
2399                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp"/>
2400                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2401                 </fields>
2402                 <links>
2403                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2404                 </links>
2405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2406                         <actions>
2407                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2408                                         <context link="usr" field="home_ou"/>
2409                                 </retrieve>
2410                         </actions>
2411                 </permacrud>
2412         </class>
2413         <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">
2414                 <fields oils_persist:primary="id" oils_persist:sequence="">
2415                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2416                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2417                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2418                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2419                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2420                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2421                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2422                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2423                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2424                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2425                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2426                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp"/>
2427                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp"/>
2428                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2429                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2430                 </fields>
2431                 <links>
2432                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2433                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2434                 </links>
2435         </class>
2436         <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">
2437                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2438                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2439                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2440                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link" oils_obj:required="true"/>
2441                         <field reporter:label="Message ID" name="id" reporter:datatype="id"/>
2442                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2443                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2444                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2445                         <field reporter:label="Message" name="message" reporter:datatype="text" oils_obj:required="true"/>
2446                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2447                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2448                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
2449                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2450                 </fields>
2451                 <links>
2452                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2453                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2454                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2455                 </links>
2456                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2457                         <actions> <!-- created magically, so no create action -->
2458                                 <retrieve permission="VIEW_USER" context_field="sending_lib"/>
2459                                 <update permission="UPDATE_USER" context_field="sending_lib"/>
2460                                 <delete permission="UPDATE_USER" context_field="sending_lib"/>
2461                         </actions>
2462                 </permacrud>
2463         </class>
2464         <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)">
2465                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2466                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2467                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2468                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2469                         <field reporter:label="Message ID" name="id" reporter:datatype="id"/>
2470                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2471                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2472                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2473                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2474                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2475                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2476                         <field reporter:label="Editor" name="usr" reporter:datatype="link"/>
2477                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2478                 </fields>
2479                 <links>
2480                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2481                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2482                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2483                 </links>
2484                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2485                         <actions> <!-- created magically, so no create action -->
2486                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2487                                 <update permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2488                         </actions>
2489                 </permacrud>
2490         </class>
2491         <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">
2492                 <fields oils_persist:primary="id">
2493                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2494                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2495                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2496                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2497                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2498                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2499                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2500                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2501                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id"/>
2502                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id"/>
2503                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2504                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2505                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2506                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link"/>
2507                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link"/>
2508                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2509                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2510                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2511                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2512                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2513                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
2514                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2515                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2516                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2517                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2518                 </fields>
2519                 <links>
2520                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2521                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2522                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2523                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2524                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2525                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2526                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2527                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2528                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2529                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2530                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2531                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2532                 </links>
2533                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2534                         <actions> <!-- created magically, so no create action -->
2535                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2536                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2537                         </actions>
2538                 </permacrud>
2539         </class>
2540
2541         <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">
2542                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2543                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2544                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2545                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2546                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool"/>
2547                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool"/>
2548                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool"/>
2549                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool"/>
2550                 </fields>
2551                 <links>
2552                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2553                 </links>
2554                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2555                         <actions>
2556                                 <create permission="UPDATE_USER">
2557                                         <context link="usr" field="home_ou"/>
2558                                 </create>
2559                                 <retrieve permission="VIEW_USER">
2560                                         <context link="usr" field="home_ou"/>
2561                                 </retrieve>
2562                                 <update permission="UPDATE_USER">
2563                                         <context link="usr" field="home_ou"/>
2564                                 </update>
2565                                 <delete permission="UPDATE_USER">
2566                                         <context link="usr" field="home_ou"/>
2567                                 </delete>
2568                         </actions>
2569                 </permacrud>
2570         </class>
2571         <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">
2572                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2573                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2574                         <field reporter:label="UUID" name="uuid" reporter:datatype="text" oils_obj:required="true"/>
2575                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2576                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2577                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2578                 </fields>
2579                 <links>
2580                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2581                 </links>
2582         </class>
2583         <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">
2584                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2585                         <field reporter:label="Setting ID" name="id" reporter:datatype="id"/>
2586                         <field reporter:label="Name" name="name" reporter:datatype="link" oils_obj:required="true"/>
2587                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2588                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
2589                 </fields>
2590                 <links>
2591                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2592                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2593                 </links>
2594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2595                         <actions>
2596                                 <retrieve permission="VIEW_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </retrieve>
2599                         </actions>
2600                 </permacrud>
2601         </class>
2602         <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">
2603                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2604                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
2605                         <field name="id" reporter:datatype="id"/>
2606                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
2607                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
2608                 </fields>
2609                 <links>
2610                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2611                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2612                 </links>
2613         </class>
2614         <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">
2615                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2616                         <field reporter:label="Use ID" name="id" reporter:datatype="id"/>
2617                         <field reporter:label="Item" name="item" reporter:datatype="int" oils_obj:required="true"/>
2618                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2619                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
2620                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2621                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2622                 </fields>
2623                 <links>
2624                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2625                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2626                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2627                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2628                 </links>
2629                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2630                         <actions>
2631                                 <retrieve/>
2632                         </actions>
2633                 </permacrud>
2634         </class>
2635         <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">
2636                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2637                         <field reporter:label="Use ID" name="id" reporter:datatype="id"/>
2638                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link" oils_obj:required="true"/>
2639                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2640                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
2641                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2642                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2643                 </fields>
2644                 <links>
2645                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2646                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2647                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2648                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2649                 </links>
2650                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2651                         <actions>
2652                                 <retrieve/>
2653                         </actions>
2654                 </permacrud>
2655         </class>
2656         <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">
2657                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2658                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool" oils_obj:required="true"/>
2659                         <field reporter:label="Destination" name="dest" reporter:datatype="link" oils_obj:required="true"/>
2660                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2661                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2662                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2663                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2664                         <field reporter:label="Source" name="source" reporter:datatype="link" oils_obj:required="true"/>
2665                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2666                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2667                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
2668                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2669                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2670                 </fields>
2671                 <links>
2672                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2673                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2674                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2675                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2676                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2677                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2678                 </links>
2679                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2680                         <actions>
2681                                 <create permission="TRANSIT_COPY" context_field="owner">
2682                                         <context link="target_copy" field="circ_lib"/>
2683                                 </create>
2684                                 <retrieve/>
2685                                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2686                                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2687                         </actions>
2688                 </permacrud>
2689         </class>
2690         <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">
2691                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2692                         <field reporter:label="Answer" name="answer" reporter:datatype="link" oils_obj:required="true"/>
2693                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2694                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2695                         <field reporter:label="Answer ID" name="id" reporter:datatype="id"/>
2696                         <field reporter:label="Question" name="question" reporter:datatype="link" oils_obj:required="true"/>
2697                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int"/>
2698                         <field reporter:label="Survey" name="survey" reporter:datatype="link" oils_obj:required="true"/>
2699                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2700                 </fields>
2701                 <links>
2702                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2703                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2704                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2705                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2706                 </links>
2707                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2708                         <actions>
2709                                 <create permission="ADMIN_SURVEY">
2710                                         <context link="survey" field="owner"/>
2711                                 </create>
2712                                 <retrieve permission="VIEW_USER">
2713                                         <context link="usr" field="home_ou"/>
2714                                 </retrieve>
2715                                 <update permission="ADMIN_SURVEY">
2716                                         <context link="survey" field="owner"/>
2717                                 </update>
2718                                 <delete permission="ADMIN_SURVEY">
2719                                         <context link="survey" field="owner"/>
2720                                 </delete>
2721                         </actions>
2722                 </permacrud>
2723         </class>
2724         <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">
2725                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2726                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
2727                         <field name="id" reporter:datatype="id"/>
2728                         <field name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
2729                         <field name="create_time" reporter:datatype="timestamp"/>
2730                         <field name="pos" reporter:datatype="int"/>
2731                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2732                 </fields>
2733                 <links>
2734                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2735                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2736                         <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2737                 </links>
2738                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2739                         <actions>
2740                                 <retrieve permission="ADMIN_COPY_BUCKET">
2741                                         <context link="bucket" field="owning_lib"/>
2742                                 </retrieve>
2743                         </actions>
2744                 </permacrud>
2745         </class>
2746         <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">
2747                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2748                         <field name="id" reporter:datatype="id"/>
2749                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
2750                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
2751                 </fields>
2752                 <links>
2753                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2754                 </links>
2755         </class>
2756
2757         <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">
2758                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2759                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2760                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2761                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
2762                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2763                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2764                 </fields>
2765                 <links>
2766                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2767                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2768                 </links>
2769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2770                         <actions>
2771                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2772                                 <retrieve/>
2773                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2774                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2775                         </actions>
2776                 </permacrud>
2777         </class>
2778
2779         <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">
2780                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2781                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2782                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2783                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
2784                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2785                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" oils_obj:required="true"/>
2786                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" oils_obj:required="true"/>
2787                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text"/>
2788                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2789                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
2790                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text"/>
2791                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2792                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2793                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2794                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2795                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
2796                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link"/>
2797                 </fields>
2798                 <links>
2799                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2800                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2801                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2802                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2803                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2804                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2805                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2806                 </links>
2807                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2808                         <actions>
2809                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2810                                 <retrieve/>
2811                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2812                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2813                         </actions>
2814                 </permacrud>
2815         </class>
2816
2817         <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">
2818                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2819                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2820                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link" oils_obj:required="true"/>
2821                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2822                 </fields>
2823                 <links>
2824                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2825                 </links>
2826                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2827                         <actions>
2828                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2829                                 <retrieve/>
2830                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2831                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2832                         </actions>
2833                 </permacrud>
2834         </class>
2835
2836         <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">
2837                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2838                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2839                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link" oils_obj:required="true"/>
2840                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link" oils_obj:required="true"/>
2841                 </fields>
2842                 <links>
2843                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2844                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2845                 </links>
2846                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2847                         <actions>
2848                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2849                                 <retrieve/>
2850                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2851                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2852                         </actions>
2853                 </permacrud>
2854         </class>
2855
2856         <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">
2857                 <fields oils_persist:primary="code">
2858                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
2859                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2860                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2861                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
2862                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text"/>
2863                         <field reporter:label="URI" name="uri" reporter:datatype="text"/>
2864                 </fields>
2865                 <links>
2866                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2867                 </links>
2868                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2869                         <actions>
2870                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2871                                 <retrieve/>
2872                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2873                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2874                         </actions>
2875                 </permacrud>
2876         </class>
2877
2878         <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">
2879                 <fields oils_persist:primary="code">
2880                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$" oils_obj:required="true"/>
2881                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2882                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2883                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2884                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2885                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2886                 </fields>
2887                 <links>
2888                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2889                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2890                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2891                 </links>
2892                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2893                         <actions>
2894                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2895                                 <retrieve/>
2896                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2897                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2898                         </actions>
2899                 </permacrud>
2900         </class>
2901
2902         <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">
2903                 <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2904                         <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2905                         <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2906                         <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2907                 </fields>
2908                 <links>
2909                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2910                         <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2911                 </links>
2912                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2913                         <actions>
2914                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2915                                 <retrieve/>
2916                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2917                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2918                         </actions>
2919                 </permacrud>
2920         </class>
2921
2922         <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">
2923                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2924                         <field name="active" reporter:datatype="bool"/>
2925                         <field name="create_date" reporter:datatype="timestamp"/>
2926                         <field name="creator"/>
2927                         <field name="deleted" reporter:datatype="bool"/>
2928                         <field name="edit_date" reporter:datatype="timestamp"/>
2929                         <field name="editor"/>
2930                         <field name="id" reporter:datatype="id"/>
2931                         <field name="last_xact_id" oils_obj:required="true"/>
2932                         <field name="marc" oils_obj:required="true"/>
2933                         <field name="source"/>
2934                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2935                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
2936                         <field name="heading"/>
2937                         <field name="simple_heading"/>
2938                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2939                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2940                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2941                 </fields>
2942                 <links>
2943                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2944                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2945                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2946                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2947                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2948                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2949                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2950                 </links>
2951                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2952                         <actions>
2953                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2954                                 <retrieve/>
2955                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2956                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2957                         </actions>
2958                 </permacrud>
2959         </class>
2960         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2961                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2962                         <field name="char_encoding"/>
2963                         <field name="id"/>
2964                         <field name="record"/>
2965                         <field name="record_status"/>
2966                         <field name="thesaurus"/>
2967                 </fields>
2968                 <links>
2969                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2970                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2971                 </links>
2972         </class>
2973         <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">
2974                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2975                         <field name="id" reporter:datatype="id"/>
2976                         <field name="bib" reporter:datatype="link" oils_obj:required="true"/>
2977                         <field name="authority" reporter:datatype="link" oils_obj:required="true"/>
2978                 </fields>
2979                 <links>
2980                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2981                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2982                 </links>
2983                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2984                         <actions>
2985                                 <retrieve/>
2986                         </actions>
2987                 </permacrud>
2988         </class>
2989         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2990                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2991                         <field name="id" reporter:datatype="id"/>
2992                         <field name="record" reporter:datatype="link" oils_obj:required="true"/>
2993                         <field name="atag" reporter:datatype="link" oils_obj:required="true"/>
2994                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
2995                         <field name="thesaurus" reporter:datatype="text"/>
2996                 </fields>
2997                 <links>
2998                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2999                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3000                 </links>
3001         </class>
3002
3003         <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">
3004                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3005                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
3006                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" oils_obj:required="true"/>
3007                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" oils_obj:required="true"/>
3008                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" oils_obj:required="true"/>
3009                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format"/>
3010                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" oils_obj:required="true"/>
3011                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" oils_obj:required="true"/>
3012                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath"/>
3013                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath"/>
3014                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath"/>
3015                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string"/>
3016                 </fields>
3017                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3018                         <actions>
3019                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3020                                 <retrieve/>
3021                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3022                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3023                         </actions>
3024                 </permacrud>
3025         </class>
3026
3027         <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">
3028                 <fields oils_persist:primary="code" oils_persist:sequence="">
3029                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3030                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3031                 </fields>
3032                 <links/>
3033                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3034                         <actions>
3035                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3036                                 <retrieve/>
3037                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3038                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3039                         </actions>
3040                 </permacrud>
3041         </class>
3042         <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">
3043                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3044                         <field name="accepting_usr" oils_obj:required="true"/>
3045                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
3046                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
3047                         <field name="approval_code" reporter:datatype="text"/>
3048                         <field name="cash_drawer" reporter:datatype="link"/>
3049                         <field name="cc_number" reporter:datatype="text"/>
3050                         <field name="cc_order_number" reporter:datatype="text"/>
3051                         <field name="cc_processor" reporter:datatype="text"/>
3052                         <field name="id" reporter:datatype="id"/>
3053                         <field name="note" reporter:datatype="text"/>
3054                         <field name="payment_ts" reporter:datatype="timestamp"/>
3055                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
3056                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3057                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3058                 </fields>
3059                 <links>
3060                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3061                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3062                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3063                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3064                 </links>
3065                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3066                         <actions>
3067                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3068                                         <context link="xact" jump="usr" field="home_ou"/>
3069                                 </retrieve>
3070                         </actions>
3071                 </permacrud>
3072         </class>
3073         <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">
3074                 <fields oils_persist:primary="name">
3075                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3076                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text" oils_obj:required="true"/>
3077                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text" oils_obj:required="true"/>
3078                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" oils_obj:required="true"/>
3079                 </fields>
3080                 <links/>
3081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3082                         <actions>
3083                                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3084                                 <retrieve/>
3085                                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3086                                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3087                         </actions>
3088                 </permacrud>
3089         </class>
3090
3091         <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">
3092                 <fields oils_persist:primary="alias">
3093                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text" oils_obj:required="true"/>
3094                         <field reporter:label="Class" name="field_class" reporter:datatype="link" oils_obj:required="true"/>
3095                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3096                 </fields>
3097                 <links>
3098                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3099                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3100                 </links>
3101                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3102                         <actions>
3103                                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3104                                 <retrieve/>
3105                                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3106                                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3107                         </actions>
3108                 </permacrud>
3109         </class>
3110
3111         <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">
3112                 <fields oils_persist:primary="name">
3113                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
3114                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3115                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool"/>
3116                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool"/>
3117                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool"/>
3118                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float"/>
3119                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float"/>
3120                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float"/>
3121                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float"/>
3122                         <field reporter:label="Low Result Threshold for Suggestions" name="low_result_threshold" reporter:datatype="int"/>
3123                         <field reporter:label="Max Suggestions" name="max_suggestions" reporter:datatype="int"/>
3124                         <field reporter:label="Perform Variant Heading Authority Suggestion Cross-reference" name="variant_authority_suggestion" reporter:datatype="bool"/>
3125                         <field reporter:label="Minimum Bib Record Suggestion Threshold" name="min_suggestion_use_threshold" reporter:datatype="int"/>
3126                         <field reporter:label="Suggestion SOUNDEX Weight" name="soundex_weight" reporter:datatype="int"/>
3127                         <field reporter:label="Suggestion PG Trigram Weight" name="pg_trgm_weight" reporter:datatype="int"/>
3128                         <field reporter:label="Suggestion Keyboard Distance Weight" name="keyboard_distance_weight" reporter:datatype="int"/>
3129                         <field reporter:label="Retain Case in Suggestions" name="symspell_transfer_case" reporter:datatype="bool"/>
3130                         <field reporter:label="Avoid alternate suggestions on correctly spelled words" name="symspell_skip_correct" reporter:datatype="bool"/>
3131                         <field reporter:label="Symspell suggestion calculation verbosity" name="symspell_suggestion_verbosity" reporter:datatype="int"/>
3132                         <field reporter:label="Maximum average word Edit Distance" name="max_phrase_edit_distance" reporter:datatype="int"/>
3133                         <field reporter:label="Maximum suggestions per word" name="suggestion_word_option_count" reporter:datatype="int"/>
3134                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3135                 </fields>
3136                 <links>
3137                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3138                 </links>
3139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3140                         <actions>
3141                                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3142                                 <retrieve/>
3143                                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3144                                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3145                         </actions>
3146                 </permacrud>
3147         </class>
3148
3149         <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">
3150                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3151                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3152                         <field reporter:label="Class" name="field_class" reporter:datatype="link" oils_obj:required="true"/>
3153                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3154                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3155                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3156                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3157                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3158                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3159                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool"/>
3160                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool"/>
3161                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text"/>
3162                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool"/>
3163                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text"/>
3164                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool"/>
3165                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool"/>
3166                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text"/>
3167                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text"/>
3168                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text"/>
3169                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool"/>
3170                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3171                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3172                 </fields>
3173                 <links>
3174                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3175                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3176                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3177                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3178                 </links>
3179                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3180                         <actions>
3181                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3182                                 <retrieve/>
3183                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3184                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3185                         </actions>
3186                 </permacrud>
3187         </class>
3188
3189         <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">
3190                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3191                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3192                         <field reporter:label="Real" name="real" reporter:datatype="link" oils_obj:required="true"/>
3193                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
3194                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3195                 </fields>
3196                 <links>
3197                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3198                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3199                 </links>
3200                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3201                         <actions>
3202                                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3203                                 <retrieve/>
3204                                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3205                                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3206                         </actions>
3207                 </permacrud>
3208         </class>
3209
3210         <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">
3211                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3212                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3213                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3214                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int"/>
3215                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int"/>
3216                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int"/>
3217                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int"/>
3218                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int"/>
3219                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int"/>
3220                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int"/>
3221                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int"/>
3222                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int"/>
3223                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int"/>
3224                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int"/>
3225                 </fields>
3226                 <links>
3227                 </links>
3228                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3229                         <actions>
3230                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3231                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3232                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3233                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3234                         </actions>
3235                 </permacrud>
3236         </class>
3237         <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">
3238                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3239                         <field name="id" reporter:datatype="id"/>
3240                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
3241                         <field name="xpath" reporter:datatype="text" oils_obj:required="true"/>
3242                         <field name="format" reporter:datatype="link"/>
3243                         <field name="first_word" reporter:datatype="bool"/>
3244                 </fields>
3245                 <links/>
3246                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3247                         <actions>
3248                                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3249                                 <retrieve/>
3250                                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3251                                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3252                         </actions>
3253                 </permacrud>
3254         </class>
3255         <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">
3256                 <fields oils_persist:primary="code" oils_persist:sequence="">
3257                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3258                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3259                         <field reporter:label="Audience" 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="CREATE_MARC_CODE" global_required="true"/>
3265                                 <retrieve/>
3266                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3267                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3268                         </actions>
3269                 </permacrud>
3270         </class>
3271         <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">
3272                 <fields oils_persist:primary="code" oils_persist:sequence="">
3273                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3274                         <field reporter:label="Item Form" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3275                 </fields>
3276                 <links/>
3277                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3278                         <actions>
3279                                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3280                                 <retrieve/>
3281                                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3282                                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3283                         </actions>
3284                 </permacrud>
3285         </class>
3286         <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">
3287                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3288                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3289                         <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3290                         <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true"/>
3291                         <field reporter:label="Section Number" name="section_number" reporter:datatype="text"/>
3292                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
3293                         <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
3294                         <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link"/>
3295                         <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool"/>
3296                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3297                 </fields>
3298                 <links>
3299                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3300                         <link field="members" reltype="has_many" key="course" map="" class="acmcu"/>
3301                         <link field="materials" reltype="has_many" key="course" map="" class="acmcm"/>
3302                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm"/>
3303                 </links>
3304                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3305                         <actions>
3306                                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3307                                 <retrieve/>
3308                                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3309                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3310                         </actions>
3311                 </permacrud>
3312         </class>
3313         <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">
3314                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3315                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3316                         <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3317                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
3318                         <field reporter:label="User Role" name="usr_role" reporter:datatype="link"/>
3319                 </fields>
3320                 <links>
3321                         <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3322                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3323                         <link field="usr_role" reltype="has_a" key="id" map="" class="acmr"/>
3324                 </links>
3325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3326                         <actions>
3327                                 <create permission="MANAGE_RESERVES">
3328                                         <context link="course" field="owning_lib"/>
3329                                 </create>
3330                                 <retrieve/>
3331                                 <update permission="MANAGE_RESERVES">
3332                                         <context link="course" field="owning_lib"/>
3333                                 </update>
3334                                 <delete permission="MANAGE_RESERVES">
3335                                         <context link="course" field="owning_lib"/>
3336                                 </delete>
3337                         </actions>
3338                 </permacrud>
3339         </class>
3340         <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">
3341                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3342                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3343                         <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3344                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
3345                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
3346                         <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool"/>
3347                         <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text"/>
3348                         <field reporter:label="Original Status" name="original_status" reporter:datatype="link"/>
3349                         <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link"/>
3350                         <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link"/>
3351                         <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link"/>
3352                         <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link"/>
3353                 </fields>
3354                 <links>
3355                         <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3356                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
3357                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3358                         <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn"/>
3359                         <link field="original_status" reltype="has_a" key="id" map="" class="ccs"/>
3360                         <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
3361                         <link field="original_location" reltype="has_a" key="id" map="" class="acpl"/>
3362                         <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3363                 </links>
3364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3365                         <actions>
3366                                 <create permission="MANAGE_RESERVES">
3367                                         <context link="course" field="owning_lib"/>
3368                                 </create>
3369                                 <retrieve/>
3370                                 <update permission="MANAGE_RESERVES">
3371                                         <context link="course" field="owning_lib"/>
3372                                 </update>
3373                                 <delete permission="MANAGE_RESERVES">
3374                                         <context link="course" field="owning_lib"/>
3375                                 </delete>
3376                         </actions>
3377                 </permacrud>
3378         </class>
3379         <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">
3380                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3381                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3382                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3383                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
3384                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3385                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3386                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3387                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3388                 </fields>
3389                 <links>
3390                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3391                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3392                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3393                 </links>
3394                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3395                         <actions>
3396                                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3397                                 <retrieve/>
3398                                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3399                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3400                         </actions>
3401                 </permacrud>
3402         </class>
3403         <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">
3404                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3405                         <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3406                         <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3407                         <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3408                 </fields>
3409                 <links>
3410                         <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3411                         <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3412                 </links>
3413                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3414                         <actions>
3415                                 <create permission="MANAGE_RESERVES">
3416                                         <context link="course" field="owning_lib"/>
3417                                 </create>
3418                                 <retrieve/>
3419                                 <update permission="MANAGE_RESERVES">
3420                                         <context link="course" field="owning_lib"/>
3421                                 </update>
3422                                 <delete permission="MANAGE_RESERVES">
3423                                         <context link="course" field="owning_lib"/>
3424                                 </delete>
3425                         </actions>
3426                 </permacrud>
3427         </class>
3428         <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">
3429                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3430                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3431                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3432                         <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool"/>
3433                 </fields>
3434                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3435                         <actions>
3436                                 <create permission="MANAGE_RESERVES" global_required="true"/>
3437                                 <retrieve/>
3438                                 <update permission="MANAGE_RESERVES" global_required="true"/>
3439                                 <delete permission="MANAGE_RESERVES" global_required="true"/>
3440                         </actions>
3441                 </permacrud>
3442         </class>
3443         
3444         <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">
3445                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3446                         <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3448                         <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3449                         <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3450                 </fields>
3451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3452                         <actions>
3453                                 <retrieve/>
3454                         </actions>
3455                 </permacrud>
3456         </class>
3457         <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">
3458                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3459                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3460                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
3461                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3462                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
3463                 </fields>
3464                 <links>
3465                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3466                 </links>
3467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3468                         <actions>
3469                                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3470                                 <retrieve/>
3471                                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3472                                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3473                         </actions>
3474                 </permacrud>
3475         </class>
3476         <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">
3477                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3478                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3479                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
3480                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3481                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
3482                 </fields>
3483                 <links>
3484                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3485                 </links>
3486                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3487                         <actions>
3488                                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3489                                 <retrieve/>
3490                                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3491                                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3492                         </actions>
3493                 </permacrud>
3494         </class>
3495         <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">
3496                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3497                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3498                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3499                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
3500                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3501                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3502                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
3503                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id"/>
3504                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
3505                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
3506                         <field reporter:label="Bib Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
3507                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3508                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3509                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3510                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3511                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link" oils_obj:required="true"/>
3512                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3513                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3514                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3515                 </fields>
3516                 <links>
3517                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3518                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3519                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3520                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3521                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3522                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3523                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3524                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3525                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3526                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3527                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3528                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3529                 </links>
3530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3531                         <actions>
3532                                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3533                                 <retrieve/>
3534                                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3535                                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3536                         </actions>
3537                 </permacrud>
3538         </class>
3539         <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">
3540                 <fields oils_persist:primary="call_number">
3541                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link"/>
3542                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3543                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3544                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3545                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3546                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3547                 </fields>
3548                 <links>
3549                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3550                 </links>
3551                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3552                         <actions>
3553                                 <retrieve/>
3554                         </actions>
3555                 </permacrud>
3556         </class>
3557         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3558                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3559                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3560                         <field reporter:label="URI" name="href" reporter:datatype="text" oils_obj:required="true"/>
3561                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3562                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3563                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3564                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3565                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3566                 </fields>
3567                 <links>
3568                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3569                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3570                 </links>
3571         </class>
3572         <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">
3573                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3574                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3575                         <field reporter:label="URI" name="uri" reporter:datatype="int" oils_obj:required="true"/>
3576                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text" oils_obj:required="true"/>
3577                 </fields>
3578                 <links>
3579                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3580                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3581                 </links>
3582         </class>
3583         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3584                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3585                         <field name="id" reporter:datatype="id"/>
3586                         <field name="value" oils_persist:i18n="true" oils_obj:required="true"/>
3587                 </fields>
3588                 <links/>
3589         </class>
3590         <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">
3591                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3592                         <field name="balance_owed" reporter:datatype="money"/>
3593                         <field name="total_owed" reporter:datatype="money"/>
3594                         <field name="total_paid" reporter:datatype="money"/>
3595                         <field name="usr" reporter:datatype="link"/>
3596                 </fields>
3597                 <links>
3598                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3599                 </links>
3600                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3601                         <actions>
3602                                 <retrieve permission="VIEW_USER">
3603                                         <context link="usr" field="home_ou"/>
3604                                 </retrieve>
3605                         </actions>
3606                 </permacrud>
3607         </class>
3608         <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">
3609                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3610                         <field name="balance_owed" reporter:datatype="money"/>
3611                         <field name="total_owed" reporter:datatype="money"/>
3612                         <field name="total_paid" reporter:datatype="money"/>
3613                         <field name="usr" reporter:datatype="link"/>
3614                 </fields>
3615                 <links>
3616                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3617                 </links>
3618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3619                         <actions>
3620                                 <retrieve permission="VIEW_USER">
3621                                         <context link="usr" field="home_ou"/>
3622                                 </retrieve>
3623                         </actions>
3624                 </permacrud>
3625         </class>
3626         <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">
3627                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3628                         <field name="collector" oils_obj:required="true"/>
3629                         <field name="enter_time" reporter:datatype="timestamp"/>
3630                         <field name="id" reporter:datatype="id"/>
3631                         <field name="location" reporter:datatype="link" oils_obj:required="true"/>
3632                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
3633                 </fields>
3634                 <links>
3635                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3636                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3637                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3638                 </links>
3639                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3640                         <actions>
3641                                 <create permission="money.collections_tracker.create" context_field="location"/>
3642                                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3643                                 <delete permission="money.collections_tracker.create" context_field="location"/>
3644                         </actions>
3645                 </permacrud>
3646         </class>
3647         <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">
3648                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3649                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3650                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3651                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3652                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3653                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3654                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3655                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3656                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3657                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
3658                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
3659                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text" oils_obj:required="true"/>
3660                         <field reporter:label="MARC21Slim" name="marc" reporter:datatype="text" oils_obj:required="true"/>
3661                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int"/>
3662                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3663                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
3664                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
3665                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3666                         <field reporter:label="Share Depth" name="share_depth" reporter:datatype="int"/>
3667                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3668                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3669                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3670                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3671                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3672                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3673                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3674                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3675                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3676                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3677                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3678                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3679                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3680                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3681                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3682                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3683                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3684                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3685                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3686                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3687                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3688                 </fields>
3689                 <links>
3690                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3691                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3692                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3693                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3694                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3695                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3696                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3697                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3698                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3699                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3700                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3701                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3702                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3703                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3704                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3705                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3706                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3707                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3708                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3709                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3710                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3711                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3712                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3713                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3714                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3715                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3716                 </links>
3717                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3718                         <actions>
3719                                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3720                                 <retrieve/>
3721                                 <update permission="UPDATE_MARC" global_required="true"/>
3722                 <!-- 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. -->
3723                                 <delete permission="DELETE_RECORD" global_required="true"/>
3724                         </actions>
3725                 </permacrud>
3726         </class>
3727         <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">
3728                 <fields oils_persist:primary="id">
3729                         <field name="dow_0_close"/>
3730                         <field name="dow_0_open"/>
3731                         <field name="dow_0_note" reporter:datatype="text"/>
3732                         <field name="dow_1_close"/>
3733                         <field name="dow_1_open"/>
3734                         <field name="dow_1_note" reporter:datatype="text"/>
3735                         <field name="dow_2_close"/>
3736                         <field name="dow_2_open"/>
3737                         <field name="dow_2_note" reporter:datatype="text"/>
3738                         <field name="dow_3_close"/>
3739                         <field name="dow_3_open"/>
3740                         <field name="dow_3_note" reporter:datatype="text"/>
3741                         <field name="dow_4_close"/>
3742                         <field name="dow_4_open"/>
3743                         <field name="dow_4_note" reporter:datatype="text"/>
3744                         <field name="dow_5_close"/>
3745                         <field name="dow_5_open"/>
3746                         <field name="dow_5_note" reporter:datatype="text"/>
3747                         <field name="dow_6_close"/>
3748                         <field name="dow_6_open"/>
3749                         <field name="dow_6_note" reporter:datatype="text"/>
3750                         <field name="id" reporter:datatype="id" oils_obj:required="true"/>
3751                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3752                 </fields>
3753                 <links>
3754                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3755                 </links>
3756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3757                         <actions>
3758                                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3759                                 <retrieve/>
3760                                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3761                                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3762                         </actions>
3763                 </permacrud>
3764         </class>
3765         <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">
3766                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3767                         <field name="id" reporter:datatype="id"/>
3768                         <field name="record" reporter:datatype="link" oils_obj:required="true"/>
3769                         <field name="label" reporter:datatype="text" oils_obj:required="true"/>
3770                         <field name="label_sortkey" reporter:datatype="text" oils_obj:required="true"/>
3771                         <field name="deleted" reporter:datatype="bool"/>
3772                 </fields>
3773                 <links>
3774                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3775                 </links>
3776                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3777                         <actions>
3778                                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3779                                 <retrieve/>
3780                                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3781                                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3782                         </actions>
3783                 </permacrud>
3784         </class>
3785         <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">
3786                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3787                         <field name="id" reporter:datatype="id"/>
3788                         <field name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
3789                         <field name="part" reporter:datatype="link" oils_obj:required="true"/>
3790                 </fields>
3791                 <links>
3792                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3793                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3794                 </links>
3795                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3796                         <actions>
3797                                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3798                                 <retrieve/>
3799                                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3800                                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3801                         </actions>
3802                 </permacrud>
3803         </class>
3804         <class id="aecc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_circulation" oils_persist:tablename="action.emergency_closing_circulation" reporter:label="Emergency Closing Circulation Entry" oils_persist:readonly="true"> <!-- This is not a view, but is managed via functions, so it's readonly. -->
3805                 <fields oils_persist:primary="id">
3806                         <field name="id" reporter:datatype="id"/>
3807                         <field name="circulation" reporter:datatype="link"/>
3808                         <field name="emergency_closing" reporter:datatype="link"/>
3809                         <field name="original_due_date" reporter:datatype="timestamp"/>
3810                         <field name="process_time" reporter:datatype="timestamp"/>
3811                 </fields>
3812                 <links>
3813                         <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3814                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3815                 </links>
3816                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3817                         <actions>
3818                                 <retrieve/>
3819                         </actions>
3820                 </permacrud>
3821         </class>
3822         <class id="aecr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_reservation" oils_persist:tablename="action.emergency_closing_reservation" reporter:label="Emergency Closing Reservation Entry" oils_persist:readonly="true"> <!-- This is not a view, but is managed via functions, so it's readonly. -->
3823                 <fields oils_persist:primary="id">
3824                         <field name="id" reporter:datatype="id"/>
3825                         <field name="reservation" reporter:datatype="link"/>
3826                         <field name="emergency_closing" reporter:datatype="link"/>
3827                         <field name="original_end_time" reporter:datatype="timestamp"/>
3828                         <field name="process_time" reporter:datatype="timestamp"/>
3829                 </fields>
3830                 <links>
3831                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3832                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3833                 </links>
3834                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3835                         <actions>
3836                                 <retrieve/>
3837                         </actions>
3838                 </permacrud>
3839         </class>
3840         <class id="aech" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_hold" oils_persist:tablename="action.emergency_closing_hold" reporter:label="Emergency Closing Hold Entry" oils_persist:readonly="true"> <!-- This is not a view, but is managed via functions, so it's readonly. -->
3841                 <fields oils_persist:primary="id">
3842                         <field name="id" reporter:datatype="id"/>
3843                         <field name="hold" reporter:datatype="link"/>
3844                         <field name="emergency_closing" reporter:datatype="link"/>
3845                         <field name="original_shelf_expire_time" reporter:datatype="timestamp"/>
3846                         <field name="process_time" reporter:datatype="timestamp"/>
3847                 </fields>
3848                 <links>
3849                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3850                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3851                 </links>
3852                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3853                         <actions>
3854                                 <retrieve/>
3855                         </actions>
3856                 </permacrud>
3857         </class>
3858         <class id="aecs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_status" oils_persist:tablename="action.emergency_closing_status" reporter:label="Emergency Closing Status" oils_persist:readonly="true">
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" oils_obj:required="true"/>
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" oils_obj:required="true"/>
3922                         <field name="close_start" reporter:datatype="timestamp" oils_obj:required="true"/>
3923                         <field name="id" reporter:datatype="id"/>
3924                         <field name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
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" oils_obj:required="true"/>
3946                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3947                         <field name="max_renewals" reporter:datatype="int" oils_obj:required="true"/>
3948                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
3949                         <field name="normal" reporter:datatype="interval" oils_obj:required="true"/>
3950                         <field name="shrt" reporter:datatype="interval" oils_obj:required="true"/>
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" oils_obj:required="true"/>
3969                         <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool" oils_obj:required="true"/>
3970                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp" oils_obj:required="true"/>
3971                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3972                         <field reporter:label="Values" name="values" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3973                 </fields>
3974                 <links>
3975                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3976                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
3977                 </links>
3978                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3979                         <actions>
3980                                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3981                                 <retrieve/>
3982                                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3983                                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3984                         </actions>
3985                 </permacrud>
3986         </class>
3987
3988         <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">
3989                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3990                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3991                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
3992                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp" oils_obj:required="true"/>
3993                         <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp" oils_obj:required="true"/>
3994                 </fields>
3995                 <links>
3996                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3997                 </links>
3998                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3999                         <actions>
4000                                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4001                                 <retrieve/>
4002                                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4003                                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4004                         </actions>
4005                 </permacrud>
4006         </class>
4007
4008         <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">
4009                 <fields oils_persist:primary="id" oils_persist:sequence="">
4010                         <field name="balance_owed" reporter:datatype="money"/>
4011                         <field name="id" reporter:datatype="id"/>
4012                         <field name="last_billing_note" reporter:datatype="text"/>
4013                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4014                         <field name="last_billing_type" reporter:datatype="text"/>
4015                         <field name="last_payment_note" reporter:datatype="text"/>
4016                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4017                         <field name="last_payment_type" reporter:datatype="text"/>
4018                         <field name="total_owed" reporter:datatype="money"/>
4019                         <field name="total_paid" reporter:datatype="money"/>
4020                         <field name="usr" reporter:datatype="link"/>
4021                         <field name="xact_finish" reporter:datatype="timestamp"/>
4022                         <field name="xact_start" reporter:datatype="timestamp"/>
4023                         <field name="xact_type" reporter:datatype="text"/>
4024                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4025                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4026                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4027                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4028                         <field name="billing_location" reporter:datatype="link"/>
4029                 </fields>
4030                 <links>
4031                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4032                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4033                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4034                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4035                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4036                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4037                 </links>
4038                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4039                         <actions>
4040                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4041                                         <context link="usr" field="home_ou"/>
4042                                 </retrieve>
4043                         </actions>
4044                 </permacrud>
4045         </class>
4046         <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">
4047                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4048                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4049                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4050                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4051                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4052                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4053                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4054                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4055                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4056                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4057                         <field reporter:label="Privacy Waiver Entries" name="waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4058                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4059                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4060                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4061                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4062                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4063                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4064                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int"/>
4065                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int"/>
4066                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4067                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
4068                         <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
4069                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4070                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
4071                         <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
4072                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4073                         <field reporter:label="Last Name" name="family_name" reporter:datatype="text" oils_obj:required="true"/>
4074                         <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" oils_obj:required="true"/>
4075                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit" oils_obj:required="true"/>
4076                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname"/>
4077                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link" oils_obj:required="true"/>
4078                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4079                         <field reporter:label="Primary Identification" name="ident_value" reporter:datatype="text"/>
4080                         <field reporter:label="Secondary Identification" name="ident_value2" reporter:datatype="text"/>
4081                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4082                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4083                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4084                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4085                         <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text"/>
4086                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text" oils_obj:required="true"/>
4087                         <field reporter:label="Photo URL" name="photo_url" reporter:datatype="text"/>
4088                         <field reporter:label="Prefix/Title" name="prefix" reporter:datatype="text"/>
4089                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link" oils_obj:required="true"/>
4090                         <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
4091                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4092                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
4093                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4094                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4095                         <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
4096                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text"/>
4097                         <field reporter:label="Juvenile" name="juvenile" reporter:datatype="bool"/>
4098                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4099                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4100                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4101                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4102                         <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text"/>
4103                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4104                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4105                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4106                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4107                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4108                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4109                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4110                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4111                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4112                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4113                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4114                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4115                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4116                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4117                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4118                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4119                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4120                         <field reporter:label="Patron Preferred Language" name="locale" 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                         <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4156                 </links>
4157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4158                         <actions>
4159                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou"/>
4160                         </actions>
4161                 </permacrud>
4162         </class>
4163         <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">
4164                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4165                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4166                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4167                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4168                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4169                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_obj:required="true"/>
4170                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text" oils_obj:required="true"/>
4171                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4172                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4173                 </fields>
4174                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4175                         <actions>
4176                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4177                                 <retrieve/>
4178                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4179                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4180                         </actions>
4181                 </permacrud>
4182         </class>
4183         <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">
4184                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4185                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
4186                         <field name="usr" reporter:label="User" reporter:datatype="link"/>
4187                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" oils_obj:required="true"/>
4188                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp"/>
4189                 </fields>
4190                 <links>
4191                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4192                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4193                 </links>
4194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4195                         <actions>
4196                                 <retrieve permission="RUN_REPORTS">
4197                                         <context link="usr" field="home_ou"/>
4198                                 </retrieve>
4199                         </actions>
4200                 </permacrud>
4201         </class>
4202         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4203                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4204                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
4205                         <field name="usr" reporter:label="Owning User" reporter:datatype="link"/>
4206                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link"/>
4207                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link"/>
4208                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4209                         <field name="layout" reporter:label="Layout" reporter:datatype="text" oils_obj:required="true"/>
4210                 </fields>
4211                 <links>
4212                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4213                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4214                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4215                 </links>
4216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4217                         <actions>
4218                                 <create permission="ADMIN_TOOLBAR" context_field="org"/>
4219                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4220                                         <context link="usr" field="home_ou"/>
4221                                         <context link="ws" field="owning_lib"/>
4222                                 </retrieve>
4223                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4224                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4225                         </actions>
4226                 </permacrud>
4227         </class>
4228         <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">
4229                 <fields oils_persist:primary="name">
4230                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4231                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4232                 </fields>
4233                 <links/>
4234                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4235                         <actions>
4236                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4237                                 <retrieve/>
4238                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4239                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4240                         </actions>
4241                 </permacrud>
4242         </class>
4243         <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">
4244                 <fields oils_persist:primary="name">
4245                         <field name="name" reporter:label="Name" reporter:datatype="text" oils_obj:required="true"/>
4246                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4247                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4248                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4249                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4250                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4251                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4252                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4253                 </fields>
4254                 <links>
4255                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4256                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4257                 </links>
4258                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4259                         <actions>
4260                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4261                                 <retrieve/>
4262                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4263                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4264                         </actions>
4265                 </permacrud>
4266         </class>
4267         <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">
4268                 <fields oils_persist:primary="name">
4269                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4270                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4271                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4272                         <field name="datatype" reporter:datatype="text"/>
4273                         <field name="view_perm" reporter:datatype="link"/>
4274                         <field name="update_perm" reporter:datatype="link"/>
4275                         <field name="fm_class" reporter:datatype="text"/>
4276                         <field name="grp" reporter:datatype="link"/>
4277                 </fields>
4278                 <links>
4279                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4280                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4281                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4282                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4283                 </links>
4284                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4285                         <actions>
4286                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4287                                 <retrieve/>
4288                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4289                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4290                         </actions>
4291                 </permacrud>
4292         </class>
4293         <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">
4294                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4295                         <field name="id"/>
4296                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4297                         <field name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
4298                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4299                 </fields>
4300                 <links>
4301                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4302                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4303                 </links>
4304         </class>
4305         <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">
4306                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4307                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4308                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
4309                         <field reporter:label="Note ID" name="id" reporter:datatype="id"/>
4310                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link" oils_obj:required="true"/>
4311                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4312                         <field reporter:label="Note Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
4313                         <field reporter:label="Note Content" name="value" reporter:datatype="text" oils_obj:required="true"/>
4314                 </fields>
4315                 <links>
4316                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4317                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4318                 </links>
4319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4320                         <actions>
4321                                 <create permission="CREATE_COPY_NOTE">
4322                                         <context link="owning_copy" field="circ_lib"/>
4323                                 </create>
4324                                 <retrieve permission="VIEW_COPY_NOTES">
4325                                         <context link="owning_copy" field="circ_lib"/>
4326                                 </retrieve>
4327                                 <update permission="UPDATE_COPY_NOTE">
4328                                         <context link="owning_copy" field="circ_lib"/>
4329                                 </update>
4330                                 <delete permission="DELETE_COPY_NOTE">
4331                                         <context link="owning_copy" field="circ_lib"/>
4332                                 </delete>
4333                         </actions>
4334                 </permacrud>
4335         </class>
4336         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4337                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4338                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
4339                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string" reporter:datatype="text"/>
4340                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string" reporter:datatype="text"/>
4341                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4342                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string" reporter:datatype="text"/>
4343                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
4344                         <field reporter:label="Normalized Value" name="value" reporter:datatype="text"/>
4345                 </fields>
4346                 <links>
4347                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4348                 </links>
4349         </class>
4350         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4351                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4352                         <field name="fingerprint" reporter:datatype="text" oils_obj:required="true"/>
4353                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint"/>
4354                         <field name="master_record" reporter:datatype="link"/>
4355                         <field name="mods" reporter:datatype="text"/>
4356                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4357                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4358                 </fields>
4359                 <links>
4360                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4361                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4362                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4363                 </links>
4364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4365                         <actions>
4366                                 <retrieve/>
4367                         </actions>
4368                 </permacrud>
4369         </class>
4370         <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">
4371                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4372                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4373                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4374                 </fields>
4375                 <links/>
4376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4377                         <actions>
4378                                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4379                                 <retrieve/>
4380                                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4381                                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4382                         </actions>
4383                 </permacrud>
4384         </class>
4385         <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">
4386                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4387                         <field name="code" reporter:datatype="text" oils_obj:required="true"/>
4388                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4389                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4390                 </fields>
4391                 <links/>
4392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4393                         <actions>
4394                                 <create permission="CREATE_PERM" global_required="true"/>
4395                                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4396                                 <update permission="UPDATE_PERM" global_required="true"/>
4397                                 <delete permission="DELETE_PERM" global_required="true"/>
4398                         </actions>
4399                 </permacrud>
4400         </class>
4401         <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">
4402                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4403                         <field name="id" reporter:datatype="id"/>
4404                         <field name="metarecord" reporter:datatype="link" oils_obj:required="true"/>
4405                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
4406                 </fields>
4407                 <links>
4408                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4409                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4410                 </links>
4411                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4412                         <actions>
4413                                 <retrieve/>
4414                         </actions>
4415                 </permacrud>
4416         </class>
4417         <class id="mde" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::display_entry" oils_persist:tablename="metabib.display_entry" oils_persist:field_safe="true" reporter:label="Display Field Entry" oils_persist:readonly="true">
4418                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4419                         <field name="id" reporter:datatype="id"/>
4420                         <field name="field" reporter:datatype="link"/>
4421                         <field name="source" reporter:datatype="link"/>
4422                         <field name="value" reporter:datatype="text"/>
4423                         <field name="highlight" oils_persist:virtual="true" reporter:datatype="text"/>
4424                 </fields>
4425                 <links>
4426                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4427                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4428                 </links>
4429                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4430                         <actions>
4431                                 <retrieve/>
4432                         </actions>
4433                 </permacrud>
4434         </class>
4435         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="metabib.flat_display_entry" oils_obj:fieldmapper="metabib::flat_display_entry" oils_persist:field_safe="true" reporter:label="Flat Display Entry" oils_persist:readonly="true">
4436                 <fields>
4437                         <field name="source" reporter:datatype="id"/>
4438                         <field name="name" reporter:datatype="text"/>
4439                         <field name="multi" reporter:datatype="bool"/>
4440                         <field name="label" reporter:datatype="text"/>
4441                         <field name="field" reporter:datatype="link"/>
4442                         <field name="value" reporter:datatype="text"/>
4443                 </fields>
4444                 <links>
4445                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4446                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4447                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4448                 </links>
4449                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4450                         <actions>
4451                                 <retrieve/>
4452                         </actions>
4453                 </permacrud>
4454         </class>
4455         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="metabib.compressed_display_entry" oils_obj:fieldmapper="metabib::compressed_display_entry" oils_persist:field_safe="true" reporter:label="Compressed Display Entry" oils_persist:readonly="true">
4456                 <fields>
4457                         <field name="source" reporter:datatype="id"/>
4458                         <field name="name" reporter:datatype="text"/>
4459                         <field name="multi" reporter:datatype="bool"/>
4460                         <field name="label" reporter:datatype="text"/>
4461                         <field name="field" reporter:datatype="link"/>
4462                         <field name="value" reporter:datatype="text"/>
4463                 </fields>
4464                 <links>
4465                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4466                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4467                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4468                 </links>
4469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4470                         <actions>
4471                                 <retrieve/>
4472                         </actions>
4473                 </permacrud>
4474         </class>
4475         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="metabib.wide_display_entry" oils_obj:fieldmapper="metabib::wide_display_entry" oils_persist:field_safe="true" reporter:label="Wide Display Entry" oils_persist:readonly="true">
4476                 <fields oils_persist:primary="source">
4477                         <field name="source" reporter:label="Record ID" reporter:datatype="id"/>
4478                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4479                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4480                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4481                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4482                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4483                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4484                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4485                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4486                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4487                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4488                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4489                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4490                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4491                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4492                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4493                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4494                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4495                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4496                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4497                 </fields>
4498                 <links>
4499                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4500                 </links>
4501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4502                         <actions>
4503                                 <retrieve/>
4504                         </actions>
4505                 </permacrud>
4506         </class>
4507
4508         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="config.display_field_map" oils_obj:fieldmapper="config::display_field_map" oils_persist:field_safe="true" reporter:label="Display Field Map">
4509                 <fields oils_persist:primary="name">
4510                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4511                         <field name="field" reporter:datatype="link"/>
4512                         <field name="multi" reporter:datatype="bool"/>
4513                 </fields>
4514                 <links>
4515                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4516                 </links>
4517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4518                         <actions>
4519                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4520                                 <retrieve/>
4521                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4522                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4523                         </actions>
4524                 </permacrud>
4525         </class>
4526
4527         <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">
4528                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4529                         <field name="id" reporter:datatype="id"/>
4530                         <field name="field" reporter:datatype="link"/>
4531                         <field name="source" reporter:datatype="link"/>
4532                         <field name="value" reporter:datatype="text"/>
4533                 </fields>
4534                 <links>
4535                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4536                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4537                 </links>
4538         </class>
4539         <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">
4540                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4541                         <field name="id" reporter:datatype="id"/>
4542                         <field name="value" reporter:datatype="text"/>
4543                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4544                 </fields>
4545                 <links>
4546                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4547                 </links>
4548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4549                         <actions>
4550                                 <retrieve/>
4551                         </actions>
4552                 </permacrud>
4553         </class>
4554         <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">
4555                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4556                         <field name="id" reporter:datatype="id"/>
4557                         <field name="entry" reporter:datatype="link"/>
4558                         <field name="def" reporter:datatype="link"/>
4559                         <field name="source" reporter:datatype="link"/>
4560                 </fields>
4561                 <links>
4562                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4563                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4564                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4565                 </links>
4566         </class>
4567         <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">
4568                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4569                         <field name="id" reporter:datatype="id"/>
4570                         <field name="entry" reporter:datatype="link"/>
4571                         <field name="simple_heading" reporter:datatype="link"/>
4572                 </fields>
4573                 <links>
4574                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4575                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4576                 </links>
4577         </class>
4578         <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">
4579                 <oils_persist:source_definition><![CDATA[
4580                         SELECT * FROM metabib.author_field_entry
4581                                                 UNION ALL
4582                         SELECT * FROM metabib.keyword_field_entry
4583                                                 UNION ALL
4584                         SELECT * FROM metabib.identifier_field_entry
4585                                                 UNION ALL
4586                         SELECT * FROM metabib.title_field_entry
4587                                                 UNION ALL
4588                         SELECT * FROM metabib.subject_field_entry
4589                                                 UNION ALL
4590                         SELECT * FROM metabib.series_field_entry
4591                 ]]></oils_persist:source_definition>
4592                 <fields>
4593                         <field name="field" reporter:datatype="link"/>
4594                         <field name="id" reporter:datatype="id"/>
4595                         <field name="source" reporter:datatype="link"/>
4596                         <field name="value" reporter:datatype="text"/>
4597                 </fields>
4598                 <links>
4599                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4600                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4601                 </links>
4602         </class>
4603         <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">
4604                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4605                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
4606                         <field name="id" reporter:datatype="id"/>
4607                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
4608                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4609                 </fields>
4610                 <links>
4611                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4612                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4613                 </links>
4614         </class>
4615         <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">
4616                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4617                         <field name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
4618                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
4619                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
4620                         <field name="cash_drawer" reporter:datatype="link"/>
4621                         <field name="id" reporter:datatype="id"/>
4622                         <field name="note" reporter:datatype="text"/>
4623                         <field name="payment_ts" reporter:datatype="timestamp"/>
4624                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
4625                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
4626                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4627                 </fields>
4628                 <links>
4629                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4630                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4631                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4632                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4633                 </links>
4634                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4635                         <actions>
4636                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4637                                         <context link="xact" jump="usr" field="home_ou"/>
4638                                 </retrieve>
4639                         </actions>
4640                 </permacrud>
4641         </class>
4642         <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">
4643                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4644                         <field name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
4645                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
4646                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
4647                         <field name="id" reporter:datatype="id"/>
4648                         <field name="note" reporter:datatype="text"/>
4649                         <field name="payment_ts" reporter:datatype="timestamp"/>
4650                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
4651                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
4652                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4653                 </fields>
4654                 <links>
4655                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4656                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4657                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4658                 </links>
4659                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4660                         <actions>
4661                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4662                                         <context link="xact" jump="usr" field="home_ou"/>
4663                                 </retrieve>
4664                         </actions>
4665                 </permacrud>
4666         </class>
4667         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4668                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4669                         <field name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
4670                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
4671                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
4672                         <field name="id" reporter:datatype="id"/>
4673                         <field name="note" reporter:datatype="text"/>
4674                         <field name="payment_ts" reporter:datatype="timestamp"/>
4675                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
4676                         <field name="billing" reporter:datatype="link"/>
4677                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
4678                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4679                 </fields>
4680                 <links>
4681                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4682                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4683                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4684                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4685                 </links>
4686         </class>
4687         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4688                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4689                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string" reporter:datatype="text"/>
4690                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string" reporter:datatype="text"/>
4691                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string" reporter:datatype="text"/>
4692                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string" reporter:datatype="text"/>
4693                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string" reporter:datatype="text"/>
4694                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string" reporter:datatype="text"/>
4695                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id"/>
4696                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string" reporter:datatype="text"/>
4697                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string" reporter:datatype="text"/>
4698                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string" reporter:datatype="text"/>
4699                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string" reporter:datatype="text"/>
4700                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string" reporter:datatype="text"/>
4701                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4702                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string" reporter:datatype="text"/>
4703                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string" reporter:datatype="text"/>
4704                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string" reporter:datatype="text"/>
4705                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string" reporter:datatype="text"/>
4706                 </fields>
4707                 <links>
4708                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4709                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4710                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4711                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4712                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4713                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4714                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4715                 </links>
4716         </class>
4717
4718         <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">
4719                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4720                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4721                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
4722                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4723                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4724                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4725                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4726                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4727                 </fields>
4728                 <links/>
4729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4730                         <actions>
4731                                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4732                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4733                                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4734                                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4735                         </actions>
4736                 </permacrud>
4737         </class>
4738         <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">
4739                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4740                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4741                         <field name="grp" reporter:datatype="link" reporter:label="Group" oils_obj:required="true"/>
4742                         <field name="penalty" reporter:datatype="link" reporter:label="Penalty" oils_obj:required="true"/>
4743                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold" oils_obj:required="true"/>
4744                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
4745                 </fields>
4746                 <links>
4747                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4748                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4749                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4750                 </links>
4751                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4752                         <actions>
4753                                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4754                                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4755                                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4756                                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4757                         </actions>
4758                 </permacrud>
4759         </class>
4760         <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">
4761                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4762                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4763                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4764                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name" oils_obj:required="true"/>
4765                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4766                         <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4767                         <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4768                         <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4769                         <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4770                 </fields>
4771                 <links/>
4772                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4773                         <actions>
4774                                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4775                                 <retrieve/>
4776                                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4777                                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4778                         </actions>
4779                 </permacrud>
4780         </class>
4781         <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">
4782                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4783                         <field name="id" reporter:datatype="id" reporter:label="ID"/>
4784                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4785                         <field name="usr" reporter:datatype="link" reporter:label="User" oils_obj:required="true"/>
4786                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4787                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty" oils_obj:required="true"/>
4788                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit" oils_obj:required="true"/>
4789                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4790                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4791                 </fields>
4792                 <links>
4793                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4794                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4795                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4796                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4797                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4798                 </links>
4799                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4800                         <actions>
4801                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4802                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4803                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4804                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4805                         </actions>
4806                 </permacrud>
4807         </class>
4808         <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">
4809                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4810                         <field reporter:label="Type" name="address_type" reporter:datatype="text"/>
4811                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
4812                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
4813                         <field reporter:label="County" name="county" reporter:datatype="text"/>
4814                         <field reporter:label="Address ID" name="id" reporter:datatype="id"/>
4815                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
4816                         <field reporter:label="State" name="state" reporter:datatype="text"/>
4817                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text" oils_obj:required="true"/>
4818                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
4819                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
4820                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4821                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4822                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4823                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4824                 </fields>
4825                 <links>
4826                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4827                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4828                 </links>
4829                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4830                         <actions>
4831                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4832                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4833                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4834                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4835                         </actions>
4836                 </permacrud>
4837         </class>
4838         <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">
4839                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4840                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id"/>
4841                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4842                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4843                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool"/>
4844                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4845                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
4846                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
4847                         <field reporter:label="City" name="city" reporter:datatype="text"/>
4848                         <field reporter:label="County" name="county" reporter:datatype="text"/>
4849                         <field reporter:label="State" name="state" reporter:datatype="text"/>
4850                         <field reporter:label="Country" name="country" reporter:datatype="text"/>
4851                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4852                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4853                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4854                 </fields>
4855                 <links>
4856                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4857                 </links>
4858                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4859                         <actions>
4860                                 <create context_field="owner" permission="ADMIN_ADDRESS_ALERT"/>
4861                                 <retrieve context_field="owner" permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4862                                 <update context_field="owner" permission="ADMIN_ADDRESS_ALERT"/>
4863                                 <delete context_field="owner" permission="ADMIN_ADDRESS_ALERT"/>
4864                         </actions>
4865                 </permacrud>
4866         </class>
4867
4868
4869         <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">
4870                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4871                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4872                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
4873                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
4874                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4875                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text" oils_obj:required="true"/>
4876                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4877                         <field reporter:label="Target" name="target" reporter:datatype="text" oils_obj:required="true"/>
4878                 </fields>
4879                 <links>
4880                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4881                 </links>
4882         </class>
4883
4884         <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">
4885                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4886                         <field name="call_number" oils_obj:required="true"/>
4887                         <field name="create_date" reporter:datatype="timestamp"/>
4888                         <field name="creator" reporter:datatype="link" oils_obj:required="true"/>
4889                         <field name="id" reporter:datatype="id"/>
4890                         <field name="pub" reporter:datatype="bool"/>
4891                         <field name="title" reporter:datatype="text" oils_obj:required="true"/>
4892                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4893                 </fields>
4894                 <links>
4895                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4896                 </links>
4897                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4898                         <actions>
4899                                 <create permission="CREATE_VOLUME_NOTE">
4900                                         <context link="call_number" field="owning_lib"/>
4901                                 </create>
4902                                 <retrieve permission="VIEW_VOLUME_NOTES">
4903                                         <context link="call_number" field="owning_lib"/>
4904                                 </retrieve>
4905                                 <update permission="UPDATE_VOLUME_NOTE">
4906                                         <context link="call_number" field="owning_lib"/>
4907                                 </update>
4908                                 <delete permission="DELETE_VOLUME_NOTE">
4909                                         <context link="call_number" field="owning_lib"/>
4910                                 </delete>
4911                         </actions>
4912                 </permacrud>
4913         </class>
4914         <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">
4915                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4916                         <field name="create_date" reporter:datatype="timestamp"/>
4917                         <field name="creator" reporter:datatype="link"/>
4918                         <field name="edit_date" reporter:datatype="timestamp"/>
4919                         <field name="editor" reporter:datatype="link"/>
4920                         <field name="id" reporter:datatype="id"/>
4921                         <field name="record" reporter:datatype="link" oils_obj:required="true"/>
4922                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4923                 </fields>
4924                 <links>
4925                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4926                 </links>
4927                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4928                         <actions>
4929                                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required="true"/>
4930                                 <retrieve/>
4931                                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required="true"/>
4932                                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required="true"/>
4933                         </actions>
4934                 </permacrud>
4935         </class>
4936         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4937                 <oils_persist:source_definition><![CDATA[
4938 SELECT  usr,
4939                 SUM(
4940                         CASE
4941                                 WHEN (
4942                                         ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4943                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4944                                 ) THEN 1
4945                                 ELSE 0
4946                         END
4947                 ) AS out,
4948
4949                 SUM(
4950                         CASE
4951                                 WHEN (
4952                                         ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4953                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4954                                 ) THEN 1
4955                                 ELSE 0
4956                         END
4957                 ) AS overdue,
4958
4959                 SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4960                 SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4961                 SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4962   FROM  action.circulation
4963   WHERE checkin_time IS NULL
4964   GROUP BY 1
4965                 ]]></oils_persist:source_definition>
4966                 <fields oils_persist:primary="usr">
4967                         <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4968                         <field reporter:label="Out" name="out" reporter:datatype="text"/>
4969                         <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4970                         <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4971                         <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4972                         <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4973                 </fields>
4974                 <links>
4975                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4976                 </links>
4977         </class>
4978         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4979                 <oils_persist:source_definition><![CDATA[
4980 SELECT  usr,
4981                 STRING_AGG(
4982                         CASE
4983                                 WHEN (
4984                                         ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4985                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4986                                 ) THEN id::TEXT
4987                                 ELSE '0'
4988                         END
4989                 ,',') AS out,
4990
4991                 STRING_AGG(
4992                         CASE
4993                                 WHEN (
4994                                         ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4995                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4996                                 ) THEN id::TEXT
4997                                 ELSE '0'
4998                         END
4999                 ,',') AS overdue,
5000
5001                 STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5002                 STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5003                 STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5004   FROM  action.circulation
5005   WHERE checkin_time IS NULL
5006   GROUP BY 1
5007                 ]]></oils_persist:source_definition>
5008                 <fields oils_persist:primary="usr">
5009                         <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5010                         <field reporter:label="Out" name="out" reporter:datatype="text"/>
5011                         <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5012                         <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5013                         <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5014                         <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5015                 </fields>
5016                 <links>
5017                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5018                 </links>
5019         </class>
5020         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5021                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5022                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id"/>
5023                         <field reporter:label="Patron" name="patron" reporter:datatype="link" oils_obj:required="true"/>
5024                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
5025                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5026                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5027                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5028                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5029                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5030                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5031                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5032                 </fields>
5033                 <links>
5034                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5035                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5036                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5037                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5038                 </links>
5039         </class>
5040         <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">
5041                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5042                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5043                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5044                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5045                         <field reporter:label="Checkout / Renewal Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5046                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link" oils_obj:required="true"/>
5047                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5048                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5049                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5050                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link" oils_obj:required="true"/>
5051                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5052                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
5053                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5054                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5055                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5056                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5057                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5058                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5059                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" oils_obj:required="true"/>
5060                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" oils_obj:required="true"/>
5061                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5062                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5063                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5064                         <field reporter:label="Patron" name="usr" reporter:datatype="link" oils_obj:required="true"/>
5065                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5066                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5067                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp"/>
5068                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5069                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5070                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5071                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5072                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5073                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5074                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5075                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5076                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5077                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5078                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5079                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5080                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5081                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5082                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5083                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5084                 </fields>
5085                 <links>
5086                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5087                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5088                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5089                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5090                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5091                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5092                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5093                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5094                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5095                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5096                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5097                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5098                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5099                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5100                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5101                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5102                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5103                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5104                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5105                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5106                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5107                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5108                 </links>
5109                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5110                         <actions>
5111                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5112                         </actions>
5113                 </permacrud>
5114         </class>
5115         <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">
5116                 <fields>
5117                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5118                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5119                         <field reporter:label="Circ ID" name="id" reporter:datatype="int"/>
5120                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5121                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
5122                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5123                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5124                 </fields>
5125                 <links>
5126                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5127                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5128                 </links>
5129                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5130                         <actions>
5131                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5132                         </actions>
5133                 </permacrud>
5134         </class>
5135         <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">
5136                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5137                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5138                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5139                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5140                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5141                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5142                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5143                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5144                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5145                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5146                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5147                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
5148                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5149                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5150                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5151                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5152                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5153                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5154                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
5155                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
5156                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5157                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5158                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5159                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5160                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5161                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp"/>
5162                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5163                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5164                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5165                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5166                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5167                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5168                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5169                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5170                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5171                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5172                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5173                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5174                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5175                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5176                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5177                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5178                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5179                 </fields>
5180                 <links>
5181                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5182                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5183                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5184                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5185                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5186                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5187                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5188                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5189                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5190                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5191                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5192                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5193                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5194                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5195                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5196                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5197                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5198                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5199                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5200                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5201                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5202                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5203                 </links>
5204                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5205                         <actions>
5206                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5207                         </actions>
5208                 </permacrud>
5209         </class>
5210
5211         <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">
5212                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5213                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5214                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5215                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5216                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5217                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5218                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5219                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5220                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5221                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5222                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5223                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
5224                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5225                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5226                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5227                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5228                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5229                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5230                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
5231                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
5232                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5233                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5234                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5235                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5236                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5237                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5238                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp"/>
5239                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5240                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5241                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5242                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5243                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5244                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5245                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5246                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5247                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5248                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5249                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5250                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5251                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5252                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5253                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5254                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5255                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5256                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5257                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5258                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5259                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5260                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5261                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5262                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5263                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5264                 </fields>
5265                 <links>
5266                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5267                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5268                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5269                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5270                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5271                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5272                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5273                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5274                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5275                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5276                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5277                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5278                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5279                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5280                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5281                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5282                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5283                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5284                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5285                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5286                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5287                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5288                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5289                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5290                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5291                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5292                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5293                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5294                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5295                 </links>
5296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5297                         <actions>
5298                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5299                         </actions>
5300                 </permacrud>
5301         </class>
5302         <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">
5303                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5304                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5305                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5306                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5307                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5308                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link" oils_obj:required="true"/>
5309                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5310                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5311                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5312                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link" oils_obj:required="true"/>
5313                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval" oils_obj:required="true"/>
5314                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
5315                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5316                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5317                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5318                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5319                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5320                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5321                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" oils_obj:required="true"/>
5322                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" oils_obj:required="true"/>
5323                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5324                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5325                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5326                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5327                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5328                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" oils_obj:required="true"/>
5329                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5330                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5331                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5332                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5333                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5334                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5335                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5336                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5337                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5338                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5339                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5340                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link" oils_obj:required="true"/>
5341                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link" oils_obj:required="true"/>
5342                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5343                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link" oils_obj:required="true"/>
5344                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link" oils_obj:required="true"/>
5345                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link" oils_obj:required="true"/>
5346                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link" oils_obj:required="true"/>
5347                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link" oils_obj:required="true"/>
5348                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5349                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5350                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5351                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5352                 </fields>
5353                 <links>
5354                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5355                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5356                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5357                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5358                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5359                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5360                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5361                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5362                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5363                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5364                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5365                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5366                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5367                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5368                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5369                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5370                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5371                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5372                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5373                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5374                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5375                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5376                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5377                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5378                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5379                 </links>
5380         </class>
5381         <class id="auch" controller="open-ils.cstore" oils_obj:fieldmapper="action::user_circ_history" oils_persist:tablename="action.usr_circ_history" reporter:label="User Checkout History">
5382                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5383                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5384                         <!-- prevent reporting on the user that owns the checkout history -->
5385                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store" oils_obj:required="true"/>
5386                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5387                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp"/>
5388                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" oils_obj:required="true"/>
5389                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp"/>
5390                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link"/>
5391                 </fields>
5392                 <links>
5393                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5394                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5395                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5396                 </links>
5397         </class>
5398         <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">
5399                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5400                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5401                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5402                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5403                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5404                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5405                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5406                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5407                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5408                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5409                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5410                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5411                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5412                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5413                 </fields>
5414                 <links>
5415                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5416                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5417                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5418                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5419                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5420                 </links>
5421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5422                         <actions>
5423                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5424                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5425                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5426                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5427                         </actions>
5428                 </permacrud>
5429         </class>
5430
5431         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5432                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5433                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode"/>
5434                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5435                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5436                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5437                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5438                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5439                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5440                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5441                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5442                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5443                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5444                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5445                 </fields>
5446                 <links>
5447                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5448                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5449                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5450                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5451                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5452                 </links>
5453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5454                         <actions>
5455                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field="owner"/>
5456                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field="owner"/>
5457                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field="owner"/>
5458                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field="owner"/>
5459                         </actions>
5460                 </permacrud>
5461         </class>
5462         
5463         <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">
5464                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5465                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5466                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5467                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5468                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link" oils_obj:required="true"/>
5469                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5470                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5471                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5472                 </fields>
5473                 <links>
5474                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5475                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5476                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5477                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5478                 </links>
5479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5480                         <actions>
5481                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5482                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5483                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5484                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5485                         </actions>
5486                 </permacrud>
5487         </class>
5488         
5489         <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">
5490                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5491                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value"/>
5492                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5493                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5494                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5495                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5496                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5497                 </fields>
5498                 <links>
5499                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5500                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5501                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5502                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5503                 </links>
5504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5505                         <actions>
5506                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5507                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5508                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5509                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5510                         </actions>
5511                 </permacrud>
5512         </class>
5513         
5514         <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">
5515                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5516                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5517                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5518                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5519                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5520                 </fields>
5521                 <links>
5522                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5523                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5524                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5525                 </links>
5526                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5527                         <actions>
5528                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5529                                         <context link="resource" field="owner"/>
5530                                 </create>
5531                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5532                                         <context link="resource" field="owner"/>
5533                                 </retrieve>
5534                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5535                                         <context link="resource" field="owner"/>
5536                                 </update>
5537                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5538                                         <context link="resource" field="owner"/>
5539                                 </delete>
5540                         </actions>
5541                 </permacrud>
5542         </class>
5543         
5544         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5545                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5546                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
5547                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
5548                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5549                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5550                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5551                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5552                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5553                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5554                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5555                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5556                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5557                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5558                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5559                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5560                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5561                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5562                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5563                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5564                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5565                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5566                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5567                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link" oils_obj:required="true"/>
5568                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5569                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5570                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link" oils_obj:required="true"/>
5571                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5572                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5573                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5574                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5575                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5576                 </fields>
5577                 <links>
5578                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5579                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5580                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5581                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5582                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5583                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5584                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5585                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5586                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5587                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5588                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5589                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5590                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5591                 </links>
5592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5593                         <actions>
5594                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5595                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5596                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5597                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5598                         </actions>
5599                 </permacrud>
5600         </class>
5601         
5602         <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">
5603                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5604                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5605                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link" oils_obj:required="true"/>
5606                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link" oils_obj:required="true"/>
5607                 </fields>
5608                 <links>
5609                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5610                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5611                 </links>
5612                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5613                         <actions>
5614                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5615                                         <context link="reservation" field="pickup_lib"/>
5616                                 </create>
5617                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5618                                         <context link="reservation" field="pickup_lib"/>
5619                                 </retrieve>
5620                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5621                                         <context link="reservation" field="pickup_lib"/>
5622                                 </update>
5623                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5624                                         <context link="reservation" field="pickup_lib"/>
5625                                 </delete>
5626                         </actions>
5627                 </permacrud>
5628         </class>
5629
5630         <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">
5631                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5632                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
5633                         <field name="id" reporter:datatype="id"/>
5634                         <field name="target_call_number" reporter:datatype="link" oils_obj:required="true"/>
5635                         <field name="create_time" reporter:datatype="timestamp"/>
5636                         <field name="pos" reporter:datatype="int"/>
5637                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5638                 </fields>
5639                 <links>
5640                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5641                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5642                         <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5643                 </links>
5644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5645                         <actions>
5646                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5647                                         <context link="bucket" field="owning_lib"/>
5648                                 </retrieve>
5649                         </actions>
5650                 </permacrud>
5651         </class>
5652         <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">
5653                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5654                         <field name="id" reporter:datatype="id"/>
5655                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
5656                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
5657                 </fields>
5658                 <links>
5659                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5660                 </links>
5661         </class>
5662         <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">
5663                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5664                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5665                         <field name="btype" reporter:datatype="text"/>
5666                         <field name="id" reporter:datatype="id" reporter:selector="id"/>
5667                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
5668                         <field name="description" reporter:datatype="text"/>
5669                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
5670                         <field name="pub" reporter:datatype="bool"/>
5671                         <field name="create_time" reporter:datatype="timestamp"/>
5672                         <field name="owning_lib" reporter:datatype="org_unit"/>
5673                 </fields>
5674                 <links>
5675                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5676                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5677                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5678                 </links>
5679                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5680                         <actions>
5681                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5682                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5683                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5684                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5685                         </actions>
5686                 </permacrud>
5687         </class>
5688         <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">
5689                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5690                         <field name="id" reporter:datatype="id"/>
5691                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
5692                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
5693                 </fields>
5694                 <links>
5695                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5696                 </links>
5697         </class>
5698         <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">
5699                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5700                         <field name="hold" reporter:datatype="link" oils_obj:required="true"/>
5701                         <field name="id" reporter:datatype="id"/>
5702                         <field name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5703                         <field name="proximity" reporter:datatype="number"/>
5704                 </fields>
5705                 <links>
5706                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5707                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5708                 </links>
5709         </class>
5710         <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">
5711                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5712                         <field reporter:label="Hold" name="hold" reporter:datatype="link" oils_obj:required="true"/>
5713                         <field reporter:label="Notification ID" name="id" reporter:datatype="id"/>
5714                         <field reporter:label="Notification Method" name="method" reporter:datatype="text" oils_obj:required="true"/>
5715                         <field reporter:label="Notification Note" name="note" reporter:datatype="text"/>
5716                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5717                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5718                 </fields>
5719                 <links>
5720                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5721                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5722                 </links>
5723                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5724                         <actions>
5725                                 <create permission="CREATE_HOLD_NOTIFICATION">
5726                                         <context link="hold" jump="usr" field="home_ou"/>
5727                                 </create>
5728                                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5729                                         <context link="hold" jump="usr" field="home_ou"/>
5730                                 </retrieve>
5731                                 <update permission="CREATE_HOLD_NOTIFICATION">
5732                                         <context link="hold" jump="usr" field="home_ou"/>
5733                                 </update>
5734                                 <delete permission="CREATE_HOLD_NOTIFICATION">
5735                                         <context link="hold" jump="usr" field="home_ou"/>
5736                                 </delete>
5737                         </actions>
5738                 </permacrud>
5739         </class>
5740         <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">
5741                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5742                         <field reporter:label="Can Circulate?" name="circulate" reporter:datatype="bool"/>
5743                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5744                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5745                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5746                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
5747                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5748                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5749                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5750                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5751                         <field reporter:label="Label Prefix" name="label_prefix" reporter:datatype="text" oils_persist:i18n="true"/>
5752                         <field reporter:label="Label Suffix" name="label_suffix" reporter:datatype="text" oils_persist:i18n="true"/>
5753                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool"/>
5754                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
5755                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
5756                 </fields>
5757                 <links>
5758                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5759                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5760                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5761                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5762                 </links>
5763                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5764                         <actions>
5765                                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5766                                 <retrieve/>
5767                                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5768                                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5769                         </actions>
5770                 </permacrud>
5771         </class>
5772         <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">
5773                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5774                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5775                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
5776                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5777                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5778                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5779                         <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5780                         <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5781                 </fields>
5782                 <links>
5783                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5784                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5785                 </links>
5786                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5787                         <actions>
5788                                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5789                                 <retrieve/>
5790                                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5791                                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5792                         </actions>
5793                 </permacrud>
5794         </class>
5795         <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">
5796                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5797                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5798                         <field reporter:label="Group" name="lgroup" reporter:datatype="link" oils_obj:required="true"/>
5799                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" oils_obj:required="true"/>
5800                 </fields>
5801                 <links>
5802                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5803                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5804                 </links>
5805                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5806                         <actions>
5807                                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5808                                         <context link="lgroup" field="owner"/>
5809                                 </create>
5810                                 <retrieve/>
5811                                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5812                                         <context link="lgroup" field="owner"/>
5813                                 </update>
5814                                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5815                                         <context link="lgroup" field="owner"/>
5816                                 </delete>
5817                         </actions>
5818                 </permacrud>
5819         </class>
5820
5821         <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">
5822                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5823                         <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5824                         <field reporter:label="Location ID" name="location" reporter:datatype="link" oils_obj:required="true"/>
5825                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
5826                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
5827                 </fields>
5828                 <links>
5829                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5830                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5831                 </links>
5832                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5833                         <actions>
5834                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5835                                 <retrieve/>
5836                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5837                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5838                         </actions>
5839                 </permacrud>
5840         </class>
5841
5842         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5843                 <fields>
5844                         <field name="sre_id" oils_persist:virtual="true"/>
5845                         <field name="location" oils_persist:virtual="true"/>
5846                         <field name="owning_lib" oils_persist:virtual="true"/>
5847                         <field name="basic_holdings" oils_persist:virtual="true"/>
5848                         <field name="basic_holdings_add" oils_persist:virtual="true"/>
5849                         <field name="supplement_holdings" oils_persist:virtual="true"/>
5850                         <field name="supplement_holdings_add" oils_persist:virtual="true"/>
5851                         <field name="index_holdings" oils_persist:virtual="true"/>
5852                         <field name="index_holdings_add" oils_persist:virtual="true"/>
5853                         <field name="online" oils_persist:virtual="true"/>
5854                         <field name="missing" oils_persist:virtual="true"/>
5855                         <field name="incomplete" oils_persist:virtual="true"/>
5856                 </fields>
5857         </class>
5858
5859         <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">
5860                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5861                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5862                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5863                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5864                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5865                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5866                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5867                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5868                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5869                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text" oils_obj:required="true"/>
5870                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5871                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5872                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5873                 </fields>
5874                 <links>
5875                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5876                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5877                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5878                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5879                 </links>
5880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5881                         <actions>
5882                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5883                                 <retrieve/>
5884                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5885                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5886                         </actions>
5887                 </permacrud>
5888         </class>
5889
5890         <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">
5891                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5892                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5893                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
5894                         <field reporter:label="Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
5895                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5896                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5897                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5898                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5899                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
5900                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5901                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5902                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5903                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5904                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5905                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5906                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5907                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5908                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5909                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5910                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5911                 </fields>
5912                 <links>
5913                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5914                 </links>
5915                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5916                         <actions>
5917                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5918                                         <context link="subscription" field="owning_lib"/>
5919                                 </create>
5920                                 <retrieve/>
5921                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5922                                         <context link="subscription" field="owning_lib"/>
5923                                 </update>
5924                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5925                                         <context link="subscription" field="owning_lib"/>
5926                                 </delete>
5927                         </actions>
5928                 </permacrud>
5929         </class>
5930
5931         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5932                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5933                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5934                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5935                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp" oils_obj:required="true"/>
5936                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5937                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5938                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5939                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5940                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5941                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5942                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5943                 </fields>
5944                 <links>
5945                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5946                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5947                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5948                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5949                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5950                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5951                 </links>
5952                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5953                         <actions>
5954                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5955                                 <retrieve/>
5956                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5957                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5958                         </actions>
5959                 </permacrud>
5960         </class>
5961
5962         <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">
5963                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5964                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5965                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
5966                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
5967                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5968                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5969                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5970                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
5971                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
5972                 </fields>
5973                 <links>
5974                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5975                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5976                 </links>
5977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5978                         <actions>
5979                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5980                                         <context link="subscription" field="owning_lib"/>
5981                                 </create>
5982                                 <retrieve/>
5983                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5984                                         <context link="subscription" field="owning_lib"/>
5985                                 </update>
5986                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5987                                         <context link="subscription" field="owning_lib"/>
5988                                 </delete>
5989                         </actions>
5990                 </permacrud>
5991         </class>
5992
5993         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
5994                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
5995                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5996                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
5997                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
5998                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
5999                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6000                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
6001                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6002                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6003                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6004                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6005                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6006                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6007                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6008                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6009                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6010                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6011                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6012                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6013                 </fields>
6014                 <links>
6015                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6016                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6017                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6018                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6019                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6020                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6021                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6022                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6023                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6024                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6025                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6026                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6027                 </links>
6028                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6029                         <actions>
6030                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib"/>
6031                                 <retrieve/>
6032                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib"/>
6033                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib"/>
6034                         </actions>
6035                 </permacrud>
6036         </class>
6037
6038         <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">
6039                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6040                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6041                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6042                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6043                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6044                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6045                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6046                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
6047                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
6048                 </fields>
6049                 <links>
6050                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6051                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6052                 </links>
6053                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6054                         <actions>
6055                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6056                                         <context link="distribution" field="holding_lib"/>
6057                                 </create>
6058                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6059                                         <context link="distribution" field="holding_lib"/>
6060                                 </retrieve>
6061                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6062                                         <context link="distribution" field="holding_lib"/>
6063                                 </update>
6064                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6065                                         <context link="distribution" field="holding_lib"/>
6066                                 </delete>
6067                         </actions>
6068                 </permacrud>
6069         </class>
6070
6071         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6072                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6073                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6074                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6075                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6076                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6077                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6078                 </fields>
6079                 <links>
6080                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6081                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6082                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6083                 </links>
6084                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6085                         <actions>
6086                                 <create permission="ADMIN_SERIAL_STREAM">
6087                                         <context link="distribution" field="holding_lib"/>
6088                                 </create>
6089                                 <retrieve/>
6090                                 <update permission="ADMIN_SERIAL_STREAM">
6091                                         <context link="distribution" field="holding_lib"/>
6092                                 </update>
6093                                 <delete permission="ADMIN_SERIAL_STREAM">
6094                                         <context link="distribution" field="holding_lib"/>
6095                                 </delete>
6096                         </actions>
6097                 </permacrud>
6098         </class>
6099
6100         <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">
6101                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6102                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6103                         <field reporter:label="Stream" name="stream" reporter:datatype="link" oils_obj:required="true"/>
6104                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6105                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6106                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6107                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6108                 </fields>
6109                 <links>
6110                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6111                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6112                 </links>
6113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6114                         <actions>
6115                                 <create permission="ADMIN_SERIAL_STREAM">
6116                                         <context link="stream" jump="distribution" field="holding_lib"/>
6117                                 </create>
6118                                 <retrieve permission="RECEIVE_SERIAL">
6119                                         <context link="stream" jump="distribution" field="holding_lib"/>
6120                                 </retrieve>
6121                                 <update permission="ADMIN_SERIAL_STREAM">
6122                                         <context link="stream" jump="distribution" field="holding_lib"/>
6123                                 </update>
6124                                 <delete permission="ADMIN_SERIAL_STREAM">
6125                                         <context link="stream" jump="distribution" field="holding_lib"/>
6126                                 </delete>
6127                         </actions>
6128                 </permacrud>
6129         </class>
6130
6131         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6132                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6133                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6134                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6135                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
6136                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6137                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6138                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
6139                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6140                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6141                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6142                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6143                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6144                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6145                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6146                 </fields>
6147                 <links>
6148                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6149                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6150                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6151                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6152                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6153                 </links>
6154                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6155                         <actions>
6156                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6157                                         <context link="subscription" field="owning_lib"/>
6158                                 </create>
6159                                 <retrieve/>
6160                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6161                                         <context link="subscription" field="owning_lib"/>
6162                                 </update>
6163                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6164                                         <context link="subscription" field="owning_lib"/>
6165                                 </delete>
6166                         </actions>
6167                 </permacrud>
6168         </class>
6169
6170         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6171                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6172                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6173                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6174                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6175                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
6176                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link" oils_obj:required="true"/>
6177                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6178                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6179                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6180                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6181                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6182                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6183                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6184                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6185                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6186                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6187                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6188                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6189                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6190                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6191                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6192                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
6193                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int" oils_obj:required="true"/>
6194                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool"/>
6195                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int" oils_obj:required="true"/>
6196                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6197                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6198                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6199                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6200                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6201                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6202                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6203                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6204                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6205                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6206                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text" oils_obj:required="true"/>
6207                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text" oils_obj:required="true"/>
6208                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6209                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6210                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6211                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6212                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6213                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6214                 </fields>
6215                 <links>
6216                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6217                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6218                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6219                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6220                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6221                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6222                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6223                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6224                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6225                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6226                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6227                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6228                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6229                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6230                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6231                 </links>
6232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6233                         <actions>
6234                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib"/>
6235                                 <retrieve/>
6236                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib"/>
6237                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib"/>
6238                         </actions>
6239                 </permacrud>
6240         </class>
6241
6242         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6243                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6244                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6245                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6246                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
6247                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6248                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6249                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link" oils_obj:required="true"/>
6250                         <field reporter:label="Stream" name="stream" reporter:datatype="link" oils_obj:required="true"/>
6251                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6252                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6253                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6254                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6255                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6256                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6257                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6258                 </fields>
6259                 <links>
6260                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6261                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6262                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6263                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6264                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6265                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6266                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6267                 </links>
6268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6269                         <actions>
6270                                 <create permission="ADMIN_SERIAL_ITEM">
6271                                         <context link="stream" jump="distribution" field="holding_lib"/>
6272                                 </create>
6273                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6274                                         <context link="stream" jump="distribution" field="holding_lib"/>
6275                                 </retrieve>
6276                                 <update permission="ADMIN_SERIAL_ITEM">
6277                                         <context link="stream" jump="distribution" field="holding_lib"/>
6278                                 </update>
6279                                 <delete permission="ADMIN_SERIAL_ITEM">
6280                                         <context link="stream" jump="distribution" field="holding_lib"/>
6281                                 </delete>
6282                         </actions>
6283                 </permacrud>
6284         </class>
6285
6286         <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">
6287                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6288                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6289                         <field reporter:label="Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
6290                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6291                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6292                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6293                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6294                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
6295                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
6296                 </fields>
6297                 <links>
6298                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6299                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6300                 </links>
6301                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6302                         <actions>
6303                                 <create permission="ADMIN_SERIAL_ITEM">
6304                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6305                                 </create>
6306                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6307                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6308                                 </retrieve>
6309                                 <update permission="ADMIN_SERIAL_ITEM">
6310                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6311                                 </update>
6312                                 <delete permission="ADMIN_SERIAL_ITEM">
6313                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6314                                 </delete>
6315                         </actions>
6316                 </permacrud>
6317         </class>
6318         <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">
6319                 <fields>
6320                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text"/>
6321                         <field name="id" reporter:label="Native ID" reporter:datatype="int"/><!-- not datatype="id", because id is not unique in this view -->
6322                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link"/>
6323                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text"/>
6324                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool"/>
6325                 </fields>
6326                 <links>
6327                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6328                 </links>
6329         </class>
6330         <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">
6331                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6332                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
6333                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link"/>
6334                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text"/>
6335                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text"/>
6336                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text"/>
6337                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text"/>
6338                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$"/>
6339                 </fields>
6340                 <links>
6341                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6342                 </links>
6343         </class>
6344         <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">
6345                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6346                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6347                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6348                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text" oils_obj:required="true"/>
6349                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6350                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6351                 </fields>
6352                 <links>
6353                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6354                 </links>
6355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6356                         <actions>
6357                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6358                                         <context link="distribution" field="holding_lib"/>
6359                                 </create>
6360                                 <retrieve/>
6361                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6362                                         <context link="distribution" field="holding_lib"/>
6363                                 </update>
6364                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6365                                         <context link="distribution" field="holding_lib"/>
6366                                 </delete>
6367                         </actions>
6368                 </permacrud>
6369         </class>
6370
6371         <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">
6372                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6373                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6374                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6375                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text" oils_obj:required="true"/>
6376                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6377                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6378                 </fields>
6379                 <links>
6380                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6381                 </links>
6382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6383                         <actions>
6384                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6385                                         <context link="distribution" field="holding_lib"/>
6386                                 </create>
6387                                 <retrieve/>
6388                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6389                                         <context link="distribution" field="holding_lib"/>
6390                                 </update>
6391                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6392                                         <context link="distribution" field="holding_lib"/>
6393                                 </delete>
6394                         </actions>
6395                 </permacrud>
6396         </class>
6397
6398         <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">
6399                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6400                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6401                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6402                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text" oils_obj:required="true"/>
6403                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6404                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6405                 </fields>
6406                 <links>
6407                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6408                 </links>
6409                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6410                         <actions>
6411                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6412                                         <context link="distribution" field="holding_lib"/>
6413                                 </create>
6414                                 <retrieve/>
6415                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6416                                         <context link="distribution" field="holding_lib"/>
6417                                 </update>
6418                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6419                                         <context link="distribution" field="holding_lib"/>
6420                                 </delete>
6421                         </actions>
6422                 </permacrud>
6423         </class>
6424
6425         <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">
6426                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6427                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6428                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6429                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6430                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6431                         <field reporter:label="Share Depth" name="share_depth" reporter:datatype="int"/>
6432                 </fields>
6433                 <links>
6434                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6435                 </links>
6436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6437                         <actions>
6438                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6439                                 <retrieve/>
6440                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6441                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6442                         </actions>
6443                 </permacrud>
6444         </class>
6445
6446         <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">
6447                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6448                         <field name="id" reporter:datatype="id"/>
6449                         <field name="owning_copy" reporter:datatype="link" oils_obj:required="true"/>
6450                         <field name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
6451                         <field name="stat_cat_entry" reporter:datatype="link" oils_obj:required="true"/>
6452                 </fields>
6453                 <links>
6454                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6455                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6456                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6457                 </links>
6458                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6459                         <actions>
6460                                 <retrieve/>
6461                         </actions>
6462                 </permacrud>
6463         </class>
6464         <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">
6465                 <fields oils_persist:primary="code">
6466                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6467                         <field reporter:label="Item Type" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6468                 </fields>
6469                 <links/>
6470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6471                         <actions>
6472                                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6473                                 <retrieve/>
6474                                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6475                                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6476                         </actions>
6477                 </permacrud>
6478         </class>
6479         <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">
6480                 <fields oils_persist:primary="code">
6481                         <field reporter:label="Bib Level Code" name="code" reporter:datatype="text"/>
6482                         <field reporter:label="Bib Level" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6483                 </fields>
6484                 <links/>
6485                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6486                         <actions>
6487                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6488                                 <retrieve/>
6489                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6490                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6491                         </actions>
6492                 </permacrud>
6493         </class>
6494         <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">
6495                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6496                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6497                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6498                         <field reporter:label="Index Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
6499                         <field reporter:label="Bump Type" name="bump_type" reporter:datatype="text" oils_obj:required="true"/>
6500                         <field reporter:label="Multiplier" name="multiplier" reporter:datatype="number"/>
6501                 </fields>
6502                 <links>
6503                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6504                 </links>
6505                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6506                         <actions>
6507                                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6508                                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6509                                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6510                                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6511                         </actions>
6512                 </permacrud>
6513         </class>
6514         <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">
6515                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6516                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6517                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6518                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6519                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6520                 </fields>
6521                 <links>
6522                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6523                 </links>
6524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6525                         <actions>
6526                                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6527                                 <retrieve/>
6528                                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6529                                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6530                         </actions>
6531                 </permacrud>
6532         </class>
6533         <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">
6534                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6535                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id"/>
6536                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link" oils_obj:required="true"/>
6537                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6538                 </fields>
6539                 <links>
6540                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6541                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6542                 </links>
6543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6544                         <actions>
6545                                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6546                                 <retrieve/>
6547                                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6548                                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6549                         </actions>
6550                 </permacrud>
6551         </class>
6552         <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">
6553                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6554                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
6555                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6556                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6557                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6558                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6559                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6560                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6561                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true"/>
6562                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool"/>
6563                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number"/>
6564                 </fields>
6565                 <links>
6566                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6567                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6568                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6569                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6570                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6571                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6572                 </links>
6573                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6574                         <actions>
6575                                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6576                                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6577                                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6578                                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6579                         </actions>
6580                 </permacrud>
6581         </class>
6582         <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">
6583                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6584                         <field name="id" reporter:datatype="id"/>
6585                         <field name="from_org" reporter:datatype="org_unit"/>
6586                         <field name="to_org" reporter:datatype="org_unit"/>
6587                         <field name="prox" reporter:datatype="int"/>
6588                 </fields>
6589                 <links>
6590                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6591                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6592                 </links>
6593         </class>
6594         <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">
6595                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6596                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6597                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6598                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6599                         <field reporter:label="Total Results" name="total" reporter:datatype="int"/>
6600                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6601                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6602                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6603                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6604                 </fields>
6605                 <links/>
6606         </class>
6607         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6608                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6609                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6610                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6611                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
6612                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6613                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6614                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6615                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6616                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
6617                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6618                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6619                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6620                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6621                 </fields>
6622                 <links>
6623                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6624                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6625                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6626                 </links>
6627                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6628                         <actions>
6629                                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6630                                 <retrieve/>
6631                                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6632                                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6633                         </actions>
6634                 </permacrud>
6635         </class>
6636         <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">
6637                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6638                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true"/>
6639                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6640                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6641                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6642                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
6643                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6644                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6645                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6646                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6647                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6648                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6649                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6650                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6651                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6652                 </fields>
6653                 <links>
6654                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6655                 </links>
6656                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6657                         <actions>
6658                                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6659                                 <retrieve/>
6660                                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6661                                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6662                         </actions>
6663                 </permacrud>
6664         </class>
6665         <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">
6666                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6667                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6668                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
6669                         <field name="query_text" reporter:datatype="text" oils_obj:required="true"/>
6670                 </fields>
6671                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6672                         <actions>
6673                                 <retrieve/>
6674                         </actions>
6675                 </permacrud>
6676         </class>
6677
6678         <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">
6679                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6680                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6681                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6682                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6683                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6684                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6685                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6686                 </fields>
6687                 <links>
6688                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6689                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6690                 </links>
6691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6692                         <actions>
6693                                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6694                                 <retrieve/>
6695                                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6696                                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6697                         </actions>
6698                 </permacrud>
6699         </class>
6700         <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">
6701                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6702                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6703                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6704                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6705                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6706                 </fields>
6707                 <links>
6708                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6709                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6710                 </links>
6711                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6712                         <actions>
6713                                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6714                                         <context link="grp" field="owner"/>
6715                                 </create>
6716                                 <retrieve/>
6717                                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6718                                         <context link="grp" field="owner"/>
6719                                 </update>
6720                                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6721                                         <context link="grp" field="owner"/>
6722                                 </delete>
6723                         </actions>
6724                 </permacrud>
6725         </class>
6726
6727         <!-- A note: Please update alhr and ahopl when updating ahr -->
6728         <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">
6729                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6730                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
6731                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true"/>
6732                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6733                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6734                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6735                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6736                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6737                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
6738                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6739                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6740                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6741                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
6742                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6743                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6744                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6745                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6746                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6747                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6748                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6749                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link" oils_obj:required="true"/>
6750                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
6751                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit" oils_obj:required="true"/>
6752                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link" oils_obj:required="true"/>
6753                         <field reporter:label="Hold User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
6754                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6755                         <field reporter:label="Hold Canceling Staff" name="canceled_by" reporter:datatype="link"/>
6756                         <field reporter:label="Hold Canceling Workstation" name="canceling_ws" reporter:datatype="link"/>
6757                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6758                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int"/>
6759                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6760                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6761                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6762                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6763                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6764                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6765                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
6766                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
6767                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
6768                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6769                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6770                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6771                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6772                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6773                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link"/>
6774                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6775                 </fields>
6776                 <links>
6777                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6778                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6779                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6780                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6781                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6782                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6783                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6784                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6785                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6786                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6787                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6788                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6789                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6790                         <link field="canceled_by" reltype="might_have" key="id" map="" class="au"/>
6791                         <link field="canceling_ws" reltype="might_have" key="id" map="" class="aws"/>
6792                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6793                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6794                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6795                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6796                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6797                 </links>
6798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6799                         <actions>
6800                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
6801                         </actions>
6802                 </permacrud>
6803         </class>
6804         <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">
6805                 <oils_persist:source_definition><![CDATA[
6806                 SELECT DISTINCT
6807                         ahr.*,
6808                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6809                                 copy_location_order_position,
6810                         CASE WHEN au.alias IS NOT NULL THEN
6811                                 au.alias
6812                         ELSE
6813                                 au.first_given_name
6814                         END AS usr_alias_or_first_given_name,
6815                         au.first_given_name AS usr_first_given_name,
6816                         au.second_given_name AS usr_second_given_name,
6817                         au.family_name AS usr_family_name,
6818                         au.prefix AS usr_prefix,
6819                         au.suffix AS usr_suffix,
6820                         au.alias AS usr_alias,
6821                         CASE WHEN au.alias IS NOT NULL THEN
6822                                 au.alias
6823                         ELSE
6824                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6825                                         COALESCE(au.family_name, ''),
6826                                         COALESCE(au.suffix, ''),
6827                                         ', ',
6828                                         COALESCE(au.prefix, ''),
6829                                         COALESCE(au.first_given_name, ''),
6830                                         COALESCE(au.second_given_name, '')
6831                                 ], ' '), E'\\s+,', ',')
6832                         END AS usr_alias_or_display_name,
6833                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6834                                 COALESCE(au.family_name, ''),
6835                                 COALESCE(au.suffix, ''),
6836                                 ', ',
6837                                 COALESCE(au.prefix, ''),
6838                                 COALESCE(au.first_given_name, ''),
6839                                 COALESCE(au.second_given_name, '')
6840                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6841                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6842                                 AS call_number_label,
6843                         siss.label AS issuance_label,
6844                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6845                         ahcm_1.copy_count AS potential_copies
6846                 FROM action.hold_request ahr
6847                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6848                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6849                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6850                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6851                 JOIN actor.usr au ON (au.id = ahr.usr)
6852                 JOIN (
6853                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6854                         FROM asset.copy_location
6855                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6856                 LEFT JOIN actor.usr_standing_penalty ausp 
6857                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6858                 LEFT JOIN config.standing_penalty csp
6859                         ON (
6860                                 csp.id = ausp.standing_penalty AND 
6861                                 csp.block_list LIKE '%CAPTURE%' AND (
6862                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6863                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6864                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6865                                         )
6866                                 )
6867                         )
6868                 JOIN (
6869                         SELECT COUNT(target_copy) AS copy_count, hold
6870                         FROM action.hold_copy_map
6871                         GROUP BY 2
6872                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6873                 LEFT JOIN serial.issuance siss
6874                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6875                 LEFT JOIN asset.copy_location_order acplo
6876                         ON (acp.location = acplo.location AND
6877                                 acp.circ_lib = acplo.org)
6878                 WHERE
6879                         ahr.capture_time IS NULL AND
6880                         ahr.cancel_time IS NULL AND
6881                         csp.id IS NULL AND
6882                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6883                         acp.deleted IS FALSE AND
6884                         acp.status IN (SELECT id FROM config.copy_status WHERE holdable IS TRUE AND is_available IS TRUE)
6885                 ]]></oils_persist:source_definition>
6886                 <fields oils_persist:primary="id">
6887                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
6888                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true"/>
6889                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6890                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6891                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6892                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6893                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6894                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
6895                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6896                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6897                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6898                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
6899                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6900                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6901                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6902                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6903                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6904                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6905                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6906                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6907                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
6908                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6909                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6910                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6911                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6912                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6913                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int"/>
6914                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6915                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6916                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6917                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6918                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6919                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6920                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
6921                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
6922                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
6923                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6924                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6925                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6926                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6927                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link"/>
6928                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int"/>
6929                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text"/>
6930                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text"/>
6931                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text"/>
6932                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text"/>
6933                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text"/>
6934                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text"/>
6935                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text"/>
6936                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text"/>
6937                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text"/>
6938                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
6939                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text"/>
6940                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool"/>
6941                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int"/>
6942                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6943                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6944                 </fields>
6945                 <links>
6946                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6947                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6948                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6949                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6950                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6951                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6952                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6953                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6954                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6955                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6956                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6957                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6958                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6959                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6960                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6961                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6962                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6963                 </links>
6964                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6965                         <actions>
6966                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
6967                         </actions>
6968                 </permacrud>
6969         </class>
6970         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6971                 <oils_persist:source_definition><![CDATA[
6972                         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)
6973                 ]]></oils_persist:source_definition>
6974                 <fields oils_persist:primary="id">
6975                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
6976                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true"/>
6977                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6978                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6979                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6980                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6981                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6982                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
6983                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6984                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6985                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6986                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
6987                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6988                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6989                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6990                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6991                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6992                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6993                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
6994                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6995                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6996                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6997                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6998                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6999                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int"/>
7000                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7001                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7002                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7003                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7004                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7005                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7006                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
7007                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
7008                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
7009                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7010                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7011                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7012                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7013                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7014                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link"/>
7015                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7016                 </fields>
7017                 <links>
7018                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7019                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7020                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7021                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7022                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7023                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7024                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7025                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7026                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7027                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7028                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7029                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7030                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7031                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7032                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7033                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7034                 </links>
7035         </class>
7036
7037         <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">
7038                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7039                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7040                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link" oils_obj:required="true"/>
7041                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
7042                         <field reporter:label="Body" name="body" reporter:datatype="text" oils_obj:required="true"/>
7043                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7044                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7045                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7046                 </fields>
7047                 <links>
7048                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7049                 </links>
7050                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7051                         <actions>
7052                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7053                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7054                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7055                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7056                         </actions>
7057                 </permacrud>
7058         </class>
7059         <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">
7060                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7061                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
7062                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7063                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7064                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7065                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7066                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7067                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
7068                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7069                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7070                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7071                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
7072                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7073                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7074                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7075                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7076                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7077                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7078                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7079                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7080                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7081                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7082                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7083                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
7084                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7085                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7086                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7087                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7088                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7089                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7090                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7091                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
7092                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
7093                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
7094                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7095                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7096                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7097                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7098                 </fields>
7099                 <links>
7100                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7101                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7102                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7103                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7104                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7105                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7106                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7107                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7108                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7109                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7110                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7111                 </links>
7112                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7113                         <actions>
7114                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
7115                         </actions>
7116                 </permacrud>
7117         </class>
7118         <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">
7119                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7120                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
7121                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7122                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7123                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool" oils_obj:required="true"/>
7124                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7125                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7126                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
7127                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7128                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7129                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7130                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
7131                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool" oils_obj:required="true"/>
7132                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool" oils_obj:required="true"/>
7133                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7134                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7135                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7136                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp" oils_obj:required="true"/>
7137                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7138                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link" oils_obj:required="true"/>
7139                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link" oils_obj:required="true"/>
7140                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7141                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool" oils_obj:required="true"/>
7142                         <field reporter:label="Item Selection Depth" name="selection_depth" oils_obj:required="true"/>
7143                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit" oils_obj:required="true"/>
7144                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link" oils_obj:required="true"/>
7145                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7146                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7147                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool" oils_obj:required="true"/>
7148                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7149                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7150                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
7151                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
7152                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
7153                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" oils_obj:required="true"/>
7154                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7155                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7156                 </fields>
7157                 <links>
7158                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7159                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7160                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7161                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7162                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7163                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7164                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7165                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7166                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7167                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7168                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7169                 </links>
7170                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7171                         <actions>
7172                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
7173                         </actions>
7174                 </permacrud>
7175         </class>
7176
7177         <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">
7178                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7179                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7180                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7181                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7182                         <!-- @reporter:datatype="org_unit" is correct for the "id" field, and necessary for the reporter as implied by
7183                                  the XML namespace of the attr. Instead, @name == parent::fields/@oils_persist:primary is the proper test
7184                                  for "this field is the identifier column" -->
7185                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7186                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7187                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7188                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7189                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7190                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7191                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7192                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7193                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7194                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7195                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7196                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7197                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7198                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7199                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7200                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7207                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7208                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7209                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7210                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7211                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7212                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7213                 </fields>
7214                 <links>
7215                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7216                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7217                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7218                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7219                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7220                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7221                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7222                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7223                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7224                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7225                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7226                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7227                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7228                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7229                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7230                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7231                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7232                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7233                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7234                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7235                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7236                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7237                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7238                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7239                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7240                 </links>
7241                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7242                         <actions>
7243                                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7244                                 <retrieve/>
7245                                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7246                                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7247                         </actions>
7248                 </permacrud>
7249         </class>
7250         <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">
7251                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7252                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7253                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7254                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7255                 </fields>
7256                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7257                         <actions>
7258                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7259                                 <retrieve/>
7260                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7261                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7262                         </actions>
7263                 </permacrud>
7264         </class>
7265         <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">
7266                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7267                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7268                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7269                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
7270                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7271                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7272                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true"/>
7273                 </fields>
7274                 <links>
7275                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7276                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7277                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7278                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7279                 </links>
7280                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7281                         <actions>
7282                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7283                                 <retrieve/>
7284                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7285                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7286                         </actions>
7287                 </permacrud>
7288         </class>
7289         <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">
7290                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7291                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7292                         <field name="btype" reporter:datatype="text"/>
7293                         <field name="id" reporter:datatype="id"/>
7294                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7295                         <field name="description" reporter:datatype="text"/>
7296                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
7297                         <field name="pub" reporter:datatype="bool"/>
7298                         <field name="create_time" reporter:datatype="timestamp"/>
7299                         <field name="owning_lib" reporter:datatype="org_unit"/>
7300                 </fields>
7301                 <links>
7302                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7303                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7304                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7305                 </links>
7306                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7307                         <actions>
7308                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7309                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7310                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7311                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7312                         </actions>
7313                 </permacrud>
7314         </class>
7315         <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">
7316                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7317                         <field name="id" reporter:datatype="id"/>
7318                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7319                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7320                 </fields>
7321                 <links>
7322                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7323                 </links>
7324         </class>
7325         <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">
7326                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7327                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7328                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7329                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7330                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7331                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
7332                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7333                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7334                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7335                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7336                 </fields>
7337                 <links>
7338                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7339                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7340                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7341                 </links>
7342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7343                         <actions>
7344                                 <create permission="CREATE_COPY_STAT_CAT" context_field="owner"/>
7345                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7346                                 <update permission="UPDATE_COPY_STAT_CAT" context_field="owner"/>
7347                                 <delete permission="DELETE_COPY_STAT_CAT" context_field="owner"/>
7348                         </actions>
7349                 </permacrud>
7350         </class>
7351         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7352                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7353                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7354                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
7355                         <field reporter:label="Card ID" name="id" reporter:datatype="id"/>
7356                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7357                 </fields>
7358                 <links>
7359                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7360                 </links>
7361                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7362                         <actions>
7363                                 <retrieve permission="VIEW_USER user_request.view">
7364                                         <context link="usr" field="home_ou"/>
7365                                 </retrieve>
7366                         </actions>
7367                 </permacrud>
7368         </class>
7369         <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">
7370                 <fields oils_persist:primary="field">
7371                         <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name" oils_obj:required="true"/>
7372                         <field reporter:label="Field Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
7373                         <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7374                 </fields>
7375                 <links/>
7376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7377                         <actions>
7378                                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7379                                 <retrieve/>
7380                                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7381                                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7382                         </actions>
7383                 </permacrud>
7384         </class>
7385         <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">
7386                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7387                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7388                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7389                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7390                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7391                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7392                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
7393                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7394                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7395                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7396                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7397                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7398                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7399                 </fields>
7400                 <links>
7401                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7402                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7403                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7404                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7405                 </links>
7406                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7407                         <actions>
7408                                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7409                                 <retrieve/>
7410                                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7411                                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7412                         </actions>
7413                 </permacrud>
7414         </class>
7415         <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">
7416                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7417                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
7418                         <field name="id" reporter:datatype="id"/>
7419                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
7420                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
7421                 </fields>
7422                 <links>
7423                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7424                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7425                 </links>
7426         </class>
7427         <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">
7428                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7429                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7430                         <field name="btype" reporter:datatype="text"/>
7431                         <field name="id" reporter:datatype="id"/>
7432                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7433                         <field name="description" reporter:datatype="text"/>
7434                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
7435                         <field name="pub" reporter:datatype="bool"/>
7436                         <field name="create_time" reporter:datatype="timestamp"/>
7437                         <field name="owning_lib" reporter:datatype="org_unit"/>
7438                 </fields>
7439                 <links>
7440                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7441                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7442                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7443                 </links>
7444                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7445                         <actions>
7446                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7447                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7448                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7449                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7450                         </actions>
7451                 </permacrud>
7452         </class>
7453         <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">
7454                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7455                         <field name="id" reporter:datatype="id"/>
7456                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7457                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7458                 </fields>
7459                 <links>
7460                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7461                 </links>
7462         </class>
7463         <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">
7464                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7465                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7466                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7467                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7468                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7469                         <field reporter:label="Payment Note" name="note" reporter:datatype="text"/>
7470                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7471                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7472                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7473                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7474                 </fields>
7475                 <links>
7476                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7477                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7478                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7479                 </links>
7480                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7481                         <actions>
7482                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7483                                         <context link="xact" jump="usr" field="home_ou"/>
7484                                 </retrieve>
7485                         </actions>
7486                 </permacrud>
7487         </class>
7488         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7489                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7490                         <field name="id" reporter:datatype="id"/>
7491                         <field name="ind1"/>
7492                         <field name="ind2"/>
7493                         <field name="record" oils_obj:required="true"/>
7494                         <field name="subfield"/>
7495                         <field name="tag" oils_obj:required="true"/>
7496                         <field name="value" oils_obj:required="true"/>
7497                 </fields>
7498                 <links>
7499                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7500                 </links>
7501         </class>
7502         <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">
7503                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7504                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
7505                         <field name="source" reporter:label="Source Record" reporter:datatype="link" oils_obj:required="true"/>
7506                         <field name="target" reporter:label="Target Record" reporter:datatype="link" oils_obj:required="true"/>
7507                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" oils_obj:required="true"/>
7508                 </fields>
7509                 <links>
7510                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7511                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7512                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7513                 </links>
7514         </class>
7515         <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">
7516                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7517                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7518                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7519                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7520                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7521                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7522                 </fields>
7523                 <links>
7524                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7525                 </links>
7526                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7527                         <actions>
7528                                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7529                                 <retrieve/>
7530                                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7531                                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7532                         </actions>
7533                 </permacrud>
7534
7535         </class>
7536         <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">
7537                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7538                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7539                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7540                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7541                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" oils_obj:required="true"/>
7542                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7543                         <field reporter:label="Type Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7544                         <field reporter:label="OPAC Label" name="opac_label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7545                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7546                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7547                 </fields>
7548                 <links>
7549                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7550                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7551                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7552                 </links>
7553                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7554                         <actions>
7555                                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7556                                 <retrieve/>
7557                                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7558                                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7559                         </actions>
7560                 </permacrud>
7561         </class>
7562         <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">
7563                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7564                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7565                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7566                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7567                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7568                         <field reporter:label="Note ID" name="id" reporter:datatype="id"/>
7569                         <field reporter:label="Bib Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
7570                         <field reporter:label="Note" name="value" reporter:datatype="text" oils_obj:required="true"/>
7571                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7572                 </fields>
7573                 <links>
7574                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7575                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7576                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7577                 </links>
7578                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7579                                 <actions>
7580                                         <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7581                                         <retrieve/>
7582                                         <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7583                                         <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7584                                 </actions>
7585                          </permacrud>
7586         </class>
7587         <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">
7588                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7589                         <field name="balance_owed" reporter:datatype="money"/>
7590                         <field name="total_owed" reporter:datatype="money"/>
7591                         <field name="total_paid" reporter:datatype="money"/>
7592                         <field name="usr" reporter:datatype="link"/>
7593                 </fields>
7594                 <links>
7595                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7596                 </links>
7597         </class>
7598         <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7599                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7600                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link" oils_obj:required="true"/>
7601                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
7602                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7603                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7604                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp"/>
7605                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp"/>
7606                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7607                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7608                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7609                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7610                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7611                 </fields>
7612                 <links>
7613                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7614                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7615                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7616                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7617                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7618                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7619                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7620                 </links>
7621                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7622                         <actions>
7623                                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7624                         </actions>
7625                 </permacrud>
7626         </class>
7627         <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">
7628                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7629                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7630                         <field name="quality" reporter:datatype="int"/>
7631                         <field name="source" reporter:datatype="text" oils_obj:required="true"/>
7632                         <field name="transcendant" reporter:datatype="bool"/>
7633                         <field name="can_have_copies" reporter:datatype="bool"/>
7634                 </fields>
7635                 <links/>
7636                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7637                         <actions>
7638                                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7639                                 <retrieve/>
7640                                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7641                                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7642                         </actions>
7643                 </permacrud>
7644         </class>
7645         <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">
7646                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7647                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
7648                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7649                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7650                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7651                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7652                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7653                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7654                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7655                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7656                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7657                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7658                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7659                 </fields>
7660                 <links>
7661                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7662                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7663                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7664                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7665                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7666                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7667                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7668                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7669                 </links>
7670                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7671                         <actions>
7672                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7673                                         <context link="usr" field="home_ou"/>
7674                                 </retrieve>
7675                         </actions>
7676                 </permacrud>
7677         </class>
7678         <class id="actsce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7679                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7680                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
7681                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
7682                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
7683                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
7684                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7685                 </fields>
7686                 <links>
7687                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7688                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7689                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7690                 </links>
7691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7692                         <actions>
7693                                 <create permission="CREATE_PATRON_STAT_CAT_ENTRY">
7694                                         <context link="stat_cat" field="owner"/>
7695                                 </create>
7696                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7697                                 <update permission="UPDATE_PATRON_STAT_CAT_ENTRY">
7698                                         <context link="stat_cat" field="owner"/>
7699                                 </update>
7700                                 <delete permission="DELETE_PATRON_STAT_CAT_ENTRY">
7701                                         <context link="stat_cat" field="owner"/>
7702                                 </delete>
7703                         </actions>
7704                 </permacrud>
7705         </class>
7706         <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">
7707                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7708                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id"/>
7709                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link" oils_obj:required="true"/>
7710                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
7711                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
7712                 </fields>
7713                 <links>
7714                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7715                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7716                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7717                 </links>
7718         </class>
7719         <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">
7720                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7721                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7722                         <field name="id" reporter:datatype="id"/>
7723                         <field name="target_user" reporter:datatype="link" oils_obj:required="true"/>
7724                         <field name="create_time" reporter:datatype="timestamp"/>
7725                         <field name="pos" reporter:datatype="int"/>
7726                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
7727                 </fields>
7728                 <links>
7729                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7730                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7731                         <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7732                 </links>
7733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7734                         <actions>
7735                                 <retrieve permission="ADMIN_USER_BUCKET">
7736                                         <context link="bucket" field="owning_lib"/>
7737                                 </retrieve>
7738                         </actions>
7739                 </permacrud>
7740         </class>
7741         <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">
7742                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7743                         <field name="id" reporter:datatype="id"/>
7744                         <field name="staff" reporter:datatype="link" oils_obj:required="true"/>
7745                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7746                         <field name="target" reporter:datatype="int" oils_obj:required="true"/>
7747                         <field name="hold_type" reporter:datatype="text"/>
7748                         <field name="run_date" reporter:datatype="timestamp"/>
7749                         <field name="cancelled" reporter:datatype="timestamp"/>
7750                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link"/>
7751                 </fields>
7752                 <links>
7753                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7754                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7755                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7756                 </links>
7757                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7758                         <actions>
7759                                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7760                                 <retrieve/>
7761                                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7762                                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7763                         </actions>
7764                 </permacrud>
7765         </class>
7766         <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">
7767                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7768                         <field name="id" reporter:datatype="id"/>
7769                         <field name="batch_hold_event" reporter:datatype="link" oils_obj:required="true"/>
7770                         <field name="hold" reporter:datatype="link" oils_obj:required="true"/>
7771                 </fields>
7772                 <links>
7773                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7774                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7775                 </links>
7776                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7777                         <actions>
7778                                 <retrieve/>
7779                         </actions>
7780                 </permacrud>
7781         </class>
7782         <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">
7783                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7784                         <field name="id" reporter:datatype="id"/>
7785                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
7786                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7787                 </fields>
7788                 <links>
7789                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7790                 </links>
7791         </class>
7792         <class id="mus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7793                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7794                         <field name="balance_owed" reporter:datatype="money"/>
7795                         <field name="total_owed" reporter:datatype="money"/>
7796                         <field name="total_paid" reporter:datatype="money"/>
7797                         <field name="usr" reporter:datatype="link"/>
7798                 </fields>
7799                 <links>
7800                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7801                 </links>
7802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7803                         <actions>
7804                                 <retrieve permission="VIEW_USER">
7805                                         <context link="usr" field="home_ou"/>
7806                                 </retrieve>
7807                         </actions>
7808                 </permacrud>
7809         </class>
7810         <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">
7811                 <fields oils_persist:primary="code" oils_persist:sequence="">
7812                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7813                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7814                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7815                 </fields>
7816                 <links/>
7817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7818                         <actions>
7819                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7820                                 <retrieve/>
7821                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7822                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7823                         </actions>
7824                 </permacrud>
7825         </class>
7826         <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">
7827                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7828                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7829                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7830                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7831                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7832                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7833                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7834                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7835                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7836                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7837                 </fields>
7838                 <links>
7839                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7840                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7841                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7842                 </links>
7843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7844                         <actions>
7845                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7846                                         <context link="xact" jump="usr" field="home_ou"/>
7847                                 </retrieve>
7848                         </actions>
7849                 </permacrud>
7850         </class>
7851         <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">
7852                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7853                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7854                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7855                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7856                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7857                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7858                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7859                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7860                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7861                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7862                 </fields>
7863                 <links>
7864                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7865                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7866                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7867                 </links>
7868                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7869                         <actions>
7870                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7871                                         <context link="xact" jump="usr" field="home_ou"/>
7872                                 </retrieve>
7873                         </actions>
7874                 </permacrud>
7875         </class>
7876         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7877                 <fields oils_persist:primary="id" oils_persist:sequence="">
7878                         <field name="checkin_lib" reporter:datatype="link"/>
7879                         <field name="checkin_staff" reporter:datatype="link"/>
7880                         <field name="checkin_time" reporter:datatype="timestamp"/>
7881                         <field name="circ_lib" reporter:datatype="org_unit"/>
7882                         <field name="circ_staff" reporter:datatype="link"/>
7883                         <field name="desk_renewal" reporter:datatype="bool"/>
7884                         <field name="due_date" reporter:datatype="timestamp"/>
7885                         <field name="duration" reporter:datatype="interval"/>
7886                         <field name="duration_rule" reporter:datatype="link"/>
7887                         <field name="fine_interval" reporter:datatype="interval"/>
7888                         <field name="id" reporter:datatype="id"/>
7889                         <field name="max_fine" reporter:datatype="money"/>
7890                         <field name="max_fine_rule" reporter:datatype="link"/>
7891                         <field name="opac_renewal" reporter:datatype="bool"/>
7892                         <field name="phone_renewal" reporter:datatype="bool"/>
7893                         <field name="recurring_fine" reporter:datatype="money"/>
7894                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7895                         <field name="renewal_remaining" reporter:datatype="int"/>
7896                         <field name="grace_period" reporter:datatype="interval"/>
7897                         <field name="stop_fines" reporter:datatype="text"/>
7898                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7899                         <field name="target_copy" reporter:datatype="link"/>
7900                         <field name="usr" reporter:datatype="link"/>
7901                         <field name="xact_finish" reporter:datatype="timestamp"/>
7902                         <field name="xact_start" reporter:datatype="timestamp"/>
7903                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7904                         <field name="auto_renewal" reporter:datatype="bool"/>
7905                         <field name="auto_renewal_remaining" reporter:datatype="int"/>
7906                 </fields>
7907                 <links>
7908                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7909                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7910                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7911                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7912                 </links>
7913         </class>
7914         <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">
7915                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7916                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
7917                         <field name="id" reporter:datatype="id"/>
7918                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
7919                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
7920                 </fields>
7921                 <links>
7922                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7923                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7924                 </links>
7925         </class>
7926         <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">
7927                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7928                         <field name="high" reporter:datatype="money" oils_obj:required="true"/>
7929                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7930                         <field name="low" reporter:datatype="money" oils_obj:required="true"/>
7931                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7932                         <field name="normal" reporter:datatype="money" oils_obj:required="true"/>
7933                         <field name="recurrence_interval" reporter:datatype="interval"/>
7934                         <field name="grace_period" reporter:datatype="interval"/>
7935                 </fields>
7936                 <links/>
7937                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7938                         <actions>
7939                                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7940                                 <retrieve/>
7941                                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7942                                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7943                         </actions>
7944                 </permacrud>
7945         </class>
7946         <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">
7947                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7948                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7949                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7950                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7951                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7952                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" oils_obj:required="true"/>
7953                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7954                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7955                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7956                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7957                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7958                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7959                 </fields>
7960                 <links>
7961                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7962                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7963                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7964                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7965                 </links>
7966                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7967                         <actions>
7968                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7969                                         <context link="xact" jump="usr" field="home_ou"/>
7970                                 </retrieve>
7971                         </actions>
7972                 </permacrud>
7973         </class>
7974         <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">
7975                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7976                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7977                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7978                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7979                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7980                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7981                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7982                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7983                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7984                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7985                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7986                 </fields>
7987                 <links>
7988                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7989                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7990                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7991                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7992                 </links>
7993                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7994                         <actions>
7995                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7996                                         <context link="xact" jump="usr" field="home_ou"/>
7997                                 </retrieve>
7998                         </actions>
7999                 </permacrud>
8000         </class>
8001         <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">
8002                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8003                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8004                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8005                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
8006                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link" oils_obj:required="true"/>
8007                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8008                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8009                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8010                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8011                         <field reporter:label="Item Number on Volume" name="copy_number" reporter:datatype="text"/>
8012                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8013                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8014                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
8015                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8016                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8017                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8018                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8019                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8020                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8021                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8022                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
8023                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int" oils_obj:required="true"/>
8024                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool"/>
8025                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8026                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int" oils_obj:required="true"/>
8027                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8028                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
8029                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8030                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8031                         <field reporter:label="Item Status" name="status" reporter:datatype="link"/>
8032                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8033                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8034                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8035                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8036                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8037                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8038                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8039                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8040                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8041                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8042                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8043                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8044                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8045                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8046                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8047                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8048                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8049                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8050                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8051                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8052                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8053                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8054                 </fields>
8055                 <links>
8056                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8057                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8058                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8059                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8060                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8061                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8062                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8063                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8064                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8065                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8066                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8067                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8068                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8069                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8070                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8071                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8072                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8073                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8074                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8075                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8076                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8077                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8078                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8079                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8080                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8081                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8082                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8083                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8084                 </links>
8085                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8086                         <actions>
8087                                 <create permission="CREATE_COPY">
8088                                         <context link="call_number" field="owning_lib"/>
8089                                 </create>
8090                                 <retrieve/>
8091                                 <update permission="UPDATE_COPY">
8092                                         <context link="call_number" field="owning_lib"/>
8093                                 </update>
8094                                 <delete permission="DELETE_COPY">
8095                                         <context link="call_number" field="owning_lib"/>
8096                                 </delete>
8097                         </actions>
8098                 </permacrud>
8099         </class>
8100
8101         <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">
8102                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8103                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8104                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8105                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8106                         <field reporter:label="Copy" name="copy" reporter:datatype="link" oils_obj:required="true"/>
8107                 </fields>
8108                 <links>
8109                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8110                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8111                 </links>
8112                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8113                         <actions>
8114                                 <create permission="STAFF_LOGIN"/>
8115                                 <retrieve/>
8116                                 <update permission="STAFF_LOGIN"/>
8117                                 <delete permission="STAFF_LOGIN"/>
8118                         </actions>
8119                 </permacrud>
8120         </class>
8121
8122         <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">
8123                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8124                         <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8125                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8126                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8127                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8128                 </fields>
8129                 <links>
8130                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8131                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8132                 </links>
8133                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8134                         <actions>
8135                                 <retrieve/>
8136                         </actions>
8137                 </permacrud>
8138         </class>
8139
8140         <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">
8141                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8142                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8143                         <field reporter:label="Scope Org Unit" name="scope_org" reporter:datatype="org_unit" oils_obj:required="true"/>
8144                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
8145                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8146                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8147                         <field reporter:label="Event" name="event" reporter:datatype="text"/>
8148                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool"/>
8149                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8150                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8151                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8152                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8153                 </fields>
8154                 <links>
8155                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8156                 </links>
8157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8158                         <actions>
8159                                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8160                                 <retrieve/>
8161                                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8162                                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8163                         </actions>
8164                 </permacrud>
8165         </class>
8166
8167         <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">
8168                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8169                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8170                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
8171                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" oils_obj:required="true"/>
8172                 </fields>
8173                 <links>
8174                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8175                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8176                 </links>
8177                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8178                         <actions>
8179                                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8180                                 <retrieve/>
8181                                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8182                                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8183                         </actions>
8184                 </permacrud>
8185         </class>
8186
8187         <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">
8188                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8189                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8190                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" oils_obj:required="true"/>
8191                         <field reporter:label="Copy" name="copy" reporter:datatype="link" oils_obj:required="true"/>
8192                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool"/>
8193                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
8194                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link" oils_obj:required="true"/>
8195                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8196                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp"/>
8197                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8198                 </fields>
8199                 <links>
8200                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8201                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8202                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8203                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8204                 </links>
8205                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8206                         <actions>
8207                                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8208                                         <context link="copy" field="circ_lib"/>
8209                                 </create>
8210                                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8211                                         <context link="copy" field="circ_lib"/>
8212                                 </retrieve>
8213                                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8214                                         <context link="copy" field="circ_lib"/>
8215                                 </update>
8216                                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8217                                         <context link="copy" field="circ_lib"/>
8218                                 </delete>
8219                         </actions>
8220                 </permacrud>
8221         </class>
8222
8223         <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">
8224                 <fields oils_persist:primary="id">
8225                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8226                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link"/>
8227                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8228                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool"/>
8229                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
8230                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8231                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8232                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp"/>
8233                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8234                 </fields>
8235                 <links>
8236                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8237                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8238                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8239                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8240                 </links>
8241                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8242                         <actions>
8243                                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8244                                         <context link="copy" field="circ_lib"/>
8245                                 </create>
8246                                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8247                                         <context link="copy" field="circ_lib"/>
8248                                 </retrieve>
8249                                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8250                                         <context link="copy" field="circ_lib"/>
8251                                 </update>
8252                                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8253                                         <context link="copy" field="circ_lib"/>
8254                                 </delete>
8255                         </actions>
8256                 </permacrud>
8257         </class>
8258
8259         <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">
8260                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8261                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
8262                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8263                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
8264                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
8265                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8266                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8267                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8268                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8269                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8270                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8271                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8272                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8273                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8274                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8275                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8276                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8277                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8278                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8279                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8280                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8281                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8282                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8283                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8284                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8285                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8286                 </fields>
8287                 <links>
8288                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8289                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8290                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8291                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8292                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8293                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8294                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8295                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8296                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8297                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8298                 </links>
8299                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8300                         <actions>
8301                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8302                                 <retrieve/>
8303                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8304                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8305                         </actions>
8306                 </permacrud>
8307         </class>
8308
8309         <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">
8310                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8311                         <field reporter:label="Item Age" name="age" reporter:datatype="interval" oils_obj:required="true"/>
8312                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8313                         <field reporter:label="Rule Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8314                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" oils_obj:required="true"/>
8315                 </fields>
8316                 <links/>
8317                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8318                         <actions>
8319                                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8320                                 <retrieve/>
8321                                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8322                                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8323                         </actions>
8324                 </permacrud>
8325         </class>
8326         <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">
8327                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8328                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8329                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8330                         <field reporter:label="Rule Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8331                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8332                 </fields>
8333                 <links/>
8334                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8335                         <actions>
8336                                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8337                                 <retrieve/>
8338                                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8339                                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8340                         </actions>
8341                 </permacrud>
8342         </class>
8343         <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">
8344                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8345                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8346                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8347                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8348                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
8349                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8350                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8351                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8352                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8353                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8354                 </fields>
8355                 <links>
8356                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8357                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8358                 </links>
8359                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8360                         <actions>
8361                                 <create permission="CREATE_PERM" global_required="true"/>
8362                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8363                                 <update permission="UPDATE_PERM" global_required="true"/>
8364                                 <delete permission="DELETE_PERM" global_required="true"/>
8365                         </actions>
8366                 </permacrud>
8367         </class>
8368         <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">
8369                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8370                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8371                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true" oils_obj:required="true"/>
8372                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8373                         <field reporter:label="Org Unit" name="org" reporter:datatype="link" oils_obj:required="true"/>
8374                         <field reporter:label="Position" name="position" reporter:datatype="int" oils_obj:required="true"/>
8375                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8376                 </fields>
8377                 <links>
8378                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8379                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8380                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8381                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8382                 </links>
8383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8384                         <actions>
8385                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8386                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8387                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8388                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8389                         </actions>
8390                 </permacrud>
8391         </class>
8392         <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">
8393                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8394                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8395                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text" oils_obj:required="true"/>
8396                         <field reporter:label="Answer ID" name="id" reporter:datatype="id"/>
8397                         <field reporter:label="Question" name="question" reporter:datatype="link" oils_obj:required="true"/>
8398                 </fields>
8399                 <links>
8400                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8401                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8402                 </links>
8403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8404                         <actions>
8405                                 <create permission="ADMIN_SURVEY">
8406                                         <context link="question" jump="survey" field="owner"/>
8407                                 </create>
8408                                 <retrieve/>
8409                                 <update permission="ADMIN_SURVEY">
8410                                         <context link="question" jump="survey" field="owner"/>
8411                                 </update>
8412                                 <delete permission="ADMIN_SURVEY">
8413                                         <context link="question" jump="survey" field="owner"/>
8414                                 </delete>
8415                         </actions>
8416                 </permacrud>
8417         </class>
8418         <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">
8419                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8420                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8421                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8422                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id"/>
8423                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link" oils_obj:required="true"/>
8424                         <field reporter:label="Patron" name="patron" reporter:datatype="link" oils_obj:required="true"/>
8425                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
8426                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8427                 </fields>
8428                 <links>
8429                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8430                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8431                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8432                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8433                 </links>
8434                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8435                         <actions>
8436                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
8437                         </actions>
8438                 </permacrud>
8439         </class>
8440         <class id="aoncc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::open_non_cataloged_circulation" oils_persist:tablename="action.open_non_cataloged_circulation" oils_persist:readonly="true" reporter:core="true" reporter:label="Open Non-cataloged Circulation">
8441                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8442                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
8443                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8444                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id"/>
8445                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8446                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8447                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8448                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8449                 </fields>
8450                 <links>
8451                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8452                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8453                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8454                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8455                 </links>
8456                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8457                         <actions>
8458                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
8459                         </actions>
8460                 </permacrud>
8461         </class>
8462         <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">
8463                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8464                         <field name="balance_owed" reporter:datatype="money"/>
8465                         <field name="total_owed" reporter:datatype="money"/>
8466                         <field name="total_paid" reporter:datatype="money"/>
8467                         <field name="usr" reporter:datatype="link"/>
8468                 </fields>
8469                 <links>
8470                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8471                 </links>
8472         </class>
8473         <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">
8474                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8475                         <field reporter:label="Non-fulfilling Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8476                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link" oils_obj:required="true"/>
8477                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8478                         <field reporter:label="Hold" name="hold" reporter:datatype="link" oils_obj:required="true"/>
8479                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
8480                 </fields>
8481                 <links>
8482                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8483                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8484                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8485                 </links>
8486         </class>
8487         <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">
8488                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8489                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
8490                         <field name="id" reporter:datatype="id"/>
8491                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
8492                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
8493                 </fields>
8494                 <links>
8495                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8496                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8497                 </links>
8498         </class>
8499         <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">
8500                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8501                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
8502                         <field name="id" reporter:datatype="id"/>
8503                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
8504                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
8505                 </fields>
8506                 <links>
8507                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8508                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8509                 </links>
8510         </class>
8511         <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">
8512                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8513                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
8514                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
8515                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text" oils_obj:required="true"/>
8516                         <field reporter:label="User" name="target_usr" reporter:datatype="link" oils_obj:required="true"/>
8517                 </fields>
8518                 <links>
8519                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8520                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8521                 </links>
8522         </class>
8523         <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">
8524                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8525                         <field name="depth" reporter:datatype="int" oils_obj:required="true"/>
8526                         <field name="grantable" reporter:datatype="bool"/>
8527                         <field name="grp" reporter:datatype="link" oils_obj:required="true"/>
8528                         <field name="id" reporter:datatype="id"/>
8529                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8530                 </fields>
8531                 <links>
8532                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8533                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8534                 </links>
8535                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8536                         <actions>
8537                                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8538                                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8539                                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8540                                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8541                         </actions>
8542                 </permacrud>
8543         </class>
8544         <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">
8545                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8546                         <field name="items" oils_persist:virtual="true"/>
8547                         <field name="btype" reporter:datatype="text"/>
8548                         <field name="id" reporter:datatype="id"/>
8549                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
8550                         <field name="description" reporter:datatype="text"/>
8551                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
8552                         <field name="pub" reporter:datatype="bool"/>
8553                         <field name="create_time" reporter:datatype="timestamp"/>
8554                         <field name="owning_lib" reporter:datatype="org_unit"/>
8555                 </fields>
8556                 <links>
8557                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8558                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8559                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8560                 </links>
8561                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8562                         <actions>
8563                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8564                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8565                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8566                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8567                         </actions>
8568                 </permacrud>
8569         </class>
8570         <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">
8571                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8572                         <field name="id" reporter:datatype="id"/>
8573                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
8574                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
8575                 </fields>
8576                 <links>
8577                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8578                 </links>
8579         </class>
8580         <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">
8581                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8582                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int"/>
8583                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
8584                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link" oils_obj:required="true"/>
8585                 </fields>
8586                 <links>
8587                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8588                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8589                 </links>
8590         </class>
8591         <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">
8592                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8593                         <field name="depth" reporter:datatype="int" oils_obj:required="true"/>
8594                         <field name="grantable" reporter:datatype="bool"/>
8595                         <field name="id" reporter:datatype="id"/>
8596                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8597                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
8598                 </fields>
8599                 <links>
8600                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8601                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8602                 </links>
8603         </class>
8604         <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">
8605                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8606                         <field name="object_id" reporter:datatype="text" oils_obj:required="true"/>
8607                         <field name="grantable" reporter:datatype="bool"/>
8608                         <field name="id" reporter:datatype="id"/>
8609                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8610                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
8611                         <field name="object_type" reporter:datatype="text" oils_obj:required="true"/>
8612                 </fields>
8613                 <links>
8614                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8615                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8616                 </links>
8617         </class>
8618         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8619                 <fields oils_persist:primary="id" oils_persist:sequence="">
8620                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8621                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8622                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8623                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8624                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8625                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8626                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8627                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8628                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8629                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8630                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8631                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8632                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8633                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8634                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8635                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8636                 </fields>
8637                 <links>
8638                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8639                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8640                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8641                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8642                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8643                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8644                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8645                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8646                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8647                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8648                 </links>
8649                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8650                         <actions>
8651                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8652                                         <context link="xact" jump="usr" field="home_ou"/>
8653                                 </retrieve>
8654                         </actions>
8655                 </permacrud>
8656         </class>
8657         <class id="map" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::aged_payment" oils_persist:tablename="money.aged_payment" reporter:label="Payments: Aged">
8658                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8659                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8660                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
8661                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8662                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8663                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text" oils_obj:required="true"/>
8664                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8665                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool" oils_obj:required="true"/>
8666                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8667                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8668                         <field name="billing" reporter:datatype="link"/>
8669                 </fields>
8670                 <links>
8671                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8672                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8673                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8674                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8675                 </links>
8676                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8677                         <actions>
8678                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8679                                         <context link="xact" field="usr_home_ou"/>
8680                                 </retrieve>
8681                         </actions>
8682                 </permacrud>
8683         </class>
8684         <class id="mallp" controller="open-ils.cstore" oils_obj:fieldmapper="money::all_payments" oils_persist:tablename="money.all_payments" oils_persist:readonly="true" reporter:core="true" reporter:label="Payments: All">
8685                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8686                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8687                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8688                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8689                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8690                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8691                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8692                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8693                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8694                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8695                         <field name="billing" reporter:datatype="link"/>
8696                 </fields>
8697                 <links>
8698                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8699                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8700                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8701                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8702                 </links>
8703         </class>
8704
8705         <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">
8706                 <fields oils_persist:primary="id" oils_persist:sequence="">
8707                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8708                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8709                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8710                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8711                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8712                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8713                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8714                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8715                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8716                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8717                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8718                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8719                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8720                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8721                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8722                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8723                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8724                 </fields>
8725                 <links>
8726                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8727                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8728                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8729                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8730                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8731                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8732                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8733                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8734                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8735                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8736                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8737                 </links>
8738                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8739                         <actions>
8740                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8741                                         <context link="xact" jump="usr" field="home_ou"/>
8742                                 </retrieve>
8743                         </actions>
8744                 </permacrud>
8745         </class>
8746         <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">
8747                 <fields oils_persist:primary="id" oils_persist:sequence="">
8748                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8749                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8750                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8751                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8752                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8753                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8754                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8755                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8756                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8757                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8758                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8759                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8760                 </fields>
8761                 <links>
8762                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8763                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8764                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8765                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8766                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8767                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8768                 </links>
8769         </class>
8770         <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">
8771                 <fields oils_persist:primary="id" oils_persist:sequence="">
8772                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8773                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8774                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8775                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8776                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8777                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8778                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8779                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8780                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8781                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8782                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8783                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8784                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8785                 </fields>
8786                 <links>
8787                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8788                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8789                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8790                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8791                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8792                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8793                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8794                 </links>
8795         </class>
8796         <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">
8797                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8798                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
8799                         <field name="id" reporter:datatype="id"/>
8800                         <field name="target_biblio_record_entry" reporter:datatype="link" oils_obj:required="true"/>
8801                         <field name="create_time" reporter:datatype="timestamp"/>
8802                         <field name="pos" reporter:datatype="int"/>
8803                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8804                 </fields>
8805                 <links>
8806                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8807                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8808                         <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8809                 </links>
8810                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8811                         <actions>
8812                                 <retrieve permission="ADMIN_COPY_BUCKET">
8813                                         <context link="bucket" field="owning_lib"/>
8814                                 </retrieve>
8815                         </actions>
8816                 </permacrud>
8817         </class>
8818         <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">
8819                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8820                         <field name="id" reporter:datatype="id"/>
8821                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
8822                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
8823                 </fields>
8824                 <links>
8825                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8826                 </links>
8827         </class>
8828         <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">
8829                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8830                         <field reporter:label="Entry ID" name="id" reporter:datatype="int"/>
8831                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
8832                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
8833                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
8834                 </fields>
8835                 <links>
8836                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8837                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8838                 </links>
8839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8840                         <actions>
8841                                 <create permission="CREATE_COPY_STAT_CAT_ENTRY">
8842                                         <context link="stat_cat" field="owner"/>
8843                                 </create>
8844                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8845                                 <update permission="UPDATE_COPY_STAT_CAT_ENTRY">
8846                                         <context link="stat_cat" field="owner"/>
8847                                 </update>
8848                                 <delete permission="DELETE_COPY_STAT_CAT_ENTRY">
8849                                         <context link="stat_cat" field="owner"/>
8850                                 </delete>
8851                         </actions>
8852                 </permacrud>
8853         </class>
8854         <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">
8855                 <fields oils_persist:primary="field">
8856                         <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name" oils_obj:required="true"/>
8857                         <field reporter:label="Field Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8858                         <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8859                 </fields>
8860                 <links/>
8861                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8862                         <actions>
8863                                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8864                                 <retrieve/>
8865                                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8866                                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8867                         </actions>
8868                 </permacrud>
8869         </class>
8870         <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">
8871                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8872                         <field reporter:label="Cause ID" name="id" reporter:datatype="id"/>
8873                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8874                         <field reporter:label="Manual Use?" name="manual" reporter:datatype="bool"/>
8875                 </fields>
8876                 <links/>
8877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8878                         <actions>
8879                                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8880                                 <retrieve/>
8881                                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8882                                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8883                         </actions>
8884                 </permacrud>
8885         </class>
8886
8887
8888         <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">
8889                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8890                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link" oils_obj:required="true"/>
8891                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit" oils_obj:required="true"/>
8892                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8893                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8894                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
8895                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8896                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8897                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit" oils_obj:required="true"/>
8898                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8899                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
8900                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8901                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8902                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8903                 </fields>
8904                 <links>
8905                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8906                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8907                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8908                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8909                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8910                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8911                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8912                 </links>
8913                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8914                         <actions>
8915                                 <create permission="TRANSIT_COPY">
8916                                         <context link="target_copy" field="owner"/>
8917                                 </create>
8918                                 <retrieve/>
8919                                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8920                                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8921                         </actions>
8922                 </permacrud>
8923         </class>
8924         <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">
8925                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8926                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link" oils_obj:required="true"/>
8927                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit" oils_obj:required="true"/>
8928                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8929                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8930                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
8931                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8932                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8933                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit" oils_obj:required="true"/>
8934                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8935                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
8936                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8937                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8938                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8939                 </fields>
8940                 <links>
8941                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8942                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8943                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8944                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8945                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8946                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8947                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8948                 </links>
8949                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8950                         <actions>
8951                                 <create permission="TRANSIT_COPY" context_field="owner">
8952                                         <context link="target_copy" field="circ_lib"/>
8953                                 </create>
8954                                 <retrieve/>
8955                                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8956                                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8957                         </actions>
8958                 </permacrud>
8959         </class>
8960         <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">
8961                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8962                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8963                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8964                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8965                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8966                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8967                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text" oils_obj:required="true"/>
8968                         <field reporter:label="Billing ID" name="id" reporter:datatype="id"/>
8969                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8970                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8971                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8972                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8973                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8974                         <field reporter:label="Type" name="btype" reporter:datatype="link" oils_obj:required="true"/>
8975                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8976                 </fields>
8977                 <links>
8978                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8979                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8980                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8981                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8982                 </links>
8983                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8984                         <actions>
8985                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8986                                         <context link="xact" jump="usr" field="home_ou"/>
8987                                 </retrieve>
8988                         </actions>
8989                 </permacrud>
8990         </class>
8991         <class id="mab" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::aged_billing" oils_persist:tablename="money.aged_billing" reporter:label="Aged Billing Line Item">
8992                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8993                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8994                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp" oils_obj:required="true"/>
8995                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8996                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8997                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8998                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text" oils_obj:required="true"/>
8999                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
9000                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9001                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9002                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool" oils_obj:required="true"/>
9003                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9004                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
9005                         <field reporter:label="Type" name="btype" reporter:datatype="link" oils_obj:required="true"/>
9006                 </fields>
9007                 <links>
9008                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9009                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9010                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9011                 </links>
9012                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9013                         <actions>
9014                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9015                                         <context link="xact" field="usr_home_ou"/>
9016                                 </retrieve>
9017                         </actions>
9018                 </permacrud>
9019         </class>
9020         <class id="mallb" controller="open-ils.cstore" oils_obj:fieldmapper="money::all_billings" oils_persist:tablename="money.all_billings" oils_persist:readonly="true" reporter:label="All Billing Line Items">
9021                 <fields oils_persist:primary="id" oils_persist:sequence="">
9022                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9023                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9024                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9025                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9026                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9027                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9028                         <field reporter:label="Billing ID" name="id" reporter:datatype="id"/>
9029                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9030                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9031                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9032                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9033                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9034                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9035                 </fields>
9036                 <links>
9037                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9038                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9039                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9040                 </links>
9041         </class>
9042         <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">
9043                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9044                         <field name="grp" oils_obj:required="true"/>
9045                         <field name="id" reporter:datatype="id"/>
9046                         <field name="usr" oils_obj:required="true"/>
9047                 </fields>
9048                 <links>
9049                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9050                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9051                 </links>
9052         </class>
9053         <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">
9054                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9055                         <field name="id" reporter:datatype="id"/>
9056                         <field name="fq_field" reporter:datatype="text" oils_obj:required="true"/>
9057                         <field name="identity_value" reporter:datatype="text" oils_obj:required="true"/>
9058                         <field name="translation" reporter:datatype="text" oils_obj:required="true"/>
9059                         <field name="string" reporter:datatype="text" oils_obj:required="true"/>
9060                 </fields>
9061                 <links>
9062                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9063                 </links>
9064                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9065                         <actions>
9066                                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9067                                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9068                                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9069                                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9070                         </actions>
9071                 </permacrud>
9072         </class>
9073         <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">
9074                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9075                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
9076                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9077                         <field name="field" reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9078                         <field name="owner" reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9079                         <field name="string" reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9080                 </fields>
9081                 <links>
9082                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9083                 </links>
9084                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9085                         <actions>
9086                                 <create permission="ADMIN_FIELD_DOC" context_field="owner"/>
9087                                 <retrieve/>
9088                                 <update permission="ADMIN_FIELD_DOC" context_field="owner"/>
9089                                 <delete permission="ADMIN_FIELD_DOC" context_field="owner"/>
9090                         </actions>
9091                 </permacrud>
9092         </class>
9093         <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">
9094                 <fields oils_persist:primary="code">
9095                         <field name="code" reporter:datatype="id" oils_obj:required="true"/>
9096                         <field name="marc_code" reporter:datatype="text" oils_obj:required="true"/>
9097                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9098                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9099                         <field name="rtl" reporter:datatype="bool"/>
9100                 </fields>
9101                 <links/>
9102                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9103                         <actions>
9104                                 <create permission="CREATE_LOCALE" global_required="true"/>
9105                                 <retrieve/>
9106                                 <update permission="UPDATE_LOCALE" global_required="true"/>
9107                                 <delete permission="DELETE_LOCALE" global_required="true"/>
9108                         </actions>
9109                 </permacrud>
9110         </class>
9111         <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">
9112                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9113                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9114                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9115                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9116                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9117                 </fields>
9118                 <links>
9119                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9120                 </links>
9121                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9122                         <actions>
9123                                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9124                                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9125                                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9126                                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9127                         </actions>
9128                 </permacrud>
9129         </class>
9130
9131         <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">
9132                 <fields oils_persist:primary="id">
9133                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9134                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9135                 </fields>
9136                 <links/>
9137                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9138                         <actions>
9139                                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9140                                 <retrieve/>
9141                                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9142                                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9143                         </actions>
9144                 </permacrud>
9145         </class>
9146
9147         <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">
9148                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9149                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9150                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
9151                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link"/>
9152                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool"/>
9153                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" oils_obj:required="true"/>
9154                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text"/>
9155                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text"/>
9156                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool"/>
9157                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9158                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link"/>
9159                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp"/>
9160                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp"/>
9161                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text"/>
9162                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text"/>
9163                         <field reporter:label="UPC" name="upc" reporter:datatype="text"/>
9164                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9165                         <field reporter:label="Volume" name="volume" reporter:datatype="text"/>
9166                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9167                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text"/>
9168                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text"/>
9169                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text"/>
9170                         <field reporter:label="Publication Location" name="location" reporter:datatype="text"/>
9171                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text"/>
9172                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text"/>
9173                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text"/>
9174                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9175                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9176                 </fields>
9177                 <links>
9178                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9179                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9180                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9181                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9182                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9183                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9184                 </links>
9185                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9186                         <actions>
9187                                 <create permission="user_request.create">
9188                                         <context link="usr" field="home_ou"/>
9189                                 </create>
9190                                 <retrieve permission="user_request.view">
9191                                         <context link="usr" field="home_ou"/>
9192                                 </retrieve>
9193                                 <update permission="user_request.update">
9194                                         <context link="usr" field="home_ou"/>
9195                                 </update>
9196                                 <delete permission="user_request.delete">
9197                                         <context link="usr" field="home_ou"/>
9198                                 </delete>
9199                         </actions>
9200                 </permacrud>
9201         </class>
9202
9203         <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">
9204                 <oils_persist:source_definition><![CDATA[
9205                         SELECT r.*, CASE
9206                                                 WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9207                                                 WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9208                                                 WHEN l.state = 'received' THEN 5 -- Received
9209                                                 WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9210                                                 WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9211                                                 WHEN l.id IS NOT NULL THEN 2 -- Pending
9212                                                 WHEN l.id IS NULL THEN 1 -- New
9213                                                 ELSE 0 -- Error
9214                                         END AS request_status
9215                                         ,u.home_ou
9216                         FROM      acq.user_request r
9217                         JOIN actor.usr u ON (r.usr = u.id)
9218                         LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9219                         LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9220                         LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9221                 ]]></oils_persist:source_definition>
9222                 <fields oils_persist:primary="id">
9223                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9224                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
9225                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link"/>
9226                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool"/>
9227                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
9228                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text"/>
9229                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text"/>
9230                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool"/>
9231                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9232                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link"/>
9233                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp"/>
9234                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp"/>
9235                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text"/>
9236                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text"/>
9237                         <field reporter:label="UPC" name="upc" reporter:datatype="text"/>
9238                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9239                         <field reporter:label="Volume" name="volume" reporter:datatype="text"/>
9240                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9241                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text"/>
9242                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text"/>
9243                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text"/>
9244                         <field reporter:label="Publication Location" name="location" reporter:datatype="text"/>
9245                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text"/>
9246                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text"/>
9247                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text"/>
9248                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9249                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9250                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link"/>
9251                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9252                 </fields>
9253                 <links>
9254                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9255                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9256                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9257                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9258                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9259                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9260                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9261                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9262                 </links>
9263                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9264                         <actions>
9265                                 <retrieve permission="user_request.view">
9266                                         <context link="usr" field="home_ou"/>
9267                                 </retrieve>
9268                         </actions>
9269                 </permacrud>
9270         </class>
9271
9272         <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">
9273                 <fields oils_persist:primary="id">
9274                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9275                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9276                 </fields>
9277                 <links/>
9278                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9279                         <actions>
9280                                 <retrieve/>
9281                         </actions>
9282                 </permacrud>
9283         </class>
9284
9285         <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">
9286                 <fields oils_persist:primary="code">
9287                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
9288                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9289                 </fields>
9290                 <links/>
9291                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9292                         <actions>
9293                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9294                                 <retrieve/>
9295                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9296                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9297                         </actions>
9298                 </permacrud>
9299         </class>
9300
9301         <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">
9302                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9303                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id"/>
9304                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" oils_obj:required="true"/>
9305                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" oils_obj:required="true"/>
9306                         <field reporter:label="Ratio" name="ratio" oils_obj:required="true"/>
9307                 </fields>
9308                 <links>
9309                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9310                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9311                 </links>
9312                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9313                         <actions>
9314                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9315                                 <retrieve/>
9316                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9317                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9318                         </actions>
9319                 </permacrud>
9320         </class>
9321
9322         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9323                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9324                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9325                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9326                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9327                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9328                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9329                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text"/>
9330                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9331                         <field reporter:label="SAN" name="san" reporter:datatype="text"/>
9332                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link"/>
9333                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
9334                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool"/>
9335                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
9336                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9337                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9338                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9339                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link"/>
9340                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int"/>
9341                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link"/>
9342                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link"/>
9343                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link"/>
9344                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link"/>
9345                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
9346                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link"/>
9347                         <field reporter:label="Buyer SAN" name="buyer_san" reporter:datatype="text"/>
9348                 </fields>
9349                 <links>
9350                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9351                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9352                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9353                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9354                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9355                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9356                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9357                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9358                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9359                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9360                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9361                 </links>
9362                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9363                         <actions>
9364                                 <create permission="ADMIN_PROVIDER" context_field="owner"/>
9365                                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9366                                 <update permission="ADMIN_PROVIDER" context_field="owner"/>
9367                                 <delete permission="ADMIN_PROVIDER" context_field="owner"/>
9368                         </actions>
9369                 </permacrud>
9370         </class>
9371
9372         <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">
9373                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9374                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id"/>
9375                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9376                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9377                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
9378                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9379                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
9380                         <field reporter:label="Note Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
9381                 </fields>
9382                 <links>
9383                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9384                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9385                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9386                 </links>
9387         </class>
9388
9389         <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">
9390                 <fields oils_persist:primary="code">
9391                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
9392                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9393                 </fields>
9394                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9395                         <actions>
9396                                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9397                                 <retrieve/>
9398                                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9399                                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9400                         </actions>
9401                 </permacrud>
9402         </class>
9403
9404         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9405                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9406                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9407                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" oils_obj:required="true"/>
9408                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9409                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link" oils_obj:required="true"/>
9410                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp"/>
9411                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link"/>
9412                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text"/>
9413                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" oils_obj:required="true"/>
9414                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text"/>
9415                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link"/>
9416                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9417                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp"/>
9418                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link"/>
9419                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9420                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9421                 </fields>
9422                 <links>
9423                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9424                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9425                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9426                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9427                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9428                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9429                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9430                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9431                 </links>
9432                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9433                         <actions>
9434                                 <create permission="CREATE_INVOICE" context_field="receiver"/>
9435                                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9436                                 <update permission="CREATE_INVOICE" context_field="receiver"/>
9437                                 <delete permission="CREATE_INVOICE" context_field="receiver"/>
9438                         </actions>
9439                 </permacrud>
9440         </class>
9441
9442         <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">
9443                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9444                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9445                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" oils_obj:required="true"/>
9446                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9447                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9448                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" oils_obj:required="true"/>
9449                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int"/>
9450                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9451                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool"/>
9452                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money"/>
9453                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money"/>
9454                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money"/>
9455                 </fields>
9456                 <links>
9457                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9458                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9459                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9460                 </links>
9461                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9462                         <actions>
9463                                 <create permission="ADMIN_INVOICE">
9464                                         <context link="invoice" field="receiver"/>
9465                                 </create>
9466                                 <retrieve permission="ADMIN_INVOICE">
9467                                         <context link="invoice" field="receiver"/>
9468                                 </retrieve>
9469                                 <update permission="ADMIN_INVOICE">
9470                                         <context link="invoice" field="receiver"/>
9471                                 </update>
9472                                 <delete permission="ADMIN_INVOICE">
9473                                         <context link="invoice" field="receiver"/>
9474                                 </delete>
9475                         </actions>
9476                 </permacrud>
9477         </class>
9478
9479         <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">
9480                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9481                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9482                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" oils_obj:required="true"/>
9483                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9484                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9485                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" oils_obj:required="true"/>
9486                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text"/>
9487                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9488                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9489                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money"/>
9490                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money"/>
9491                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9492                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money"/>
9493                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link"/>
9494                         <field reporter:label="Target" name="target" reporter:datatype="int"/>
9495                 </fields>
9496                 <links>
9497                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9498                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9499                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9500                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9501                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9502                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9503                 </links>
9504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9505                         <actions>
9506                                 <create permission="ADMIN_INVOICE">
9507                                         <context link="invoice" field="receiver"/>
9508                                 </create>
9509                                 <retrieve permission="ADMIN_INVOICE">
9510                                         <context link="invoice" field="receiver"/>
9511                                 </retrieve>
9512                                 <update permission="ADMIN_INVOICE">
9513                                         <context link="invoice" field="receiver"/>
9514                                 </update>
9515                                 <delete permission="ADMIN_INVOICE">
9516                                         <context link="invoice" field="receiver"/>
9517                                 </delete>
9518                         </actions>
9519                 </permacrud>
9520         </class>
9521
9522         <class id="acqsn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::shipment_notification" oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9523                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9524                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9525                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" oils_obj:required="true"/>
9526                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9527                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link" oils_obj:required="true"/>
9528                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp"/>
9529                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link"/>
9530                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp"/>
9531                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link"/>
9532                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" oils_obj:required="true"/>
9533                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text"/>
9534                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9535                         <field reporter:label="Shipment Notification Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9536                 </fields>
9537                 <links>
9538                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9539                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9540                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9541                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9542                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9543                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9544                 </links>
9545                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9546                         <actions>
9547                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9548                                 <update permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9549                                 <delete permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9550                         </actions>
9551                 </permacrud>
9552         </class>
9553
9554         <class id="acqsne" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::shipment_notification_entry" oils_persist:tablename="acq.shipment_notification_entry" reporter:label="Shipment Notification Entry">
9555                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9556                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9557                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" oils_obj:required="true"/>
9558                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9559                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" oils_obj:required="true"/>
9560                 </fields>
9561                 <links>
9562                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9563                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9564                 </links>
9565                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9566                                 <actions>
9567                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9568                                                 <context link="shipment_notification" field="receiver"/>
9569                                         </retrieve>
9570                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9571                                                 <context link="shipment_notification" field="receiver"/>
9572                                         </update>
9573                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9574                                                 <context link="shipment_notification" field="receiver"/>
9575                                         </delete>
9576                                 </actions>
9577                         </permacrud>
9578         </class>
9579
9580         <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">
9581                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9582                         <field reporter:label="Address Type" name="address_type" reporter:datatype="text"/>
9583                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
9584                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
9585                         <field reporter:label="County" name="county" reporter:datatype="text"/>
9586                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9587                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9588                         <field reporter:label="Post Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9589                         <field reporter:label="State" name="state" reporter:datatype="text" oils_obj:required="true"/>
9590                         <field reporter:label="Street 1" name="street1" reporter:datatype="text" oils_obj:required="true"/>
9591                         <field reporter:label="Street 2" name="street2" reporter:datatype="text"/>
9592                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9593                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9594                 </fields>
9595                 <links>
9596                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9597                 </links>
9598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9599                         <actions>
9600                                 <create permission="ADMIN_PROVIDER">
9601                                         <context link="provider" field="owner"/>
9602                                 </create>
9603                                 <retrieve permission="ADMIN_PROVIDER">
9604                                         <context link="provider" field="owner"/>
9605                                 </retrieve>
9606                                 <update permission="ADMIN_PROVIDER">
9607                                         <context link="provider" field="owner"/>
9608                                 </update>
9609                                 <delete permission="ADMIN_PROVIDER">
9610                                         <context link="provider" field="owner"/>
9611                                 </delete>
9612                         </actions>
9613                 </permacrud>
9614         </class>
9615
9616         <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">
9617                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9618                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9619                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9620                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9621                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9622                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9623                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9624                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9625                 </fields>
9626                 <links>
9627                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9628                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9629                 </links>
9630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9631                         <actions>
9632                                 <create permission="ADMIN_PROVIDER">
9633                                         <context link="provider" field="owner"/>
9634                                 </create>
9635                                 <retrieve permission="ADMIN_PROVIDER">
9636                                         <context link="provider" field="owner"/>
9637                                 </retrieve>
9638                                 <update permission="ADMIN_PROVIDER">
9639                                         <context link="provider" field="owner"/>
9640                                 </update>
9641                                 <delete permission="ADMIN_PROVIDER">
9642                                         <context link="provider" field="owner"/>
9643                                 </delete>
9644                         </actions>
9645                 </permacrud>
9646         </class>
9647         <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">
9648                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9649                         <field reporter:label="Type" name="address_type" reporter:datatype="text"/>
9650                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
9651                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
9652                         <field reporter:label="County" name="county" reporter:datatype="text"/>
9653                         <field reporter:label="Address ID" name="id" reporter:datatype="id"/>
9654                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9655                         <field reporter:label="State" name="state" reporter:datatype="text" oils_obj:required="true"/>
9656                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text" oils_obj:required="true"/>
9657                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9658                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9659                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9660                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9661                 </fields>
9662                 <links>
9663                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9664                 </links>
9665                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9666                         <actions>
9667                                 <create permission="ADMIN_PROVIDER">
9668                                         <context link="contact" jump="provider" field="owner"/>
9669                                 </create>
9670                                 <retrieve permission="ADMIN_PROVIDER">
9671                                         <context link="contact" jump="provider" field="owner"/>
9672                                 </retrieve>
9673                                 <update permission="ADMIN_PROVIDER">
9674                                         <context link="contact" jump="provider" field="owner"/>
9675                                 </update>
9676                                 <delete permission="ADMIN_PROVIDER">
9677                                         <context link="contact" jump="provider" field="owner"/>
9678                                 </delete>
9679                         </actions>
9680                 </permacrud>
9681         </class>
9682
9683         <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">
9684                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9685                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9686                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link" oils_obj:required="true"/>
9687                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money" oils_obj:required="true"/>
9688                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9689                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9690                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9691                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link" oils_obj:required="true"/>
9692                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9693                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link" oils_obj:required="true"/>
9694                 </fields>
9695                 <links>
9696                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9697                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9698                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9699                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9700                 </links>
9701                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9702                         <actions>
9703                                 <create permission="ADMIN_ACQ_FUND">
9704                                         <context link="src_fund" field="org"/>
9705                                 </create>
9706                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9707                                         <context link="src_fund" field="org"/>
9708                                         <context link="dest_fund" field="org"/>
9709                                 </retrieve>
9710                                 <update permission="ADMIN_ACQ_FUND">
9711                                         <context link="src_fund" field="org"/>
9712                                 </update>
9713                                 <delete permission="ADMIN_ACQ_FUND">
9714                                         <context link="src_fund" field="org"/>
9715                                 </delete>
9716                         </actions>
9717                 </permacrud>
9718         </class>
9719
9720         <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">
9721                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9722                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
9723                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9724                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9725                 </fields>
9726                 <links>
9727                         <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9728                 </links>
9729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9730                         <actions>
9731                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9732                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9733                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9734                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9735                         </actions>
9736                 </permacrud>
9737         </class>
9738
9739         <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">
9740                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9741                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector="year" oils_obj:required="true"/>
9742                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link" oils_obj:required="true"/>
9743                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9744                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp" oils_obj:required="true"/>
9745                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp" oils_obj:required="true"/>
9746                 </fields>
9747                 <links>
9748                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9749                 </links>
9750                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9751                         <actions>
9752                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9753                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9754                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9755                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9756                         </actions>
9757                 </permacrud>
9758         </class>
9759
9760         <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">
9761                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9762                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9763                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9764                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9765                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9766                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9767                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
9768                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9769                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9770                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9771                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9772                 </fields>
9773                 <links>
9774                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9775                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9776                         <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9777                         <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9778                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9779                 </links>
9780                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9781                         <actions>
9782                                 <create permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9783                                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9784                                 <update permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9785                                 <delete permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9786                         </actions>
9787                 </permacrud>
9788         </class>
9789
9790         <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">
9791                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9792                         <field reporter:label="Credit ID" name="id" reporter:datatype="id"/>
9793                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
9794                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
9795                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9796                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp"/>
9797                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp"/>
9798                 </fields>
9799                 <links>
9800                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9801                 </links>
9802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9803                         <actions>
9804                                 <create permission="ADMIN_FUNDING_SOURCE">
9805                                         <context link="funding_source" field="owner"/>
9806                                 </create>
9807                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9808                                         <context link="funding_source" field="owner"/>
9809                                 </retrieve>
9810                                 <update permission="ADMIN_FUNDING_SOURCE">
9811                                         <context link="funding_source" field="owner"/>
9812                                 </update>
9813                                 <delete permission="ADMIN_FUNDING_SOURCE">
9814                                         <context link="funding_source" field="owner"/>
9815                                 </delete>
9816                         </actions>
9817                 </permacrud>
9818         </class>
9819
9820         <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">
9821                 <fields oils_persist:primary="id">
9822                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9823                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9824                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9825                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9826                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9827                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9828                 </fields>
9829                 <links>
9830                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9831                 </links>
9832         </class>
9833
9834         <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">
9835                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9836                         <field reporter:label="Debit ID" name="id" reporter:datatype="id"/>
9837                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true"/>
9838                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" oils_obj:required="true"/>
9839                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" oils_obj:required="true"/>
9840                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
9841                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool"/>
9842                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" oils_obj:required="true"/>
9843                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp"/>
9844                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link"/>
9845                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9846                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link"/>
9847                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link"/>
9848                 </fields>
9849                 <links>
9850                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9851                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9852                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9853                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9854                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9855                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9856                 </links>
9857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9858                         <actions>
9859                                 <create permission="ADMIN_ACQ_FUND">
9860                                         <context link="fund" field="org"/>
9861                                 </create>
9862                                 <retrieve permission="ADMIN_ACQ_FUND">
9863                                         <context link="fund" field="org"/>
9864                                 </retrieve>
9865                                 <update permission="ADMIN_ACQ_FUND">
9866                                         <context link="fund" field="org"/>
9867                                 </update>
9868                                 <delete permission="ADMIN_ACQ_FUND">
9869                                         <context link="fund" field="org"/>
9870                                 </delete>
9871                         </actions>
9872                 </permacrud>
9873         </class>
9874
9875         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9876                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9877                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9878                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
9879                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9880                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9881                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true"/>
9882                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9883                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool"/>
9884                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool"/>
9885                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
9886                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int"/>
9887                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int"/>
9888                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9889                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9890                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9891                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9892                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9893                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9894                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9895                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9896                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9897                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9898                 </fields>
9899                 <links>
9900                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9901                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9902                         <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9903                         <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9904                         <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9905                         <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9906                         <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9907                         <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9908                         <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9909                         <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9910                         <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9911                 </links>
9912                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9913                         <actions>
9914                                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9915                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9916                                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9917                                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9918                         </actions>
9919                 </permacrud>
9920         </class>
9921
9922         <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">
9923                 <fields oils_persist:primary="fund">
9924                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9925                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money"/>
9926                 </fields>
9927                 <links>
9928                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9929                 </links>
9930                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9931                         <actions>
9932                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9933                                         <context link="fund" field="org"/>
9934                                 </retrieve>
9935                         </actions>
9936                 </permacrud>
9937         </class>
9938
9939         <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">
9940                 <fields oils_persist:primary="fund">
9941                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9942                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money"/>
9943                 </fields>
9944                 <links>
9945                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9946                 </links>
9947                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9948                         <actions>
9949                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9950                                         <context link="fund" field="org"/>
9951                                 </retrieve>
9952                         </actions>
9953                 </permacrud>
9954         </class>
9955
9956         <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">
9957                 <fields oils_persist:primary="fund">
9958                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9959                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money"/>
9960                 </fields>
9961                 <links>
9962                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9963                 </links>
9964                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9965                         <actions>
9966                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9967                                         <context link="fund" field="org"/>
9968                                 </retrieve>
9969                         </actions>
9970                 </permacrud>
9971         </class>
9972
9973         <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">
9974                 <fields oils_persist:primary="fund">
9975                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9976                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money"/>
9977                 </fields>
9978                 <links>
9979                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9980                 </links>
9981                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9982                         <actions>
9983                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9984                                         <context link="fund" field="org"/>
9985                                 </retrieve>
9986                         </actions>
9987                 </permacrud>
9988         </class>
9989
9990         <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">
9991                 <fields oils_persist:primary="fund">
9992                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9993                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money"/>
9994                 </fields>
9995                 <links>
9996                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9997                 </links>
9998                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9999                         <actions>
10000                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10001                                         <context link="fund" field="org"/>
10002                                 </retrieve>
10003                         </actions>
10004                 </permacrud>
10005         </class>
10006
10007    <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">
10008                 <fields oils_persist:primary="fund">
10009                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10010                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money"/>
10011                 </fields>
10012                 <links>
10013                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10014                 </links>
10015         </class>
10016
10017    <class id="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">
10018                 <fields oils_persist:primary="fund">
10019                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10020                         <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money"/>
10021                 </fields>
10022                 <links>
10023                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10024                 </links>
10025         </class>
10026
10027    <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">
10028                 <fields oils_persist:primary="fund">
10029                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10030                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money"/>
10031                 </fields>
10032                 <links>
10033                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10034                 </links>
10035         </class>
10036
10037    <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">
10038                 <fields oils_persist:primary="fund">
10039                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10040                         <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money"/>
10041                 </fields>
10042                 <links>
10043                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10044                 </links>
10045         </class>
10046
10047    <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">
10048                 <fields oils_persist:primary="fund">
10049                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10050                         <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money"/>
10051                 </fields>
10052                 <links>
10053                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10054                 </links>
10055         </class>
10056
10057         <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">
10058                 <fields oils_persist:primary="funding_source">
10059                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10060                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money"/>
10061                 </fields>
10062                 <links>
10063                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10064                 </links>
10065         </class>
10066
10067         <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">
10068                 <fields oils_persist:primary="funding_source">
10069                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10070                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money"/>
10071                 </fields>
10072                 <links>
10073                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10074                 </links>
10075         </class>
10076
10077         <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">
10078                 <fields oils_persist:primary="funding_source">
10079                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10080                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money"/>
10081                 </fields>
10082                 <links>
10083                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10084                 </links>
10085         </class>
10086
10087         <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">
10088                 <fields oils_persist:primary="fund">
10089                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10090                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money"/>
10091                 </fields>
10092                 <links>
10093                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10094                 </links>
10095                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10096                         <actions>
10097                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10098                                         <context link="fund" field="org"/>
10099                                 </retrieve>
10100                         </actions>
10101                 </permacrud>
10102         </class>
10103         <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">
10104                 <oils_persist:source_definition><![CDATA[
10105                         SELECT
10106                                 acqf.*,
10107                                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10108                                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10109                                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10110                                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10111                         FROM
10112                                 acq.fund acqf
10113                                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10114                                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10115                                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10116                                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10117                 ]]></oils_persist:source_definition>
10118                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10119                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10120                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit"/>
10121                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10122                         <field reporter:label="Year" name="year" reporter:datatype="int"/>
10123                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link"/>
10124                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10125                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool"/>
10126                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool"/>
10127                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
10128                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int"/>
10129                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int"/>
10130
10131                         <!-- non fund-native fields -->
10132                         <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10133                         <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10134                         <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10135                         <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10136                 </fields>
10137                 <links>
10138                         <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10139                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10140                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10141                 </links>
10142                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10143                         <actions>
10144                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10145                         </actions>
10146                 </permacrud>
10147         </class>
10148         <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">
10149                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10150                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id"/>
10151                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true"/>
10152                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
10153                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
10154                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true"/>
10155                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10156                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp"/>
10157                 </fields>
10158                 <links>
10159                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10160                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10161                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10162                 </links>
10163                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10164                         <actions>
10165                                 <create permission="ADMIN_ACQ_FUND">
10166                                         <context link="fund" field="org"/>
10167                                 </create>
10168                                 <retrieve permission="ADMIN_ACQ_FUND">
10169                                         <context link="fund" field="org"/>
10170                                 </retrieve>
10171                                 <update permission="ADMIN_ACQ_FUND">
10172                                         <context link="fund" field="org"/>
10173                                 </update>
10174                                 <delete permission="ADMIN_ACQ_FUND">
10175                                         <context link="fund" field="org"/>
10176                                 </delete>
10177                         </actions>
10178                 </permacrud>
10179         </class>
10180
10181         <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">
10182                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10183                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id"/>
10184                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
10185                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
10186                         <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text"/>
10187                         <field reporter:label="Percent" name="percent" reporter:datatype="float" oils_obj:required="true"/>
10188                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true"/>
10189                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10190                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10191                 </fields>
10192                 <links>
10193                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10194                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10195                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10196                 </links>
10197                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10198                         <actions>
10199                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10200                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10201                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10202                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10203                         </actions>
10204                 </permacrud>
10205         </class>
10206
10207         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10208                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10209                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10210                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10211                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
10212                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10213                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10214                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10215                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
10216                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10217                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10218                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10219                 </fields>
10220                 <links>
10221                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10222                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10223                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10224                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10225                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10226                 </links>
10227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10228                         <actions>
10229                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10230                         </actions>
10231                 </permacrud>
10232         </class>
10233
10234         <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">
10235                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10236                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
10237                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
10238                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10239                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10240                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10241                 </fields>
10242                 <links>
10243                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10244                 </links>
10245                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10246                         <actions>
10247                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10248                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10249                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10250                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10251                         </actions>
10252                 </permacrud>
10253         </class>
10254
10255         <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">
10256                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10257                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10258                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10259                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10260                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10261                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10262                         <field reporter:label="Status" name="state" reporter:datatype="link"/>
10263                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" oils_obj:required="true"/>
10264                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10265                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10266                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10267                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10268                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10269                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool"/>
10270                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link"/>
10271                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
10272                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int"/>
10273                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float"/>
10274                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float"/>
10275                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float"/>
10276                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link"/>
10277                 </fields>
10278                 <links>
10279                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10280                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10281                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10282                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10283                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10284                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10285                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10286                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10287                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10288                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10289                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10290                 </links>
10291                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10292                         <actions>
10293                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10294                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10295                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10296                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10297                         </actions>
10298                 </permacrud>
10299         </class>
10300
10301         <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">
10302                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10303                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id" oils_obj:required="true"/>
10304                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10305                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text" oils_obj:required="true"/>
10306                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link" oils_obj:required="true"/>
10307                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10308                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10309                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10310                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link" oils_obj:required="true"/>
10311                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10312                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10313                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10314                         <field reporter:label="Status" name="state" reporter:datatype="text" oils_obj:required="true"/>
10315                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10316                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10317                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10318                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" oils_obj:required="true"/>
10319                 </fields>
10320                 <links>
10321                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10322                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10323                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10324                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10325                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10326                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10327                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10328                 </links>
10329                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10330                         <actions>
10331                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10332                         </actions>
10333                 </permacrud>
10334         </class>
10335
10336         <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">
10337                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10338                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id"/>
10339                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" oils_obj:required="true"/>
10340                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10341                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10342                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10343                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10344                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
10345                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool"/>
10346                 </fields>
10347                 <links>
10348                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10349                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10350                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10351                 </links>
10352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10353                         <actions>
10354                                 <create permission="CREATE_PURCHASE_ORDER">
10355                                         <context link="purchase_order" field="ordering_agency"/>
10356                                 </create>
10357                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10358                                         <context link="purchase_order" field="ordering_agency"/>
10359                                 </retrieve>
10360                                 <update permission="CREATE_PURCHASE_ORDER">
10361                                         <context link="purchase_order" field="ordering_agency"/>
10362                                 </update>
10363                                 <delete permission="CREATE_PURCHASE_ORDER">
10364                                         <context link="purchase_order" field="ordering_agency"/>
10365                                 </delete>
10366                         </actions>
10367                 </permacrud>
10368         </class>
10369
10370         <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">
10371                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10372                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10373                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10374                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10375                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" oils_obj:required="true"/>
10376                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10377                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10378                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10379                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10380                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10381                         <field reporter:label="Target" name="target" reporter:datatype="int"/>
10382                 </fields>
10383                 <links>
10384                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10385                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10386                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10387                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10388                 </links>
10389                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10390                         <actions>
10391                                 <create permission="CREATE_PURCHASE_ORDER">
10392                                         <context link="purchase_order" field="ordering_agency"/>
10393                                 </create>
10394                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10395                                         <context link="purchase_order" field="ordering_agency"/>
10396                                 </retrieve>
10397                                 <update permission="CREATE_PURCHASE_ORDER">
10398                                         <context link="purchase_order" field="ordering_agency"/>
10399                                 </update>
10400                                 <delete permission="CREATE_PURCHASE_ORDER">
10401                                         <context link="purchase_order" field="ordering_agency"/>
10402                                 </delete>
10403                         </actions>
10404                 </permacrud>
10405         </class>
10406
10407         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10408                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10409                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id"/>
10410                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" oils_obj:required="true"/>
10411                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10412                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10413                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10414                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10415                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10416                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
10417                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10418                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10419                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp"/>
10420                         <field reporter:label="Status" name="state" reporter:datatype="link"/>
10421                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10422                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10423                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10424                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10425                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money"/>
10426                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link"/>
10427                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int"/>
10428                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
10429                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link"/>
10430                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link"/>
10431                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link"/>
10432                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10433                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link"/>
10434                 </fields>
10435                 <links>
10436                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10437                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10438                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10439                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10440                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10441                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10442                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10443                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10444                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10445                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10446                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10447                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10448                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10449                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10450                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10451                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10452                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10453                 </links>
10454                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10455                         <actions>
10456                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10457                                         <context link="purchase_order" field="ordering_agency"/>
10458                                         <context link="picklist" field="org_unit"/>
10459                                 </retrieve>
10460                         </actions>
10461                 </permacrud>
10462         </class>
10463
10464         <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">
10465                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10466                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id" oils_obj:required="true"/>
10467                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10468                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text" oils_obj:required="true"/>
10469                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link" oils_obj:required="true"/>
10470                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10471                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10472                         <field reporter:label="Selector" name="selector" reporter:datatype="link" oils_obj:required="true"/>
10473                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10474                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10475                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10476                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10477                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10478                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10479                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
10480                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10481                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10482                         <field reporter:label="Status" name="state" reporter:datatype="text" oils_obj:required="true"/>
10483                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10484                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10485                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money"/>
10486                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link"/>
10487                 </fields>
10488                 <links>
10489                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10490                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10491                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10492                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10493                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10494                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10495                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10496                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10497                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10498                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10499                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10500                 </links>
10501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10502                         <actions>
10503                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10504                                         <context link="purchase_order" field="ordering_agency"/>
10505                                         <context link="picklist" field="org_unit"/>
10506                                 </retrieve>
10507                         </actions>
10508                 </permacrud>
10509         </class>
10510
10511         <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">
10512                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10513                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10514                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10515                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10516                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
10517                 </fields>
10518                 <links>
10519                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10520                 </links>
10521                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10522                         <actions>
10523                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10524                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10525                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10526                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10527                         </actions>
10528                 </permacrud>
10529         </class>
10530
10531         <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">
10532                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10533                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id"/>
10534                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10535                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10536                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10537                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10538                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10539                         <field reporter:label="Note Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
10540                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link"/>
10541                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool"/>
10542                 </fields>
10543                 <links>
10544                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10545                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10546                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10547                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10548                 </links>
10549         </class>
10550
10551         <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">
10552                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10553                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id"/>
10554                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10555                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" oils_obj:required="true"/>
10556                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" oils_obj:required="true"/>
10557                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
10558                         <field reporter:label="Definition" name="definition" reporter:datatype="text" oils_obj:required="true"/>
10559                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool"/>
10560                 </fields>
10561                 <links>
10562                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10563                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10564                 </links>
10565         </class>
10566
10567         <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">
10568                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10569                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id"/>
10570                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10571                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link"/>
10572                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10573                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text"/>
10574                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp"/>
10575                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link"/>
10576                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10577                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10578                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10579                         <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
10580                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
10581                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10582                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
10583                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10584                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true"/>
10585                 </fields>
10586                 <links>
10587                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10588                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10589                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10590                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10591                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10592                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10593                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10594                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10595                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10596                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10597                 </links>
10598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10599                         <actions>
10600                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10601                                         <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10602                                         <context link="lineitem" jump="picklist" field="org_unit"/>
10603                                 </retrieve>
10604                         </actions>
10605                 </permacrud>
10606         </class>
10607
10608         <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">
10609                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10610                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10611                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10612                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10613                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10614                 </fields>
10615                 <links/>
10616                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10617                         <actions>
10618                                 <retrieve/>
10619                         </actions>
10620                 </permacrud>
10621         </class>
10622
10623         <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">
10624                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10625                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10626                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10627                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10628                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10629                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10630                         <field reporter:label="Remove" name="remove" reporter:datatype="text"/>
10631                 </fields>
10632                 <links/>
10633                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10634                         <actions>
10635                                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10636                                 <retrieve/>
10637                                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10638                                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10639                         </actions>
10640                 </permacrud>
10641         </class>
10642
10643         <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">
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" oils_obj:required="true"/>
10647                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10648                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10649                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10650                 </fields>
10651                 <links/>
10652         </class>
10653         <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">
10654                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10655                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10656                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10657                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10658                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
10659                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10660                 </fields>
10661                 <links>
10662                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10663                 </links>
10664         </class>
10665
10666         <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">
10667                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10668                 <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10669                 <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10670                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10671                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10672                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10673                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10674                 <field reporter:label="Remove" name="remove" reporter:datatype="text"/>
10675
10676                 </fields>
10677                 <links>
10678                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10679                 </links>
10680                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10681                                 <actions>
10682                                         <create permission="ADMIN_PROVIDER">
10683                                                 <context link="provider" field="owner"/>
10684                                         </create>
10685                                         <retrieve permission="ADMIN_PROVIDER">
10686                                                 <context link="provider" field="owner"/>
10687                                         </retrieve>
10688                                         <update permission="ADMIN_PROVIDER">
10689                                                 <context link="provider" field="owner"/>
10690                                         </update>
10691                                         <delete permission="ADMIN_PROVIDER">
10692                                                 <context link="provider" field="owner"/>
10693                                         </delete>
10694                                 </actions>
10695                         </permacrud>
10696         </class>
10697                 
10698         <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">
10699                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10700                 <field reporter:label="ID" name="id" reporter:datatype="id"/>
10701                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10702                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10703                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true"/>
10704                 </fields>
10705                 <links>
10706                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10707                 </links>
10708                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10709                                 <actions>
10710                                         <create permission="ADMIN_PROVIDER">
10711                                                 <context link="provider" field="owner"/>
10712                                         </create>
10713                                         <retrieve permission="ADMIN_PROVIDER">
10714                                                 <context link="provider" field="owner"/>
10715                                         </retrieve>
10716                                         <update permission="ADMIN_PROVIDER">
10717                                                 <context link="provider" field="owner"/>
10718                                         </update>
10719                                         <delete permission="ADMIN_PROVIDER">
10720                                                 <context link="provider" field="owner"/>
10721                                         </delete>
10722                                 </actions>
10723                         </permacrud>
10724         </class>
10725                 
10726         <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">
10727                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10728                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10729                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10730                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10731                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10732                 </fields>
10733                 <links/>
10734         </class>
10735
10736         <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">
10737                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10738                         <field name="id" reporter:datatype="id" reporter:label="EDI Account ID" reporter:selector="label"/>
10739                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10740                         <field name="host" reporter:datatype="text" reporter:label="Host" oils_obj:required="true"/>
10741                         <field name="username" reporter:datatype="text" reporter:label="Username"/>
10742                         <field name="password" reporter:datatype="text" reporter:label="Password"/>
10743                         <field name="account" reporter:datatype="text" reporter:label="Account"/>
10744                         <field name="path" reporter:datatype="text" reporter:label="Path"/>
10745                         <field name="owner" reporter:datatype="link" reporter:label="Owner" oils_obj:required="true"/>
10746                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10747                         <field name="provider" reporter:datatype="link" reporter:label="Provider" oils_obj:required="true"/>
10748                         <field name="in_dir" reporter:datatype="text" reporter:label="Incoming Directory"/>
10749                         <field name="vendacct" reporter:datatype="text" reporter:label="Vendor Account Number"/>
10750                         <field name="vendcode" reporter:datatype="text" reporter:label="Vendor Assigned Code"/>
10751                         <field name="attr_set" reporter:datatype="link" reporter:label="EDI Attribute Set"/>
10752                         <field name="use_attrs" reporter:datatype="bool" reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10753                 </fields>
10754                 <links>
10755                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10756                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10757                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10758                 </links>
10759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10760                         <actions>
10761                                 <create permission="ADMIN_PROVIDER">
10762                                         <context link="provider" field="owner"/>
10763                                 </create>
10764                                 <retrieve permission="ADMIN_PROVIDER">
10765                                         <context link="provider" field="owner"/>
10766                                 </retrieve>
10767                                 <update permission="ADMIN_PROVIDER">
10768                                         <context link="provider" field="owner"/>
10769                                 </update>
10770                                 <delete permission="ADMIN_PROVIDER">
10771                                         <context link="provider" field="owner"/>
10772                                 </delete>
10773                         </actions>
10774                 </permacrud>
10775         </class>
10776
10777         <class id="aea" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_attr" oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10778                 <fields oils_persist:primary="key">
10779                         <field name="key" reporter:datatype="text" reporter:label="Key" reporter:selector="label" oils_obj:required="true"/>
10780                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10781                 </fields>
10782                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10783                         <actions>
10784                                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10785                                 <retrieve/>
10786                                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10787                                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10788                         </actions>
10789                 </permacrud>
10790         </class>
10791         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_attr_set" oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10792                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10793                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="label"/>
10794                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10795                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10796                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10797                 </fields>
10798                 <links>
10799                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10800                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10801                 </links>
10802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10803                         <actions>
10804                                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10805                                 <retrieve/>
10806                                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10807                                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10808                         </actions>
10809                 </permacrud>
10810         </class>
10811         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_attr_set_map" oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10812                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10813                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="label"/>
10814                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set" oils_obj:required="true"/>
10815                         <field name="attr" reporter:datatype="link" reporter:label="Attribute" oils_obj:required="true"/>
10816                 </fields>
10817                 <links>
10818                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10819                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10820                 </links>
10821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10822                         <actions>
10823                                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10824                                 <retrieve/>
10825                                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10826                                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10827                         </actions>
10828                 </permacrud>
10829         </class>
10830
10831
10832         <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">
10833                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10834                         <field name="id" reporter:datatype="id" reporter:label="EDI Message ID"/>
10835                         <field name="account" reporter:datatype="link" reporter:label="EDI Account"/>
10836                         <field name="remote_file" reporter:datatype="text" reporter:label="Filename"/>
10837                         <field name="create_time" reporter:datatype="timestamp" reporter:label="Time Created"/>
10838                         <field name="translate_time" reporter:datatype="timestamp" reporter:label="Time Translated"/>
10839                         <field name="process_time" reporter:datatype="timestamp" reporter:label="Time Processed"/>
10840                         <field name="error_time" reporter:datatype="timestamp" reporter:label="Time of Error"/>
10841                         <field name="status" reporter:datatype="text" reporter:label="Status"/>
10842                         <field name="edi" reporter:datatype="text" reporter:label="EDI Message Body"/>
10843                         <field name="jedi" reporter:datatype="text" reporter:label="JEDI Message Body"/>
10844                         <field name="error" reporter:datatype="text" reporter:label="Error"/>
10845                         <field name="purchase_order" reporter:datatype="link" reporter:label="Purchase Order"/>
10846                         <field name="message_type" reporter:datatype="text" reporter:label="Message Type" oils_obj:required="true"/>
10847                 </fields>
10848                 <links>
10849                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10850                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10851                 </links>
10852                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10853                         <actions>
10854                                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10855                                         <context link="account" jump="provider" field="owner"/>
10856                                 </retrieve>
10857                                 <update permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10858                                         <context link="account" jump="provider" field="owner"/>
10859                                 </update>
10860                                 <delete permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10861                                         <context link="account" jump="provider" field="owner"/>
10862                                 </delete>
10863                         </actions>
10864                 </permacrud>
10865         </class>
10866
10867
10868         <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">
10869                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10870                         <field name="id" reporter:datatype="id"/>
10871                         <field name="parent" reporter:datatype="link"/>
10872                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10873                         <field name="create_time" reporter:datatype="timestamp"/>
10874                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10875                         <field name="shared" reporter:datatype="bool"/>
10876                         <field name="share_with" reporter:datatype="link"/>
10877                         <field name="simple_reporter" reporter:datatype="bool"/>
10878                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10879                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10880                 </fields>
10881                 <links>
10882                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10883                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10884                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10885                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10886                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10887                 </links>
10888                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10889                         <actions>
10890                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10891                                         <context link="owner" field="home_ou"/>
10892                                 </create>
10893                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10894                                         <context link="owner" field="home_ou"/>
10895                                 </retrieve>
10896                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10897                                         <context link="owner" field="home_ou"/>
10898                                 </update>
10899                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10900                                         <context link="owner" field="home_ou"/>
10901                                 </delete>
10902                         </actions>
10903                 </permacrud>
10904         </class>
10905         <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">
10906                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10907                         <field name="id" reporter:datatype="id"/>
10908                         <field name="parent" reporter:datatype="link"/>
10909                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10910                         <field name="create_time" reporter:datatype="timestamp"/>
10911                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10912                         <field name="shared" reporter:datatype="bool"/>
10913                         <field name="share_with" reporter:datatype="link"/>
10914                         <field name="simple_reporter" reporter:datatype="bool"/>
10915                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10916                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10917                 </fields>
10918                 <links>
10919                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10920                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10921                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10922                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10923                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10924                 </links>
10925                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10926                         <actions>
10927                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10928                                         <context link="owner" field="home_ou"/>
10929                                 </create>
10930                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10931                                         <context link="owner" field="home_ou"/>
10932                                 </retrieve>
10933                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10934                                         <context link="owner" field="home_ou"/>
10935                                 </update>
10936                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10937                                         <context link="owner" field="home_ou"/>
10938                                 </delete>
10939                         </actions>
10940                 </permacrud>
10941         </class>
10942         <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">
10943                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10944                         <field name="id" reporter:datatype="id"/>
10945                         <field name="parent" reporter:datatype="link"/>
10946                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10947                         <field name="create_time" reporter:datatype="timestamp"/>
10948                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10949                         <field name="shared" reporter:datatype="bool"/>
10950                         <field name="share_with" reporter:datatype="link"/>
10951                         <field name="simple_reporter" reporter:datatype="bool"/>
10952                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10953                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10954                 </fields>
10955                 <links>
10956                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10957                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10958                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10959                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10960                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10961                 </links>
10962                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10963                         <actions>
10964                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10965                                         <context link="owner" field="home_ou"/>
10966                                 </create>
10967                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10968                                         <context link="owner" field="home_ou"/>
10969                                 </retrieve>
10970                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10971                                         <context link="owner" field="home_ou"/>
10972                                 </update>
10973                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10974                                         <context link="owner" field="home_ou"/>
10975                                 </delete>
10976                         </actions>
10977                 </permacrud>
10978         </class>
10979         <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">
10980                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10981                         <field name="id" reporter:datatype="id"/>
10982                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10983                         <field name="create_time" reporter:datatype="timestamp"/>
10984                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10985                         <field name="data" reporter:datatype="text" oils_obj:required="true"/>
10986                         <field name="folder" reporter:datatype="link" oils_obj:required="true"/>
10987                         <field name="description" reporter:datatype="text"/>
10988                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10989                 </fields>
10990                 <links>
10991                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10992                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10993                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10994                 </links>
10995                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10996                         <actions>
10997                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10998                                         <context link="owner" field="home_ou"/>
10999                                 </create>
11000                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11001                                         <context link="owner" field="home_ou"/>
11002                                 </retrieve>
11003                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11004                                         <context link="owner" field="home_ou"/>
11005                                 </update>
11006                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11007                                         <context link="owner" field="home_ou"/>
11008                                 </delete>
11009                         </actions>
11010                 </permacrud>
11011         </class>
11012         <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">
11013                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11014                         <field name="id" reporter:datatype="id"/>
11015                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
11016                         <field name="create_time" reporter:datatype="timestamp"/>
11017                         <field name="template" reporter:datatype="link" oils_obj:required="true"/>
11018                         <field name="data" reporter:datatype="text" oils_obj:required="true"/>
11019                         <field name="folder" reporter:datatype="link" oils_obj:required="true"/>
11020                         <field name="recur" reporter:datatype="bool"/>
11021                         <field name="recurrence" reporter:datatype="interval"/>
11022                         <field name="name" reporter:datatype="text"/>
11023                         <field name="description" reporter:datatype="text"/>
11024                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11025                 </fields>
11026                 <links>
11027                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11028                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11029                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11030                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
11031                 </links>
11032                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11033                         <actions>
11034                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11035                                         <context link="owner" field="home_ou"/>
11036                                 </create>
11037                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11038                                         <context link="owner" field="home_ou"/>
11039                                 </retrieve>
11040                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11041                                         <context link="owner" field="home_ou"/>
11042                                 </update>
11043                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11044                                         <context link="owner" field="home_ou"/>
11045                                 </delete>
11046                         </actions>
11047                 </permacrud>
11048         </class>
11049         <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">
11050                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11051                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
11052                         <field reporter:label="Runner" name="runner" reporter:datatype="link" oils_obj:required="true"/>
11053                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11054                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11055                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11056                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11057                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11058                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11059                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11060                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11061                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11062                         <field reporter:label="Report" name="report" reporter:datatype="link" oils_obj:required="true"/>
11063                         <field reporter:label="Folder" name="folder" reporter:datatype="link" oils_obj:required="true"/>
11064                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11065                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11066                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11067                 </fields>
11068                 <links>
11069                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11070                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11071                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11072                 </links>
11073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11074                         <actions>
11075                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11076                                         <context link="runner" field="home_ou"/>
11077                                 </create>
11078                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11079                                         <context link="runner" field="home_ou"/>
11080                                 </retrieve>
11081                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11082                                         <context link="runner" field="home_ou"/>
11083                                 </update>
11084                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11085                                         <context link="runner" field="home_ou"/>
11086                                 </delete>
11087                         </actions>
11088                 </permacrud>
11089         </class>
11090         <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports" reporter:label="Completed Report Runs" oils_persist:readonly="true">
11091                 <fields oils_persist:primary="run">
11092                         <field reporter:label="Run" name="run" reporter:datatype="link"/>
11093                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11094                         <field reporter:label="Template" name="template" reporter:datatype="link"/>
11095                         <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11096                         <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11097                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11098                         <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11099                         <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11100                         <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11101                         <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11102                         <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11103                         <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11104                         <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11105                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11106                         <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11107                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11108                 </fields>
11109                 <links>
11110                         <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11111                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11112                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11113                         <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11114                         <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11115                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11116                         <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11117                         <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11118                         <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11119                 </links>
11120                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11121                         <actions>
11122                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11123                                         <context link="runner" field="home_ou"/>
11124                                 </retrieve>
11125                         </actions>
11126                 </permacrud>
11127         </class>
11128         <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">
11129                 <fields oils_persist:primary="id">
11130                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11131                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11132                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11133                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11134                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11135                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11136                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11137                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11138                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11139                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11140                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11141                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11142                 </fields>
11143                 <links>
11144                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11145                 </links>
11146                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11147                         <actions>
11148                                 <retrieve/>
11149                         </actions>
11150                 </permacrud>
11151         </class>
11152         <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">
11153                 <fields oils_persist:primary="id">
11154                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11155                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11156                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11157                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11158                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11159                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11160                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11161                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11162                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11163                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11164                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11165                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11166                 </fields>
11167                 <links>
11168                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11169                 </links>
11170         </class>
11171         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11172                 <fields oils_persist:primary="id">
11173                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11174                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11175                         <field reporter:label="Fingerprint" name="fingerprint"/>
11176                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11177                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11178                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11179                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11180                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11181                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11182                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11183                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11184                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11185                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11186                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11187                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11188                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11189                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11190                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11191                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11192                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11193                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11194                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11195                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11196                 </fields>
11197                 <links>
11198                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11199                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11200                 </links>
11201         </class>
11202         <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">
11203                 <fields oils_persist:primary="id">
11204                         <field reporter:label="User ID" name="id" reporter:datatype="id"/>
11205                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11206                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11207                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11208                 </fields>
11209                 <links>
11210                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11211                 </links>
11212         </class>
11213         <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">
11214                 <fields oils_persist:primary="id">
11215                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id"/>
11216                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11217                 </fields>
11218                 <links>
11219                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11220                 </links>
11221         </class>
11222         <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">
11223                 <fields oils_persist:primary="id">
11224                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11225                         <field reporter:label="Hold Target" name="target" reporter:datatype="int"/>
11226                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11227                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11228                 </fields>
11229                 <links>
11230                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11231                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11232                 </links>
11233                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11234                         <actions>
11235                                 <retrieve permission="VIEW_HOLD">
11236                                         <context link="id" field="pickup_lib"/>
11237                                 </retrieve>
11238                         </actions>
11239                 </permacrud>
11240         </class>
11241         <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">
11242                 <fields oils_persist:primary="xact">
11243                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int"/>
11244                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money"/>
11245                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11246                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11247                 </fields>
11248                 <links>
11249                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11250                 </links>
11251         </class>
11252         <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">
11253                 <fields oils_persist:primary="xact">
11254                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int"/>
11255                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money"/>
11256                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11257                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11258                 </fields>
11259                 <links>
11260                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11261                 </links>
11262         </class>
11263         <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)">
11264                 <fields oils_persist:primary="id">
11265                         <field reporter:label="Bib ID" name="id" reporter:datatype="id"/>
11266                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp"/>
11267                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text"/>
11268                 </fields>
11269                 <links>
11270                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11271                 </links>
11272         </class>
11273         <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">
11274                 <fields oils_persist:primary="id">
11275                         <field reporter:label="Copy ID" name="id" reporter:datatype="int"/>
11276                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int"/>
11277                 </fields>
11278                 <links>
11279                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11280                 </links>
11281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11282                         <actions>
11283                                 <retrieve permission="STAFF_LOGIN">
11284                                         <context link="id" field="circ_lib"/>
11285                                 </retrieve>
11286                         </actions>
11287                 </permacrud>
11288         </class>
11289         <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">
11290                 <fields oils_persist:primary="bibid">
11291                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id"/>
11292                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link"/>
11293                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11294                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp"/>
11295                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int"/>
11296                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int"/>
11297                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int"/>
11298                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int"/>
11299                 </fields>
11300                 <links>
11301                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11302                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11303                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11304                 </links>
11305         </class>
11306         <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">
11307                 <fields oils_persist:primary="copy_id">
11308                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11309                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11310                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11311                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11312                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11313                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11314                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11315                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11316                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11317                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11318                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11319                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11320                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11321                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11322                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11323                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11324                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11325                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11326                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11327                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11328                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11329                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11330                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11331                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11332                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11333                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11334                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11335                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11336                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11337                 </fields>
11338                 <links>
11339                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11340                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11341                 </links>
11342         </class>
11343         <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">
11344                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11345                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11346                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
11347                         <field reporter:label="Formula Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11348                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11349                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11350                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11351                 </fields>
11352                 <links>
11353                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11354                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11355                 </links>
11356                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11357                         <actions>
11358                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11359                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11360                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11361                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11362                         </actions>
11363                 </permacrud>
11364         </class>
11365         <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">
11366                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11367                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11368                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link" oils_obj:required="true"/>
11369                         <field reporter:label="Position" name="position" reporter:datatype="int" oils_obj:required="true"/>
11370                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" oils_obj:required="true"/>
11371                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11372                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11373                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11374                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11375                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11376                 </fields>
11377                 <links>
11378                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11379                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11380                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11381                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11382                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11383                 </links>
11384                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11385                         <actions>
11386                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11387                                         <context link="formula" field="owner"/>
11388                                 </create>
11389                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11390                                         <context link="formula" field="owner"/>
11391                                 </retrieve>
11392                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11393                                         <context link="formula" field="owner"/>
11394                                 </update>
11395                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11396                                         <context link="formula" field="owner"/>
11397                                 </delete>
11398                         </actions>
11399                 </permacrud>
11400         </class>
11401
11402         <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">
11403                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11404                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11405                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11406                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11407                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link" oils_obj:required="true"/>
11408                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
11409                 </fields>
11410                 <links>
11411                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11412                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11413                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11414                 </links>
11415                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11416                         <actions>
11417                                 <create permission="CREATE_PURCHASE_ORDER">
11418                                         <context link="formula" field="owner"/>
11419                                 </create>
11420                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11421                                         <context link="formula" field="owner"/>
11422                                 </retrieve>
11423                                 <update permission="CREATE_PURCHASE_ORDER">
11424                                         <context link="formula" field="owner"/>
11425                                 </update>
11426                                 <delete permission="CREATE_PURCHASE_ORDER">
11427                                         <context link="formula" field="owner"/>
11428                                 </delete>
11429                         </actions>
11430                 </permacrud>
11431         </class>
11432
11433         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11434                 <fields oils_persist:primary="id">
11435                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11436                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" oils_obj:required="true"/>
11437                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money" oils_obj:required="true"/>
11438                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11439                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11440                 </fields>
11441                 <links>
11442                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11443                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11444                 </links>
11445         </class>
11446
11447         <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">
11448                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11449                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code"/>
11450                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11451                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
11452                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11453                 </fields>
11454                 <links>
11455                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11456                 </links>
11457                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11458                         <actions>
11459                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11460                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11461                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11462                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11463                         </actions>
11464                 </permacrud>
11465         </class>
11466
11467         <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">
11468                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11469                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code"/>
11470                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11471                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
11472                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11473                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11474                 </fields>
11475                 <links>
11476                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11477                 </links>
11478                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11479                         <actions>
11480                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11481                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11482                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11483                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11484                         </actions>
11485                 </permacrud>
11486         </class>
11487
11488         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11489                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11490                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11491                         <field reporter:label="Claim Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11492                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link" oils_obj:required="true"/>
11493                 </fields>
11494                 <links>
11495                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11496                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11497                 </links>
11498         </class>
11499
11500         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11501                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11502                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11503                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11504                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11505                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11506                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11507                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11508                 </fields>
11509                 <links>
11510                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11511                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11512                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11513                 </links>
11514         </class>
11515
11516         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11517                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11518                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11519                         <field reporter:label="Claim Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11520                         <field reporter:label="Serial Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
11521                 </fields>
11522                 <links>
11523                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11524                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11525                 </links>
11526         </class>
11527
11528         <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">
11529                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11530                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11531                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11532                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11533                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11534                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11535                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11536                 </fields>
11537                 <links>
11538                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11539                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11540                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11541                 </links>
11542         </class>
11543
11544         <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">
11545                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11546                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11547                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11548                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11549                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11550                 </fields>
11551                 <links>
11552                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11553                 </links>
11554                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11555                         <actions>
11556                                 <create permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11557                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11558                                 <update permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11559                                 <delete permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11560                         </actions>
11561                 </permacrud>
11562         </class>
11563
11564         <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">
11565                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11566                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11567                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" oils_obj:required="true"/>
11568                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval" oils_obj:required="true"/>
11569                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link" oils_obj:required="true"/>
11570                 </fields>
11571                 <links>
11572                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11573                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11574                 </links>
11575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11576                         <actions>
11577                                 <create permission="ADMIN_CLAIM_POLICY">
11578                                         <context link="claim_policy" field="org_unit"/>
11579                                 </create>
11580                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11581                                         <context link="claim_policy" field="org_unit"/>
11582                                 </retrieve>
11583                                 <update permission="ADMIN_CLAIM_POLICY">
11584                                         <context link="claim_policy" field="org_unit"/>
11585                                 </update>
11586                                 <delete permission="ADMIN_CLAIM_POLICY">
11587                                         <context link="claim_policy" field="org_unit"/>
11588                                 </delete>
11589                         </actions>
11590                 </permacrud>
11591         </class>
11592
11593         <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11594                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11595                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11596                         <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11597                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11598                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11599                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11600                         <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11601                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11602                         <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11603                         <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11604                         <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11605                         <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11606                         <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11607                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11608                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11609                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11610                         <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11611                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11612                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11613                                                 <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text"/>
11614                 </fields>
11615                 <links>
11616                         <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11617                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11618                 </links>
11619         </class>
11620
11621         <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">
11622                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11623                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11624                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11625                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11626                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
11627                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11628                 </fields>
11629         </class>
11630
11631         <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">
11632                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11633                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11634                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11635                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11636                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11637                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11638                         <field reporter:label="City" name="city" reporter:datatype="text"/>
11639                         <field reporter:label="County" name="county" reporter:datatype="text"/>
11640                         <field reporter:label="State" name="state" reporter:datatype="text"/>
11641                         <field reporter:label="Country" name="country" reporter:datatype="text"/>
11642                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
11643                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11644                 </fields>
11645         </class>
11646
11647         <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">
11648                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11649                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11650                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11651                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11652                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11653                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11654                         <field reporter:label="City" name="city" reporter:datatype="text"/>
11655                         <field reporter:label="County" name="county" reporter:datatype="text"/>
11656                         <field reporter:label="State" name="state" reporter:datatype="text"/>
11657                         <field reporter:label="Country" name="country" reporter:datatype="text"/>
11658                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
11659                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11660                 </fields>
11661         </class>
11662
11663         <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">
11664                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11665                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11666                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11667                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11668                         <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text" oils_obj:required="true"/>
11669                         <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
11670                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11671                 </fields>
11672         </class>
11673
11674         <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">
11675                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11676                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11677                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11678                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11679                         <field reporter:label="User Setting Code" name="setting" reporter:datatype="text" oils_obj:required="true"/>
11680                         <field reporter:label="User Setting Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
11681                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11682                 </fields>
11683         </class>
11684
11685         <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">
11686                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11687                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11688                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11689                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11690                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11691                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11692                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11693                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11694                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11695                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11696                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
11697                 </fields>
11698                 <links>
11699                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11700                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11701                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11702                 </links>
11703                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11704                         <actions>
11705                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11706                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11707                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11708                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11709                         </actions>
11710                 </permacrud>
11711         </class>
11712
11713         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11714                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11715                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11716                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
11717                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
11718                         <field reporter:label="Status" name="status" reporter:datatype="text" oils_obj:required="true"/>
11719                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11720                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11721                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11722                         <field reporter:label="Class Name" name="classname" reporter:datatype="text" oils_obj:required="true"/>
11723                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11724                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11725                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11726                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11727                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11728                 </fields>
11729                 <links>
11730                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11731                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11732                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11733                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11734                 </links>
11735                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11736                         <actions>
11737                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11738                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11739                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11740                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11741                         </actions>
11742                 </permacrud>
11743         </class>
11744
11745         <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">
11746                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11747                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11748                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link" oils_obj:required="true"/>
11749                         <field reporter:label="Column Name" name="col" reporter:datatype="text" oils_obj:required="true"/>
11750                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11751                 </fields>
11752                 <links>
11753                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11754                 </links>
11755                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11756                         <actions>
11757                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11758                                         <context link="fieldset" field="owning_lib"/>
11759                                 </create>
11760                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11761                                         <context link="fieldset" field="owning_lib"/>
11762                                 </retrieve>
11763                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11764                                         <context link="fieldset" field="owning_lib"/>
11765                                 </update>
11766                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11767                                         <context link="fieldset" field="owning_lib"/>
11768                                 </delete>
11769                         </actions>
11770                 </permacrud>
11771         </class>
11772
11773         <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">
11774                 <fields>
11775                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11776                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11777                         <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11778                 </fields>
11779                 <links>
11780                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11781                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11782                 </links>
11783         </class>
11784
11785         <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">
11786                 <fields>
11787                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11788                         <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11789                 </fields>
11790                 <links>
11791                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11792                 </links>
11793         </class>
11794
11795         <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">
11796                 <fields>
11797                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11798                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11799                         <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11800                 </fields>
11801                 <links>
11802                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11803                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11804                 </links>
11805         </class>
11806
11807         <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">
11808                 <fields>
11809                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11810                         <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11811                 </fields>
11812                 <links>
11813                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11814                 </links>
11815         </class>
11816
11817         <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11818                 <oils_persist:source_definition><![CDATA[
11819
11820                 SELECT  DISTINCT l.*
11821                   FROM  action.unfulfilled_hold_loops l
11822                                 JOIN action.unfulfilled_hold_max_loop m USING (hold)
11823                   WHERE l.count = m.max
11824
11825                 ]]></oils_persist:source_definition>
11826                 <fields>
11827                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11828                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11829                         <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11830                 </fields>
11831                 <links>
11832                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11833                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11834                 </links>
11835         </class>
11836
11837         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11838                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11839                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11840                         <field reporter:label="Query type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11841                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11842                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11843                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11844                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11845                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11846                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11847                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11848                 </fields>
11849                 <links>
11850                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11851                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11852                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11853                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11854                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11855                 </links>
11856         </class>
11857
11858         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11859                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11860                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11861                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link" oils_obj:required="true"/>
11862                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11863                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link" oils_obj:required="true"/>
11864                 </fields>
11865                 <links>
11866                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11867                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11868                 </links>
11869         </class>
11870
11871         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11872                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11873                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11874                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text" oils_obj:required="true"/>
11875                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11876                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11877                 </fields>
11878                 <links>
11879                 </links>
11880         </class>
11881
11882         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11883                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11884                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11885                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link" oils_obj:required="true"/>
11886                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11887                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link" oils_obj:required="true"/>
11888                 </fields>
11889                 <links>
11890                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11891                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11892                 </links>
11893         </class>
11894         
11895         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11896                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11897                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11898                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text" oils_obj:required="true"/>
11899                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11900                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11901                 </fields>
11902                 <links>
11903                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11904                 </links>
11905         </class>
11906         
11907         <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">
11908                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11909                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11910                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link" oils_obj:required="true"/>
11911                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11912                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link" oils_obj:required="true"/>
11913                 </fields>
11914                 <links>
11915                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11916                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11917                 </links>
11918         </class>
11919
11920         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11921                 <fields oils_persist:primary="name">
11922                         <field reporter:label="Name" name="name" reporter:datatype="id" oils_obj:required="true"/>
11923                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
11924                         <field reporter:label="Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11925                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11926                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11927                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11928                 </fields>
11929                 <links>
11930                 </links>
11931         </class>
11932
11933         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11934                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11935                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11936                         <field reporter:label="Expression Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11937                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11938                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11939                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11940                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11941                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11942                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11943                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11944                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11945                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11946                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11947                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11948                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11949                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11950                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11951                 </fields>
11952                 <links>
11953                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11954                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11955                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11956                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11957                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11958                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11959                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11960                 </links>
11961         </class>
11962
11963         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11964                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11965                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11966                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link" oils_obj:required="true"/>
11967                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11968                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11969                         <field reporter:label="Result" name="result" reporter:datatype="link" oils_obj:required="true"/>
11970                 </fields>
11971                 <links>
11972                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11973                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11974                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11975                 </links>
11976         </class>
11977
11978         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11979                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11980                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11981                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11982                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11983                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11984                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11985                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11986                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11987                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11988                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11989                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11990                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11991                 </fields>
11992                 <links>
11993                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11994                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11995                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11996                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11997                 </links>
11998         </class>
11999
12000         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
12001                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
12002                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
12003                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link" oils_obj:required="true"/>
12004                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12005                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text" oils_obj:required="true"/>
12006                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link" oils_obj:required="true"/>
12007                 </fields>
12008                 <links>
12009                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12010                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12011                 </links>
12012         </class>
12013
12014         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12015                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12016                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12017                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link" oils_obj:required="true"/>
12018                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12019                         <field reporter:label="Expression" name="expression" reporter:datatype="link" oils_obj:required="true"/>
12020                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12021                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12022                 </fields>
12023                 <links>
12024                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12025                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12026                 </links>
12027         </class>
12028
12029         <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">
12030                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12031                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12032                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link" oils_obj:required="true"/>
12033                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12034                         <field reporter:label="Expression" name="expression" reporter:datatype="link" oils_obj:required="true"/>
12035                 </fields>
12036                 <links>
12037                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12038                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12039                 </links>
12040         </class>
12041
12042         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between 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="Left Operand" name="left_operand" reporter:datatype="link"/>
12049                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12050                 </fields>
12051                 <links>
12052                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12053                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12054                 </links>
12055         </class>
12056
12057         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable 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="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12064                 </fields>
12065                 <links>
12066                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12067                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12068                 </links>
12069         </class>
12070
12071         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12072                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12073                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12074                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12075                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12076                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12077                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12078                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12079                 </fields>
12080                 <links>
12081                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12082                 </links>
12083         </class>
12084
12085         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12086                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12087                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12088                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12089                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12090                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12091                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12092                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12093                 </fields>
12094                 <links>
12095                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12096                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12097                 </links>
12098         </class>
12099
12100         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12101                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12102                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12103                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12104                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12105                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12106                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12107                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12108                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12109                 </fields>
12110                 <links>
12111                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12112                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12113                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12114                 </links>
12115         </class>
12116
12117         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12118                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12119                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12120                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12121                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12122                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12123                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12124                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12125                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12126                 </fields>
12127                 <links>
12128                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12129                 </links>
12130         </class>
12131
12132         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12133                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12134                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12135                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12136                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12137                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12138                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12139                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12140                 </fields>
12141                 <links>
12142                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12143                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12144                 </links>
12145         </class>
12146
12147         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12148                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12149                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12150                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12151                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12152                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12153                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12154                         <field reporter:label="Function ID" name="function_id" 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="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12160                 </links>
12161         </class>
12162
12163         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12164                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12165                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12166                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12167                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12168                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12169                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12170                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
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                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12176                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12177                 </links>
12178         </class>
12179
12180         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12181                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12182                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12183                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12184                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12185                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12186                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12187                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12188                 </fields>
12189                 <links>
12190                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12191                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12192                 </links>
12193         </class>
12194
12195         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12196                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12197                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12198                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12199                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12200                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12201                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12202                 </fields>
12203                 <links>
12204                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12205                 </links>
12206         </class>
12207
12208         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12209                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12210                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12211                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12212                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12213                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12214                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12215                 </fields>
12216                 <links>
12217                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12218                 </links>
12219         </class>
12220
12221         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12222                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12223                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12224                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12225                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12226                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12227                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12228                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12229                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12230                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12231                 </fields>
12232                 <links>
12233                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12234                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12235                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12236                 </links>
12237         </class>
12238
12239         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12240                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12241                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12242                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12243                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12244                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12245                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12246                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12247                 </fields>
12248                 <links>
12249                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12250                 </links>
12251         </class>
12252
12253         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12254                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12255                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12256                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12257                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12258                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12259                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12260                 </fields>
12261                 <links>
12262                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12263                 </links>
12264         </class>
12265
12266         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12267                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12268                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12269                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12270                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12271                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12272                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12273                 </fields>
12274                 <links>
12275                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12276                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12277                 </links>
12278         </class>
12279
12280         <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">
12281                 <fields oils_persist:primary="id">
12282                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12283                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12284                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12285                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12286                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12287                 </fields>
12288                 <links>
12289                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12290                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12291                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12292                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12293                 </links>
12294         </class>
12295
12296         <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">
12297                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12298                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12299                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text" oils_obj:required="true"/>
12300                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
12301                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text" oils_obj:required="true"/>
12302                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int" oils_obj:required="true"/>
12303                         <field reporter:label="Length" name="length" reporter:datatype="int" oils_obj:required="true"/>
12304                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12305                 </fields>
12306                 <links/>
12307                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12308                         <actions>
12309                                 <retrieve/>
12310                         </actions>
12311                 </permacrud>
12312         </class>
12313
12314         <class id="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">
12315                 <fields oils_persist:primary="ptype_key">
12316                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id" oils_obj:required="true"/>
12317                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12318                 </fields>
12319                 <links/>
12320                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12321                         <actions>
12322                                 <retrieve/>
12323                         </actions>
12324                 </permacrud>
12325         </class>
12326
12327         <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">
12328                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12329                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12330                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link" oils_obj:required="true"/>
12331                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true"/>
12332                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int" oils_obj:required="true"/>
12333                         <field reporter:label="Length" name="length" reporter:datatype="int" oils_obj:required="true"/>
12334                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12335                 </fields>
12336                 <links>
12337                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12338                 </links>
12339                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12340                         <actions>
12341                                 <retrieve/>
12342                         </actions>
12343                 </permacrud>
12344         </class>
12345
12346         <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">
12347                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12348                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12349                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
12350                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link" oils_obj:required="true"/>
12351                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12352                 </fields>
12353                 <links>
12354                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12355                 </links>
12356                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12357                         <actions>
12358                                 <retrieve/>
12359                         </actions>
12360                 </permacrud>
12361         </class>
12362
12363         <!-- This is what you see in Catalog -> Link Checker -->
12364         <class id="uvsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::sessions_and_attempts" reporter:label="Combined URL Verify Sessions and Batches View" oils_persist:readonly="true">
12365                 <oils_persist:source_definition><![CDATA[
12366                         SELECT
12367                                 coalesce(uvva.id,-uvs.id) as id,
12368                                 uvs.id as session_id,
12369                                 uvs.name,
12370                                 uvs.owning_lib,
12371                                 uvs.creator,
12372                                 uvs.container,
12373                                 uvs.create_time,
12374                                 uvs.search,
12375                                 (select string_agg(xpath,',')
12376                                  from url_verify.url_selector uvus
12377                                  where uvus.session = uvs.id
12378                                  group by session) as selectors,
12379                                 uvva.id as batch_id,
12380                                 uvva.usr,
12381                                 uvva.start_time,
12382                                 uvva.finish_time
12383                         FROM
12384                                 url_verify.session uvs
12385                         LEFT JOIN
12386                                 url_verify.verification_attempt uvva
12387                         ON
12388                                 (uvs.id = uvva.session)
12389                 ]]></oils_persist:source_definition>
12390                 <fields oils_persist:primary="id">
12391                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12392                         <field reporter:label="Session ID" name="session_id" reporter:datatype="link"/>
12393                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12394                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12395                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12396                         <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12397                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12398                         <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12399                         <field reporter:label="Selectors" name="selectors" reporter:datatype="text" oils_obj:required="true"/>
12400                         <field reporter:label="Batch ID" name="batch_id" reporter:datatype="link"/>
12401                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12402                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12403                         <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12404                 </fields>
12405                 <links>
12406                         <link field="session_id" reltype="has_a" key="id" map="" class="uvs"/>
12407                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12408                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12409                         <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12410                         <link field="batch_id" reltype="has_a" key="id" map="" class="uvva"/>
12411                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12412                 </links>
12413                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12414                         <actions>
12415                                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12416                         </actions>
12417                 </permacrud>
12418         </class>
12419
12420         <!-- This is what gets created with Catalog -> Link Checker -> New Session -->
12421         <class id="uvs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session" oils_persist:tablename="url_verify.session" reporter:label="URL Verification Session">
12422                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12423                         <field reporter:label="Session ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12424                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12425                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12426                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12427                         <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12428                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12429                         <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12430                         <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12431                         <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12432                 </fields>
12433
12434                 <links>
12435                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12436                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12437                         <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12438                         <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12439                         <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12440                 </links>
12441
12442                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12443                         <actions>
12444                                 <create permission="URL_VERIFY" context_field="owning_lib"/>
12445                                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12446                                 <update permission="URL_VERIFY" context_field="owning_lib"/>
12447                                 <delete permission="URL_VERIFY" context_field="owning_lib"/>
12448                         </actions>
12449                 </permacrud>
12450
12451         </class>
12452
12453         <!-- A biblio bucket gets populated with search results from Catalog -> Link Checker -> New Session -->
12454         <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">
12455                 <oils_persist:source_definition><![CDATA[
12456                         SELECT
12457                                 cbrebi.id AS id,  -- so we can have a pkey in our view
12458                                 uvs.id AS session,
12459                                 uvs.owning_lib,
12460                                 cbrebi.target_biblio_record_entry
12461                         FROM url_verify.session uvs
12462                         JOIN container.biblio_record_entry_bucket cbreb
12463                                 ON (uvs.container = cbreb.id)
12464                         JOIN container.biblio_record_entry_bucket_item cbrebi
12465                                 ON (cbrebi.bucket = cbreb.id)
12466                 ]]></oils_persist:source_definition>
12467                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12468                         <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id"/>
12469                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12470                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12471                         <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link"/>
12472                 </fields>
12473                 <links>
12474                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
12475                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12476                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12477                 </links>
12478                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12479                         <actions>
12480                                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12481                         </actions>
12482                 </permacrud>
12483         </class>
12484
12485         <!-- Also created with Catalog -> Link Checker -> New Session -->
12486         <class id="uvus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::url_selector" oils_persist:tablename="url_verify.url_selector" reporter:label="URL Verification URL Selector">
12487                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12488                         <field reporter:label="URL Selector ID" name="id" reporter:datatype="id" reporter:selector="xpath"/>
12489                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12490                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12491                         <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12492                 </fields>
12493
12494                 <links>
12495                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12496                         <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12497                 </links>
12498
12499                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12500                         <actions>
12501                                 <create permission="URL_VERIFY">
12502                                         <context link="session" field="owning_lib"/>
12503                                 </create>
12504                                 <retrieve permission="URL_VERIFY">
12505                                         <context link="session" field="owning_lib"/>
12506                                 </retrieve>
12507                                 <update permission="URL_VERIFY">
12508                                         <context link="session" field="owning_lib"/>
12509                                 </update>
12510                                 <delete permission="URL_VERIFY">
12511                                         <context link="session" field="owning_lib"/>
12512                                 </delete>
12513                         </actions>
12514                 </permacrud>
12515
12516         </class>
12517
12518         <!-- URLs extracted by URL selectors -->
12519         <class id="uvu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::url" oils_persist:tablename="url_verify.url" reporter:label="URL Verification URL">
12520                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12521                         <field reporter:label="URL ID" name="id" reporter:datatype="id" reporter:selector="full_url"/>
12522                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12523                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12524                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12525                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12526                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12527                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12528                         <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12529                         <field reporter:label="URL" name="full_url" reporter:datatype="text" oils_obj:required="true"/>
12530                         <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12531                         <field reporter:label="Host" name="host" reporter:datatype="text"/>
12532                         <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12533                         <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12534                         <field reporter:label="Path" name="path" reporter:datatype="text"/>
12535                         <field reporter:label="Page" name="page" reporter:datatype="text"/>
12536                         <field reporter:label="Query" name="query" reporter:datatype="text"/>
12537                         <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12538                         <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true"/>
12539                 </fields>
12540
12541                 <links>
12542                         <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12543                         <link field="item" reltype="has_a" key="id" map="" class="uvsbrem"/>
12544                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12545                         <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12546                         <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12547                 </links>
12548
12549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12550                         <actions>
12551                                 <create permission="URL_VERIFY">
12552                                         <context link="session" field="owning_lib"/>
12553                                 </create>
12554                                 <retrieve permission="URL_VERIFY">
12555                                         <context link="session" field="owning_lib"/>
12556                                 </retrieve>
12557                                 <update permission="URL_VERIFY">
12558                                         <context link="session" field="owning_lib"/>
12559                                 </update>
12560                                 <delete permission="URL_VERIFY">
12561                                         <context link="session" field="owning_lib"/>
12562                                 </delete>
12563                         </actions>
12564                 </permacrud>
12565
12566         </class>
12567
12568         <!-- What we now call Batches in the UI -->
12569         <class id="uvva" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::verification_attempt" oils_persist:tablename="url_verify.verification_attempt" reporter:label="URL Verification Attempt">
12570                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12571                         <field reporter:label="Batch ID" name="id" reporter:datatype="id"/>
12572                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
12573                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12574                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12575                         <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12576                 </fields>
12577
12578                 <links>
12579                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12580                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12581                 </links>
12582
12583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12584                         <actions>
12585                                 <create permission="URL_VERIFY">
12586                                         <context link="session" field="owning_lib"/>
12587                                 </create>
12588                                 <retrieve permission="URL_VERIFY">
12589                                         <context link="session" field="owning_lib"/>
12590                                 </retrieve>
12591                                 <update permission="URL_VERIFY">
12592                                         <context link="session" field="owning_lib"/>
12593                                 </update>
12594                                 <delete permission="URL_VERIFY">
12595                                         <context link="session" field="owning_lib"/>
12596                                 </delete>
12597                         </actions>
12598                 </permacrud>
12599
12600         </class>
12601
12602         <!-- what we now call Attempts in the UI -->
12603         <class id="uvuv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::url_verification" oils_persist:tablename="url_verify.url_verification" reporter:label="URL Verification">
12604                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12605                         <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12606                         <field reporter:label="URL" name="url" reporter:datatype="link" oils_obj:required="true"/>
12607                         <field reporter:label="Batch" name="attempt" reporter:datatype="link" oils_obj:required="true"/>
12608                         <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12609                         <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12610                         <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12611                         <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12612                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12613                 </fields>
12614
12615                 <links>
12616                         <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12617                         <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12618                         <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12619                 </links>
12620
12621                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12622                         <actions>
12623                                 <create permission="URL_VERIFY">
12624                                         <context link="attempt" jump="session" field="owning_lib"/>
12625                                 </create>
12626                                 <retrieve permission="URL_VERIFY">
12627                                         <context link="attempt" jump="session" field="owning_lib"/>
12628                                 </retrieve>
12629                                 <update permission="URL_VERIFY">
12630                                         <context link="attempt" jump="session" field="owning_lib"/>
12631                                 </update>
12632                                 <delete permission="URL_VERIFY">
12633                                         <context link="attempt" jump="session" field="owning_lib"/>
12634                                 </delete>
12635                         </actions>
12636                 </permacrud>
12637
12638         </class>
12639
12640         <class id="cfdi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::filter_dialog_interface" oils_persist:tablename="config.filter_dialog_interface" reporter:label="FilterDialog Interface">
12641                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12642                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" oils_obj:required="true"/>
12643                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
12644                 </fields>
12645                 <links>
12646                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12647                 </links>
12648                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12649                         <actions>
12650                                 <retrieve/>
12651                         </actions>
12652                 </permacrud>
12653         </class>
12654
12655         <class id="cfdfs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::filter_dialog_filter_set" oils_persist:tablename="config.filter_dialog_filter_set" reporter:label="FilterDialog Filter Set">
12656                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12657                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12658                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12659                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12660                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12661                         <field reporter:label="Interface" name="interface" reporter:datatype="link" oils_obj:required="true"/>
12662                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12663                         <field reporter:label="Filters" name="filters" reporter:datatype="text" oils_obj:required="true"/>
12664                 </fields>
12665                 <links>
12666                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12667                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12668                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12669                 </links>
12670                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12671                         <actions>
12672                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12673                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12674                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12675                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12676                         </actions>
12677                 </permacrud>
12678
12679         </class>
12680
12681         <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">
12682                 <fields oils_persist:primary="code">
12683                         <field reporter:label="Code" name="code" reporter:datatype="id" oils_obj:required="true"/>
12684                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text" oils_obj:required="true"/>
12685                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text" oils_obj:required="true"/>
12686                 </fields>
12687                 <links/>
12688                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12689                         <actions>
12690                                 <retrieve/>
12691                         </actions>
12692                 </permacrud>
12693         </class>
12694
12695         <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">
12696                 <oils_persist:source_definition><![CDATA[
12697
12698                         SELECT  b.id,
12699                                         MAX(dcp.edit_date) AS last_delete_date
12700                          FROM   biblio.record_entry b
12701                                         JOIN asset.call_number cn ON (cn.record = b.id)
12702                                         JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12703                          WHERE  NOT b.deleted
12704                          GROUP BY b.id
12705                          HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12706
12707                 ]]></oils_persist:source_definition>
12708                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12709                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12710                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12711                 </fields>
12712                 <links>
12713                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12714                 </links>
12715                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12716                         <actions>
12717                                 <retrieve/>
12718                         </actions>
12719                 </permacrud>
12720         </class>
12721
12722         <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">
12723                 <fields oils_persist:primary="id">
12724                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12725                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12726                 </fields>
12727                         <links/>
12728                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12729                         <actions>
12730                                 <retrieve/>
12731                         </actions>
12732                 </permacrud>
12733         </class>
12734
12735         <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">
12736                 <fields oils_persist:primary="id">
12737                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12738                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12739                 </fields>
12740                         <links/>
12741                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12742                         <actions>
12743                                 <retrieve/>
12744                         </actions>
12745                 </permacrud>
12746         </class>
12747
12748
12749         <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">
12750                 <oils_persist:source_definition><![CDATA[
12751                                 SELECT
12752                                         x.id,
12753                                         COALESCE( y.copy_count, 0 ) AS copy_count,
12754                                         x.hold_count AS hold_count,
12755                                         CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12756                                 FROM
12757                                         (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12758                                                 FROM
12759                                                         action.hold_request ahr
12760                                                         JOIN reporter.hold_request_record rhrr USING (id)
12761                                                 WHERE
12762                                                         ahr.cancel_time IS NULL
12763                                                         AND ahr.fulfillment_time IS NULL
12764                                                 GROUP BY bib_record
12765                                         )x
12766                                         JOIN
12767                                         (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12768                                                 FROM
12769                                                         action.hold_request ahr
12770                                                         JOIN reporter.hold_request_record rhrr USING (id)
12771                                                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12772                                                 WHERE
12773                                                         ahr.cancel_time IS NULL
12774                                                         AND ahr.fulfillment_time IS NULL
12775                                                         AND ahr.capture_time IS NULL
12776                                                         AND ahr.frozen IS FALSE
12777                                                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12778                                                         AND ahr.hold_type != 'M'
12779                                                    GROUP BY bib_record
12780                                         )y
12781                                         USING (id)
12782                 ]]></oils_persist:source_definition>
12783                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12784                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12785                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12786                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12787                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12788                 </fields>
12789                 <links>
12790                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12791                 </links>
12792                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12793                         <actions>
12794                                 <retrieve/>
12795                         </actions>
12796                 </permacrud>
12797         </class>
12798
12799         <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">
12800                 <oils_persist:source_definition><![CDATA[
12801                         SELECT *,
12802                                 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,
12803                                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12804                         FROM
12805                                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12806                                         FROM
12807                                                 action.hold_request ahr
12808                                                 JOIN reporter.hold_request_record rhrr USING (id)
12809                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12810                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12811                                         WHERE
12812                                                 ahr.cancel_time IS NULL
12813                                                 AND ahr.fulfillment_time IS NULL
12814                                         GROUP BY bib_record, pickup_lib
12815                                 )x
12816                                 JOIN
12817                                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12818                                         FROM
12819                                                 action.hold_request ahr
12820                                                 JOIN reporter.hold_request_record rhrr USING (id)
12821                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12822                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12823                                         WHERE
12824                                                 ahr.cancel_time IS NULL
12825                                                 AND ahr.fulfillment_time IS NULL
12826                                                 AND ahr.capture_time IS NULL
12827                                                 AND ahr.frozen IS FALSE
12828                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12829                                                 AND ahr.hold_type != 'M'
12830                                         GROUP BY bib_record, pickup_lib
12831                                 )y
12832                                 USING(id,pickup_lib)
12833                                 JOIN
12834                                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12835                                         FROM
12836                                                 action.hold_request ahr
12837                                                 JOIN reporter.hold_request_record rhrr USING (id)
12838                                         WHERE
12839                                                 ahr.cancel_time IS NULL
12840                                                 AND ahr.fulfillment_time IS NULL
12841                                         GROUP BY bib_record
12842                                 )z
12843                                 USING (id)
12844                                 JOIN
12845                                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12846                                         FROM
12847                                                 action.hold_request ahr
12848                                                 JOIN reporter.hold_request_record rhrr USING (id)
12849                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12850                                         WHERE
12851                                                 ahr.cancel_time IS NULL
12852                                                 AND ahr.fulfillment_time IS NULL
12853                                                 AND ahr.capture_time IS NULL
12854                                                 AND ahr.frozen IS FALSE
12855                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12856                                                 AND ahr.hold_type != 'M'
12857                                                 GROUP BY bib_record
12858                                 )u
12859                                 USING (id)
12860                 ]]></oils_persist:source_definition>
12861                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12862                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12863                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12864                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12865                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12866                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12867                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12868                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12869                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12870                 </fields>
12871                 <links>
12872                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12873                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12874                 </links>
12875                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12876                         <actions>
12877                                 <retrieve/>
12878                         </actions>
12879                 </permacrud>
12880         </class>
12881
12882         <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">
12883                 <oils_persist:source_definition><![CDATA[
12884                         SELECT *,
12885                                 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,
12886                                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12887                         FROM
12888                                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12889                                         FROM
12890                                                 action.hold_request ahr
12891                                                 JOIN actor.usr au ON (ahr.usr = au.id)
12892                                                 JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.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 AND au.home_ou = ac.circ_lib)
12895                                         WHERE
12896                                                 ahr.cancel_time IS NULL
12897                                                 AND ahr.fulfillment_time IS NULL
12898                                         GROUP BY bib_record, home_ou
12899                                 )x
12900                                 JOIN
12901                                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12902                                         FROM
12903                                                 action.hold_request ahr
12904                                                 JOIN actor.usr au ON (ahr.usr = au.id)
12905                                                 JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12906                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12907                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12908                                         WHERE
12909                                                 ahr.cancel_time IS NULL
12910                                                 AND ahr.fulfillment_time IS NULL
12911                                                 AND ahr.capture_time IS NULL
12912                                                 AND ahr.frozen IS FALSE
12913                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12914                                                 AND ahr.hold_type != 'M'
12915                                         GROUP BY bib_record, home_ou
12916                                 )y
12917                                 USING (id,home_ou)
12918                                 JOIN
12919                                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12920                                         FROM
12921                                                 action.hold_request ahr
12922                                                 JOIN reporter.hold_request_record rhrr USING (id)
12923                                         WHERE
12924                                                 ahr.cancel_time IS NULL
12925                                                 AND ahr.fulfillment_time IS NULL
12926                                         GROUP BY bib_record
12927                                 )z
12928                                 USING (id)
12929                                 JOIN
12930                                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12931                                         FROM
12932                                                 action.hold_request ahr
12933                                                 JOIN reporter.hold_request_record rhrr USING (id)
12934                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12935                                         WHERE
12936                                                 ahr.cancel_time IS NULL
12937                                                 AND ahr.fulfillment_time IS NULL
12938                                                 AND ahr.capture_time IS NULL
12939                                                 AND ahr.frozen IS FALSE
12940                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12941                                                 AND ahr.hold_type != 'M'
12942                                         GROUP BY bib_record
12943                                 )u
12944                                 USING (id)
12945         ]]></oils_persist:source_definition>
12946         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12947                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12948                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12949                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12950                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12951                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12952                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12953                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12954                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12955         </fields>
12956         <links>
12957                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12958                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12959         </links>
12960         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12961                 <actions>
12962                         <retrieve/>
12963                 </actions>
12964         </permacrud>
12965 </class>
12966
12967         <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) ">
12968                 <oils_persist:source_definition><![CDATA[
12969                                 WITH counts_at_ou AS (
12970                                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12971                                 FROM
12972                                         (SELECT rhrr.bib_record AS id,
12973                                                         aou.id AS pickup_lib_or_desc,
12974                                                         COUNT(DISTINCT ahr.id) AS holds_at_or_below
12975                                            FROM actor.org_unit aou
12976                                                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12977                                                         action.hold_request ahr
12978                                                         JOIN reporter.hold_request_record rhrr USING (id)
12979                                                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12980                                                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12981                                           WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12982                                                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12983                                                         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
12984                                           GROUP BY 1, 2
12985                                 ) a
12986                                 JOIN
12987                                         (SELECT rhrr.bib_record AS id,
12988                                                         aou.id AS pickup_lib_or_desc,
12989                                                         COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12990                                            FROM actor.org_unit aou
12991                                                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12992                                                         action.hold_request ahr
12993                                                         JOIN reporter.hold_request_record rhrr USING (id)
12994                                                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12995                                                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12996                                           WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12997                                                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12998                                                         AND ahr.hold_type != 'M'
12999                                                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13000                                                         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
13001                                           GROUP BY 1, 2
13002                                 ) b
13003                                 USING (id,pickup_lib_or_desc)
13004                         )
13005                         SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13006                                    y.holds_everywhere, z.copy_count_everywhere,
13007                                 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,
13008                                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13009                         FROM counts_at_ou x
13010                                 JOIN
13011                                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13012                                         FROM
13013                                                 action.hold_request ahr
13014                                                 JOIN reporter.hold_request_record rhrr USING (id)
13015                                         WHERE
13016                                                 ahr.cancel_time IS NULL
13017                                                 AND ahr.fulfillment_time IS NULL
13018                                         GROUP BY bib_record
13019                                 )y
13020                                 USING (id)
13021                                 JOIN
13022                                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13023                                         FROM
13024                                                 action.hold_request ahr
13025                                                 JOIN reporter.hold_request_record rhrr USING (id)
13026                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13027                                         WHERE
13028                                                 ahr.cancel_time IS NULL
13029                                                 AND ahr.fulfillment_time IS NULL
13030                                                 AND ahr.capture_time IS NULL
13031                                                 AND ahr.frozen IS FALSE
13032                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
13033                                                 AND ahr.hold_type != 'M'
13034                                                 GROUP BY bib_record
13035                                 )z
13036                                 USING (id)
13037                 ]]></oils_persist:source_definition>
13038                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13039                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13040                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13041                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13042                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13043                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13044                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13045                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13046                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13047                 </fields>
13048                 <links>
13049                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13050                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13051                 </links>
13052                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13053                         <actions>
13054                                 <retrieve/>
13055                         </actions>
13056                 </permacrud>
13057         </class>
13058
13059         <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">
13060                 <oils_persist:source_definition><![CDATA[
13061                         SELECT
13062                                 ac.id,
13063                                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13064                                 MAX(actac.xact_start) AS last_circ
13065                         FROM asset.copy ac
13066                                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13067                         GROUP BY ac.id
13068
13069                         -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13070                         --SELECT
13071                         --      ac.id,
13072                         --      GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13073                         --      GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13074                         --FROM asset.copy ac
13075                         --       LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13076                         --       LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13077                         --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13078                 ]]></oils_persist:source_definition>
13079                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13080                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13081                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13082                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13083                 </fields>
13084                 <links>
13085                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13086                 </links>
13087                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13088                         <actions>
13089                                 <retrieve/>
13090                         </actions>
13091                 </permacrud>
13092         </class>
13093
13094         <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">
13095                 <fields oils_persist:primary="id">
13096                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id" oils_obj:required="true"/>
13097                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name" oils_obj:required="true"/>
13098                 </fields>
13099                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13100                         <actions>
13101                                 <retrieve/>
13102                         </actions>
13103                 </permacrud>
13104         </class>
13105
13106         <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">
13107                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13108                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13109                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class" oils_obj:required="true"/>
13110                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config" oils_obj:required="true"/>
13111                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13112                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13113                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13114                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13115                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13116                 </fields>
13117                 <links>
13118                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13119                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13120                 </links>
13121                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13122                         <actions>
13123                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13124                                 <retrieve/>
13125                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13126                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13127                         </actions>
13128                 </permacrud>
13129         </class>
13130
13131         <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">
13132                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13133                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13134                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field" oils_obj:required="true"/>
13135                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config" oils_obj:required="true"/>
13136                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13137                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13138                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13139                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13140                 </fields>
13141                 <links>
13142                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13143                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13144                 </links>
13145                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13146                         <actions>
13147                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13148                                 <retrieve/>
13149                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13150                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13151                         </actions>
13152                 </permacrud>
13153         </class>
13154
13155
13156         <!-- ********************************************************************************************************************* -->
13157         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13158         <!-- ********************************************************************************************************************* -->
13159         <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">
13160                 <fields oils_persist:primary="id">
13161                         <field reporter:label="Circulation" name="id" reporter:datatype="id"/>
13162                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13163                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13164                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13165                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13166                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13167                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13168                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13169                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13170                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13171                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13172                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13173                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13174                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13175                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13176                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13177                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13178                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13179                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13180                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13181                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13182                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13183                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13184                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13185                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13186                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13187                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13188                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13189                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13190                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13191                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13192                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13193                 </fields>
13194                 <links>
13195                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13196                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13197                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13198                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13199                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13200                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13201                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13202                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13203                 </links>
13204         </class>
13205
13206         <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">
13207                 <fields oils_persist:primary="id">
13208                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id"/>
13209                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13210                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13211                 </fields>
13212                 <links>
13213                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13214                 </links>
13215         </class>
13216
13217         <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">
13218                 <fields oils_persist:primary="id">
13219                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id"/>
13220                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13221                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13222                 </fields>
13223                 <links>
13224                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13225                 </links>
13226         </class>
13227
13228         <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">
13229                 <fields oils_persist:primary="id">
13230                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
13231
13232                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13233                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13234                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13235
13236                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13237                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13238                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13239
13240                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13241                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13242
13243                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13244                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13245                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13246
13247                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13248                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13249
13250                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13251                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13252                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13253
13254                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13255                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13256                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13257
13258                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13259                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13260                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13261                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13262
13263                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13264                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13265
13266                 </fields>
13267                 <links>
13268                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13269                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13270                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13271                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13272                 </links>
13273         </class>
13274
13275         <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">
13276                 <oils_persist:source_definition><![CDATA[
13277
13278                         SELECT
13279                                 po.ordering_agency AS ordering_agency,
13280                                 po.id AS purchase_order,
13281                                 li.id AS lineitem,
13282                                 lid.id AS lineitem_detail,
13283                                 cpa.id AS claim_policy_action
13284                         FROM
13285                                 acq.lineitem_detail lid
13286                                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13287                                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13288                                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13289                                 JOIN acq.claim_policy_action cpa ON (
13290                                         cpa.claim_policy = cp.id
13291
13292                                         -- we only care about claim policy actions whose claim
13293                                         -- interval we'd reached or exceeded
13294                                         AND (NOW() - cpa.action_interval) > po.order_date
13295
13296                                         -- filter out all claim policy actions where claim events
13297                                         -- have occurred on or after the action's action_interval
13298                                         AND NOT EXISTS (
13299                                                 SELECT 1
13300                                                 FROM
13301                                                         acq.claim_event evt
13302                                                         JOIN acq.claim claim ON (
13303                                                                 claim.id = evt.claim
13304                                                                 AND claim.lineitem_detail = lid.id
13305                                                         )
13306                                                 WHERE
13307                                                         evt.event_date >= (po.order_date + cpa.action_interval)
13308                                         )
13309                                 )
13310                         WHERE
13311                                 lid.cancel_reason IS NULL
13312                                 AND li.cancel_reason IS NULL -- belt/suspenders
13313                                 AND po.cancel_reason IS NULL -- belt/suspenders
13314                                 AND lid.recv_time IS NULL
13315                                 AND po.state = 'on-order'
13316                         ORDER BY 1, 2, 3, 4, 5
13317
13318                 ]]></oils_persist:source_definition>
13319                 <fields>
13320                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13321                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13322                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13323                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13324                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13325                 </fields>
13326                 <links>
13327                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13328                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13329                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13330                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13331                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13332                 </links>
13333         </class>
13334         <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">
13335                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13336                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13337                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13338                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13339                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13340                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13341                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13342                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13343                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13344                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13345                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13346                 </fields>
13347                 <links>
13348                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13349                 </links>
13350         </class>
13351         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13352                 <oils_persist:source_definition><![CDATA[
13353                         SELECT * FROM acq.lineitem_summary 
13354                                 WHERE item_count > (invoice_count + cancel_count)
13355                 ]]></oils_persist:source_definition>
13356                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13357                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13358                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13359                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13360                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13361                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13362                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13363                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13364                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13365                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13366                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13367                 </fields>
13368                 <links>
13369                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13370                 </links>
13371         </class>
13372         <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">
13373                 <oils_persist:source_definition><![CDATA[
13374
13375                         SELECT  t.*
13376                           FROM  action.transit_copy t
13377                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13378                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13379                           WHERE s.parent_ou <> d.parent_ou
13380
13381                 ]]></oils_persist:source_definition>
13382                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13383                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13384                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13385                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13386                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13387                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13388                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13389                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13390                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13391                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13392                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13393                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13394                 </fields>
13395                 <links>
13396                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13397                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13398                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13399                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13400                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13401                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13402                 </links>
13403         </class>
13404
13405         <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13406                 <oils_persist:source_definition><![CDATA[
13407
13408         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13409                 SELECT
13410                         cp.id as copy,
13411                         COUNT(circ.id),
13412                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13413                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13414                 FROM
13415                         asset.copy cp
13416                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13417                 GROUP BY 1, 3, 4
13418                 UNION ALL
13419                 SELECT
13420                         cp.id as copy,
13421                         COUNT(circ.id),
13422                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13423                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13424                 FROM
13425                         asset.copy cp
13426                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13427                 GROUP BY 1, 3, 4
13428                 UNION ALL
13429                 SELECT
13430                         id as copy,
13431                         circ_count,
13432                         -1 AS year,
13433                         false as is_renewal
13434                 FROM
13435                         extend_reporter.legacy_circ_count
13436         )x GROUP BY 1, 3, 4
13437
13438                 ]]></oils_persist:source_definition>
13439                 <fields>
13440                         <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13441                         <field reporter:label="Count" name="count" reporter:datatype="int"/>
13442                         <field reporter:label="Year" name="year" reporter:datatype="int"/>
13443                         <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13444                 </fields>
13445                 <links>
13446                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13447                 </links>
13448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13449                         <actions>
13450                                 <retrieve/>
13451                         </actions>
13452                 </permacrud>
13453         </class>
13454
13455         <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">
13456                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13457                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13458                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13459                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13460                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13461                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13462                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13463                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13464                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13465                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13466                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13467                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
13468                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
13469                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13470                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13471                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13472                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
13473                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13474                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
13475                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13476                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13477                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13478                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13479                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13480                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13481                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13482                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13483                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13484                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13485                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13486                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13487                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13488                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
13489                 </fields>
13490                 <links>
13491                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13492                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13493                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13494                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13495                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13496                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13497                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13498                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13499                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13500                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13501                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13502                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13503                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13504                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13505                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13506                 </links>
13507         </class>
13508
13509         <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">
13510                 <fields oils_persist:primary="id">
13511                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
13512                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
13513                         <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13514                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13515                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
13516                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13517                         <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13518                         <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13519                         <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13520                         <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13521                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13522                         <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13523                         <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13524                         <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13525                         <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13526                         <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13527                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13528                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13529                         <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13530                         <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13531                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13532                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13533                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13534                         <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13535                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13536                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13537                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13538                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13539                         <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13540                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
13541                         <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13542                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13543                         <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13544                         <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13545                 </fields>
13546                 <links>
13547                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13548                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13549                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13550                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13551                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13552                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13553                         <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13554                 <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13555                 </links>
13556         </class>
13557
13558         <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">
13559                 <fields oils_persist:primary="id">
13560                         <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13561                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13562                         <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13563                         <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13564                 </fields>
13565                 <links>
13566                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13567                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13568                 </links>
13569         </class>
13570
13571         <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">
13572                 <fields oils_persist:primary="owning_lib">
13573                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13574                         <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13575                         <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13576                 </fields>
13577                 <links>
13578                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13579                 </links>
13580         </class>
13581
13582         <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">
13583                 <fields oils_persist:primary="id">
13584                         <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13585                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13586                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13587                         <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13588                         <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13589                 </fields>
13590                 <links>
13591                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13592                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13593                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13594                 </links>
13595         </class>
13596
13597         <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">
13598                 <fields oils_persist:primary="circ_lib">
13599                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13600                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13601                         <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13602                         <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13603                 </fields>
13604                 <links>
13605                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13606                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13607                 </links>
13608         </class>
13609
13610         <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">
13611                 <fields oils_persist:primary="id">
13612                         <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13613                         <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13614                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13615                         <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13616                         <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13617                 </fields>
13618                 <links>
13619                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13620                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13621                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13622                 </links>
13623         </class>
13624
13625         <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">
13626                 <fields oils_persist:primary="home_ou">
13627                         <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13628                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13629                         <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13630                         <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13631                 </fields>
13632                 <links>
13633                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13634                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13635                 </links>
13636         </class>
13637         <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">
13638                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13639                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13640                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13641                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13642                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13643                 </fields>
13644                 <links>
13645                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13646                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13647                 </links>
13648                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13649                         <actions>
13650                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13651                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13652                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13653                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13654                         </actions>
13655                 </permacrud>
13656         </class>
13657         <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">
13658                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13659                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13660                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" oils_obj:required="true"/>
13661                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13662                 </fields>
13663                 <links>
13664                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13665                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13666                         </links>
13667                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13668                         <actions>
13669                                 <create permission="ADMIN_ACQ_FUND_TAG">
13670                                         <context link="tag" field="owner"/>
13671                                 </create>
13672                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13673                                         <context link="tag" field="owner"/>
13674                                 </retrieve>
13675                                 <update permission="ADMIN_ACQ_FUND_TAG">
13676                                         <context link="tag" field="owner"/>
13677                                 </update>
13678                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13679                                         <context link="tag" field="owner"/>
13680                                 </delete>
13681                         </actions>
13682                 </permacrud>
13683         </class>
13684         <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">
13685                 <oils_persist:source_definition><![CDATA[
13686                 SELECT
13687                         poi.purchase_order AS purchase_order,
13688                         ii.invoice AS invoice,
13689                         NULL AS lineitem,
13690                         poi.id AS po_item,
13691                         NULL AS picklist
13692                 FROM
13693                         acq.po_item poi
13694                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13695                 UNION SELECT
13696                         jub.purchase_order AS purchase_order,
13697                         ie.invoice AS invoice,
13698                         jub.id AS lineitem,
13699                         NULL AS po_item,
13700                         jub.picklist AS picklist
13701                 FROM
13702                         acq.lineitem jub
13703                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13704                 UNION SELECT
13705                         ii.purchase_order AS purchase_order,
13706                         ii.invoice AS invoice,
13707                         NULL AS lineitem,
13708                         NULL AS po_item,
13709                         NULL AS picklist
13710                 FROM
13711                         acq.invoice_item ii
13712                 WHERE ii.po_item IS NULL
13713                 UNION SELECT
13714                         ie.purchase_order AS purchase_order,
13715                         ie.invoice AS invoice,
13716                         NULL AS lineitem,
13717                         NULL AS po_item,
13718                         NULL AS picklist
13719                 FROM
13720                         acq.invoice_entry ie
13721                 WHERE ie.lineitem IS NULL
13722                 UNION SELECT
13723                         NULL AS purchase_order,
13724                         NULL AS invoice,
13725                         jub.id AS lineitem,
13726                         NULL AS po_item,
13727                         jub.picklist AS picklist
13728                 FROM
13729                         acq.lineitem jub
13730                 WHERE jub.purchase_order IS NULL
13731                 ]]></oils_persist:source_definition>
13732                 <fields>
13733                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13734                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13735                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13736                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13737                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13738                 </fields>
13739                 <links>
13740                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13741                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13742                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
13743                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
13744                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
13745                 </links>
13746         </class>
13747         <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">
13748                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13749                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13750                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13751                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
13752                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13753                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13754                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13755                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13756                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13757                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13758                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13759                 </fields>
13760                 <links>
13761                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13762                 </links>
13763                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13764                         <actions>
13765                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13766                                 <retrieve/>
13767                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13768                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13769                         </actions>
13770                 </permacrud>
13771         </class>
13772
13773         <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">
13774                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13775                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13776                         <field name="date_applied" reporter:datatype="timestamp"/>
13777                         <field name="org" reporter:datatype="org_unit"/>
13778                         <field name="original_value" reporter:datatype="text"/>
13779                         <field name="new_value" reporter:datatype="text"/>
13780                         <field name="field_name" reporter:datatype="link"/>
13781                 </fields>
13782                 <links>
13783                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13784                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13785                 </links>
13786         </class>
13787         <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">
13788                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13789                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13790                         <field reporter:label="Circ" name="xact" reporter:datatype="link" oils_obj:required="true"/>
13791                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
13792                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13793                 </fields>
13794                 <links>
13795                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13796                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13797                 </links>
13798         </class>
13799         <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">
13800                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13801                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13802                         <field reporter:label="Circ" name="xact" reporter:datatype="link" oils_obj:required="true"/>
13803                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
13804                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13805                 </fields>
13806                 <links>
13807                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13808                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13809                 </links>
13810         </class>
13811         <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">
13812                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13813                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13814                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13815                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13816                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13817                 </fields>
13818                 <links>
13819                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13820                 </links>
13821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13822                         <actions>
13823                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13824                                 <retrieve/>
13825                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13826                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13827                         </actions>
13828                 </permacrud>
13829         </class>
13830         <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">
13831                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13832                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13833                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13834                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13835                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13836                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13837                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13838                 </fields>
13839                 <links>
13840                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13841                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13842                 </links>
13843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13844                         <actions>
13845                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13846                                 <retrieve/>
13847                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13848                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13849                         </actions>
13850                 </permacrud>
13851         </class>
13852         <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">
13853                 <fields oils_persist:primary="code">
13854                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13855                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13856                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13857                 </fields>
13858                 <links>
13859                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13860                 </links>
13861                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13862                         <actions>
13863                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13864                                 <retrieve/>
13865                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13866                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13867                         </actions>
13868                 </permacrud>
13869         </class>
13870         <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">
13871                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13872                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13873                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13874                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13875                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13876                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13877                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13878                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13879                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13880                 </fields>
13881                 <links>
13882                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13883                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13884                 </links>
13885                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13886                         <actions>
13887                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13888                                 <retrieve/>
13889                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13890                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13891                         </actions>
13892                 </permacrud>
13893         </class>
13894         <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">
13895                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13896                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13897                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13898                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13899                 </fields>
13900                 <links>
13901                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13902                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13903                 </links>
13904                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13905                         <actions>
13906                                 <create permission="UPDATE_COPY">
13907                                         <context link="copy" field="circ_lib"/>
13908                                 </create>
13909                                 <retrieve/>
13910                                 <update permission="UPDATE_COPY">
13911                                         <context link="copy" field="circ_lib"/>
13912                                 </update>
13913                                 <delete permission="UPDATE_COPY">
13914                                         <context link="copy" field="circ_lib"/>
13915                                 </delete>
13916                         </actions>
13917                 </permacrud>
13918         </class>
13919         <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">
13920                 <oils_persist:source_definition><![CDATA[
13921         SELECT ahcm.target_copy AS id,count(*) AS count
13922          FROM
13923          action.hold_request ahr,
13924          action.hold_copy_map ahcm
13925          WHERE
13926          ahr.cancel_time IS NULL AND
13927          ahr.fulfillment_time IS NULL AND
13928          ahr.capture_time IS NULL AND
13929          ahr.id = ahcm.hold
13930          GROUP BY ahcm.target_copy
13931                 ]]></oils_persist:source_definition>
13932                 <fields oils_persist:primary="id">
13933                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13934                         <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13935                 </fields>
13936         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13937                         <actions>
13938                            <retrieve/>
13939                         </actions>
13940         </permacrud>
13941                 </class>
13942
13943         <class id="cwst" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::workstation_setting_type" oils_persist:tablename="config.workstation_setting_type" reporter:label="Workstation Setting Type">
13944                 <fields oils_persist:primary="name">
13945                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13946                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
13947                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13948                         <field name="datatype" reporter:datatype="text"/>
13949                         <field name="fm_class" reporter:datatype="text"/>
13950                         <field name="grp" reporter:datatype="link"/>
13951                 </fields>
13952                 <links>
13953                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13954                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13955                 </links>
13956                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13957                         <actions>
13958                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13959                                 <retrieve/>
13960                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13961                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13962                         </actions>
13963                 </permacrud>
13964         </class>
13965
13966         <!-- no pcrud access is granted for now, because it's assumed these
13967                          setting values will be applied and retrived via the API. -->
13968         <class id="awss" controller="open-ils.cstore" oils_obj:fieldmapper="actor::workstation_setting" oils_persist:tablename="actor.workstation_setting" reporter:label="Workstation Setting">
13969                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13970                         <field reporter:label="Setting ID" name="id" reporter:datatype="id"/>
13971                         <field reporter:label="Name" name="name" reporter:datatype="link" oils_obj:required="true"/>
13972                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13973                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link" oils_obj:required="true"/>
13974                 </fields>
13975                 <links>
13976                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13977                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13978                 </links>
13979         </class>
13980
13981         <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">
13982                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13983                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
13984                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13985                         <field name="hold_type" reporter:datatype="text" oils_persist:i18n="true"/>
13986                 </fields>
13987         </class>
13988
13989         <class id="cpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::print_template" oils_persist:tablename="config.print_template" reporter:label="Print Templates">
13990                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13991                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
13992                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13993                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13994                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13995                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13996                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13997                         <field name="content_type" reporter:datatype="text"/>
13998                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13999                 </fields>
14000                 <links>
14001                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14002                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
14003                 </links>
14004                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14005                         <actions>
14006                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14007                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14008                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14009                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14010                         </actions>
14011                 </permacrud>
14012         </class>
14013
14014         <class id="cct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::carousel_type" oils_persist:tablename="config.carousel_type" reporter:label="Carousel Types">
14015                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14016                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id"/>
14017                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14018                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14019                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14020                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14021                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14022                 </fields>
14023                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14024                         <actions>
14025                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14026                                 <retrieve/>
14027                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14028                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14029                         </actions>
14030                 </permacrud>
14031         </class>
14032
14033         <class id="cc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::carousel" oils_persist:tablename="container.carousel" reporter:label="Carousels">
14034                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14035                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14036                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14037                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14038                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14039                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14040                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
14041                         <field reporter:label="Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
14042                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14043                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14044                         <field reporter:label="Age Limit" name="age_filter" reporter:datatype="interval"/>
14045                         <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 -->
14046                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text"/> <!-- ditto -->
14047                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14048                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14049                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14050                 </fields>
14051                 <links>
14052                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14053                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14054                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14055                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14056                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14057                 </links>
14058                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14059                         <actions>
14060                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14061                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14062                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14063                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14064                         </actions>
14065                 </permacrud>
14066         </class>
14067
14068         <class id="ccou" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::carousel_org_unit" oils_persist:tablename="container.carousel_org_unit" reporter:label="Carousels Visible at Library">
14069                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14070                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
14071                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link" oils_obj:required="true"/>
14072                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14073                         <field reporter:label="Library" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
14074                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int" oils_obj:required="true"/>
14075                 </fields>
14076                 <links>
14077                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14078                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14079                 </links>
14080                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14081                         <actions>
14082                                 <create permission="ADMIN_CAROUSEL">
14083                                         <context link="carousel" field="owner"/>
14084                                 </create>
14085                                 <retrieve permission="ADMIN_CAROUSEL">
14086                                         <context link="carousel" field="owner"/>
14087                                 </retrieve>
14088                                 <update permission="ADMIN_CAROUSEL">
14089                                         <context link="carousel" field="owner"/>
14090                                 </update>
14091                                 <delete permission="ADMIN_CAROUSEL">
14092                                         <context link="carousel" field="owner"/>
14093                                 </delete>
14094                         </actions>
14095                 </permacrud>
14096         </class>
14097
14098         <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">
14099                 <fields oils_persist:primary="name">
14100                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_obj:required="true"/>
14101                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
14102                         <field name="context_org" reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14103                         <field name="enabled" reporter:datatype="bool" reporter:label="Enabled"/>
14104                         <field name="perm" reporter:datatype="link" reporter:label="Permission Required by User" oils_obj:required="true"/>
14105                         <field name="restrict_to_org" reporter:datatype="bool" reporter:label="Restrict by Home Library"/>
14106                         <field name="allow_inactive" reporter:datatype="bool" reporter:label="Allow Inactive Users"/>
14107                         <field name="allow_expired" reporter:datatype="bool" reporter:label="Allow Expired Users"/>
14108                         <field name="block_list" reporter:datatype="text" reporter:label="Block List"/>
14109                         <field name="usr_activity_type" reporter:datatype="link" reporter:label="User Activity Type"/>
14110                 </fields>
14111                 <links>
14112                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14113                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14114                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14115                 </links>
14116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14117                         <actions>
14118                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14119                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14120                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14121                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14122                         </actions>
14123                 </permacrud>
14124         </class>
14125         <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">
14126                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14127                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14128                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14129                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14130                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14131                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14132                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14133                 </fields>
14134                 <links>
14135                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14136                 </links>
14137                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14138                         <actions>
14139                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14140                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14141                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14142                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14143                         </actions>
14144                 </permacrud>
14145         </class>
14146
14147         <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">
14148                 <fields oils_persist:primary="code">
14149                         <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14150                         <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14151                 </fields>
14152                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14153                         <actions>
14154                                 <retrieve/>
14155                         </actions>
14156                 </permacrud>
14157         </class>
14158
14159         <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">
14160                 <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14161                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14162                         <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14163                         <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14164                         <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14165                         <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14166                         <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14167                         <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14168                         <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14169                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14170                 </fields>
14171                 <links>
14172                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14173                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14174                 </links>
14175                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14176                         <actions>
14177                                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14178                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14179                                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14180                                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14181                         </actions>
14182                 </permacrud>
14183         </class>
14184
14185         <!-- Simple Reporter classes are currently used only by the SR UI -->
14186         <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14187                 <oils_persist:source_definition><![CDATA[
14188                         SELECT
14189                           -- Circ id; just for counting
14190                           combcirc.id AS circ_id,
14191
14192                           -- User info, currently limiting to what's available from action.all_circulation
14193                           combcirc.usr_post_code AS usr_post_code,
14194                           combcirc.usr_birth_year AS usr_bith_year,
14195                           combcirc.usr_profile AS usr_profile_id,
14196                           pgtu.name AS usr_profile,
14197                           combcirc.usr_home_ou AS usr_home_ou_id,
14198                           aouuh.shortname AS usr_home_ou_shortname,
14199                           aouuh.name AS usr_home_ou_name,
14200                           (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14201                           aouus.shortname AS usr_sys_shortname,
14202                           aouus.name AS usr_sys_name,
14203
14204                           -- Circ info
14205                           -- Checkout
14206                           combcirc.xact_start AS xact_start,
14207                           CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14208                           TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14209                           TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14210                           combcirc.circ_lib AS circ_lib_id,
14211                           aouco.shortname AS circ_lib_shortname,
14212                           aouco.name AS circ_lib_name,
14213                           (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14214                           aoucos.shortname AS circ_sys_shortname,
14215                           aoucos.name AS circ_sys_name,
14216                           auco.usrname AS circ_staff,
14217                           awso.name AS checkout_workstation,
14218
14219                           combcirc.due_date AS due_date,
14220                           CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14221                           TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14222                           TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14223
14224                           -- Checkin
14225                           combcirc.xact_finish AS xact_finish,
14226                           CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14227                           TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14228                           TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14229                           aouci.shortname AS checkin_lib_shortname,
14230                           aouci.name AS checkin_lib_name,
14231                           auci.usrname AS checkin_staff,
14232                           awsi.name AS checkin_workstation,
14233                           aoucis.shortname AS checkin_sys_shortname,
14234                           aoucis.name AS checkin_sys_name,
14235
14236                           combcirc.checkin_time AS checkin_time,
14237
14238                           -- Misc circ info
14239                           combcirc.renewal_remaining AS renewal_remaining,
14240                           combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14241                           combcirc.grace_period AS grace_period,
14242
14243                           combcirc.stop_fines AS stop_fines,
14244                           combcirc.stop_fines_time AS stop_fines_time,
14245
14246                           combcirc.duration AS duration,
14247                           combcirc.fine_interval AS fine_interval,
14248                           combcirc.recurring_fine AS recurring_fine,
14249                           combcirc.max_fine AS max_fine,
14250                           combcirc.duration_rule AS duration_rule,
14251                           combcirc.recurring_fine_rule AS recurring_fine_rule,
14252                           combcirc.max_fine_rule AS max_fine_rule,
14253                           CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14254                           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,
14255                           CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14256
14257                           -- Copy info
14258                           acp.barcode AS copy_barcode,
14259                           acp.circ_modifier AS copy_circ_modifier_code,
14260                           ccm.name AS copy_circ_modifier_name,
14261                           acp.circ_lib AS copy_circ_lib_id,
14262                           acp.location AS location_id,
14263                           acpl.name AS location_name,
14264                           aoucp.shortname AS copy_circ_lib_shortname,
14265                           aoucp.name AS copy_circ_lib_name,
14266                           (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14267                           aoucps.shortname AS copy_sys_shortname,
14268                           aoucps.name AS copy_sys_name,
14269                           combcirc.copy_owning_lib AS copy_owning_lib_id,
14270                           aoucpo.shortname AS copy_owning_lib_shortname,
14271                           aoucpo.name AS copy_owning_lib_name,
14272                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14273                           acnp.label AS copy_call_number_prefix,
14274                           acn.label AS copy_call_number_label,
14275                           acns.label AS copy_call_number_suffix,
14276                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14277                           acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14278                           acn.label_sortkey AS copy_call_number_label_sortkey,
14279                           acns.label_sortkey AS copy_call_number_suffix_sortkey,
14280                           COALESCE(rmsr.title, acp.dummy_title) AS title,
14281                           COALESCE(rmsr.author, acp.dummy_author) AS author,
14282                           rmsr.publisher AS publisher,
14283                           public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14284                           array_to_string(rmsr.isbn, ', ') AS isbn,
14285                           array_to_string(rmsr.issn, ', ') AS issn,
14286                           part.label AS part_label,
14287                           part.label_sortkey AS part_label_sortkey,
14288                           acn.record AS bib_id,
14289                           rmsr.tcn_value AS tcn_value
14290
14291                         FROM
14292                           action.all_circulation combcirc
14293
14294                           -- User
14295                           INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14296                           LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14297                           LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14298
14299                           -- Circ
14300                           LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14301                           LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14302                           INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14303                           LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14304                           LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14305                           LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14306                           LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14307                           LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14308
14309                           -- Copy / call / title
14310                           INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14311                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14312                           INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14313                           LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14314                           LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14315                           LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14316                           LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14317                           INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14318                           INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14319                           INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14320                           LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14321                           LEFT JOIN (
14322                                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14323                                 FROM biblio.monograph_part bmp
14324                                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14325                                 WHERE NOT bmp.deleted
14326                           ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14327                 ]]></oils_persist:source_definition>
14328                 <field_groups>
14329                         <group name="common" reporter:label="Common Fields"/>
14330                         <group name="item" reporter:label="Item Fields"/>
14331                         <group name="user" reporter:label="Patron Fields"/>
14332                         <group name="title" reporter:label="Call Number and Title Fields"/>
14333                         <group name="org" reporter:label="Libraries"/>
14334                 </field_groups>
14335                 <fields oils_persist:primary="circ_id">
14336                         <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14337                         <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14338                         <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14339                         <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"/>
14340                         <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14341                         <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"/>
14342                         <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"/>
14343                         <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14344                         <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"/>
14345                         <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14346                         <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14347                         <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14348                         <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14349                         <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14350                         <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14351                         <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"/>
14352                         <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14353                         <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14354                         <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14355                         <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14356                         <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14357                         <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14358                         <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14359                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14360                         <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14361                         <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14362                         <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14363                         <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14364                         <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14365                         <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14366                         <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14367                         <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14368                         <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14369                         <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14370                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14371                         <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14372                         <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14373                         <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14374                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14375                         <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14376                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14377                         <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14378                         <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14379                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14380                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14381                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14382                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14383                         <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14384                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14385                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14386                         <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14387                         <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14388                         <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14389                         <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14390                         <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14391                         <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14392                         <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14393                         <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14394                         <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14395                         <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"/>
14396                         <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14397                         <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14398                         <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14399                         <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14400                         <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"/>
14401                         <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"/>
14402                         <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14403                         <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14404                         <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14405                         <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14406                         <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14407                         <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14408                         <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14409                         <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14410                         <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14411                         <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14412                         <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"/>
14413                         <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"/>
14414                         <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"/>
14415                         <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"/>
14416                         <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14417                         <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14418                         <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14419                         <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14420                         <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14421                         <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14422                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14423                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14424                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14425                         <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14426                 </fields>
14427                 <links>
14428                         <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14429                         <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14430                         <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14431                 </links>
14432         </class>
14433
14434         <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14435                 <oils_persist:source_definition><![CDATA[
14436                         SELECT
14437                           au.home_ou AS home_ou_filter,
14438                           au.id AS user_id,
14439                           cardp.barcode AS barcode_primary,
14440                           au.usrname AS usrname,
14441                           au.email AS email,
14442                           CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14443                           au.prefix AS prefix,
14444                           au.first_given_name AS first_given_name,
14445                           au.second_given_name AS second_given_name,
14446                           au.family_name AS family_name,
14447                           au.suffix AS suffix,
14448                           CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14449                           COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14450                           COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14451                           COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14452                           COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14453                           COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14454                           COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14455                           COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14456                           au.profile AS profile_id,
14457                           pgt.name AS profile,
14458                           au.alias AS alias,
14459                           CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14460                           au.day_phone AS day_phone,
14461                           au.evening_phone AS evening_phone,
14462                           au.other_phone AS other_phone,
14463                           au.dob AS dob,
14464                           CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14465                           TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14466                           EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14467                           au.active AS active,
14468                           au.barred AS barred,
14469                           au.deleted AS deleted,
14470                           au.juvenile AS juvenile,
14471                           au.claims_returned_count AS claims_returned_count,
14472                           au.credit_forward_balance AS credit_forward_balance,
14473                           au.create_date AS create_date,
14474                           CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14475                           TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14476                           TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14477                           au.expire_date AS expire_date,
14478                           CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14479                           TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14480                           TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14481                           au.claims_never_checked_out_count AS claims_never_checked_out_count,
14482                           au.last_update_time AS last_update_time,
14483                           au.home_ou AS home_ou_id,
14484                           aouh.shortname AS home_ou_shortname,
14485                           aouh.name AS home_ou_name,
14486                           (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14487                           aous.shortname AS home_sys_shortname,
14488                           aous.name AS home_sys_name,
14489                           auam.valid AS mailing_valid,
14490                           auam.address_type AS mailing_address_type,
14491                           auam.street1 AS mailing_street1,
14492                           auam.street2 AS mailing_street2,
14493                           auam.city AS mailing_city,
14494                           auam.state AS mailing_state,
14495                           auam.country AS mailing_country,
14496                           auam.post_code AS mailing_post_code,
14497                           auam.county AS mailing_county,
14498                           auam.within_city_limits AS mailing_within_city_limits,
14499                           auam.pending AS mailing_pending,
14500                           CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14501                           auap.valid AS physical_valid,
14502                           auap.address_type AS physical_address_type,
14503                           auap.street1 AS physical_street1,
14504                           auap.street2 AS physical_street2,
14505                           auap.city AS physical_city,
14506                           auap.state AS physical_state,
14507                           auap.country AS physical_country,
14508                           auap.post_code AS physical_post_code,
14509                           auap.county AS physical_county,
14510                           auap.within_city_limits AS physical_within_city_limits,
14511                           auap.pending AS physical_pending,
14512                           CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14513                           CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14514                           CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14515                           CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14516                           CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14517                           CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14518                           asceum1.stat_cat_entry AS legacy_stat_cat1,
14519                           asceum2.stat_cat_entry AS legacy_stat_cat2,
14520
14521                           -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14522                           STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14523                           STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14524                           STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14525                           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,
14526                           COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14527
14528                         FROM
14529                           actor.usr au
14530                           INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14531                           INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14532                           LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14533                           LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14534                           LEFT JOIN actor.card cards ON (au.id = cards.usr)
14535                           INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14536                           LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14537                           LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14538                           LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14539                           LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14540                           LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14541                           LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14542                           LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14543                           LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14544                           LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14545                           LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14546
14547                         GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14548                           16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14549                           31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14550                           46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14551                           61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14552                           76,77,78,79,80,81
14553                 ]]></oils_persist:source_definition>
14554                 <field_groups>
14555                         <group name="common" reporter:label="Common Fields"/>
14556                         <group name="name" reporter:label="Name Fields"/>
14557                         <group name="contact" reporter:label="Contact Fields"/>
14558                         <group name="address" reporter:label="Address Related Fields"/>
14559                         <group name="org" reporter:label="Libraries"/>
14560                 </field_groups>
14561                 <fields oils_persist:primary="user_id">
14562                         <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int" 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"/>
14563                         <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14564                         <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14565                         <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" field_groups="common"/>
14566                         <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14567                         <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14568                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14569                         <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14570                         <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14571                         <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14572                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14573                         <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14574                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14575                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14576                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14577                         <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14578                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14579                         <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14580                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14581                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14582                         <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14583                         <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14584                         <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14585                         <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14586                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14587                         <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14588                         <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14589                         <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14590                         <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14591                         <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14592                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14593                         <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14594                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14595                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14596                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14597                         <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14598                         <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14599                         <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14600                         <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14601                         <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14602                         <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14603                         <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14604                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14605                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14606                         <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"/>
14607                         <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14608                         <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14609                         <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"/>
14610                         <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14611                         <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14612                         <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14613                         <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14614                         <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14615                         <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14616                         <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14617                         <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14618                         <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14619                         <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14620                         <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14621                         <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14622                         <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14623                         <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14624                         <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14625                         <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14626                         <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14627                         <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14628                         <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14629                         <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14630                         <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14631                         <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14632                         <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14633                         <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14634                         <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14635                         <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14636                         <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14637                         <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14638                         <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14639                         <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14640                         <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14641                         <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14642                         <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14643                         <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14644                         <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14645                         <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14646                         <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14647                         <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14648                 </fields>
14649                 <links>
14650                         <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14651                 </links>
14652         </class>
14653
14654         <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14655                 <oils_persist:source_definition><![CDATA[
14656                         SELECT
14657                           -- ids
14658                           acp.id AS copy_id,
14659                           acp.floating AS floating_id,
14660                           acn.id AS acn_id,
14661                           acp.circ_lib AS circ_lib_id,
14662                           acp.status AS status_id,
14663                           acp.location AS location_id,
14664                           acp.age_protect AS age_protect_id,
14665                           aous.id AS circ_sys_id,
14666                           acn.owning_lib AS owning_lib_id,
14667                           aouos.id AS owning_sys_id,
14668                           awsi.id AS inv_workstation_id,
14669
14670                           -- OUs
14671                           aou.shortname AS circ_lib_shortname,
14672                           aou.name AS circ_lib_name,
14673                           aous.shortname AS circ_sys_shortname,
14674                           aous.name AS circ_sys_name,
14675                           aouo.shortname AS owning_lib_shortname,
14676                           aouo.name AS owning_lib_name,
14677                           aouos.shortname AS owning_sys_shortname,
14678                           aouos.name AS owning_sys_name,
14679
14680                           -- dates
14681                           acp.create_date AS create_date_time,
14682                           CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14683                           TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14684                           TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14685                           acp.active_date AS active_date_time,
14686                           CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14687                           TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14688                           TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14689                           acp.edit_date AS edit_date_time,
14690                           CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14691                           TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14692                           TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14693                           acp.status_changed_time AS status_changed_time_time,
14694                           CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14695                           TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14696                           TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14697                           ali.inventory_date AS latest_inv_date,
14698                           CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14699                           TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14700                           TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14701
14702                           -- acp
14703                           acp.barcode AS barcode,
14704                           ccs.name AS status,
14705                           acpl.name AS location_name,
14706                                                         acp.circ_modifier AS copy_circ_modifier_code,
14707                                                         ccm.name AS copy_circ_modifier_name,
14708                           acp.price AS price,
14709                           acp.cost AS acq_price,
14710                           acp.deleted AS copy_deleted,
14711                           acp.ref AS reference,
14712                           acp.circulate AS copy_circulate,
14713                           (acp.circulate AND acpl.circulate) AS circulate,
14714                           acp.holdable AS copy_holdable,
14715                           acp.deposit AS deposit,
14716                           acp.deposit_amount AS deposit_amount,
14717                           acp.alert_message AS alert_message,
14718                           acp.opac_visible AS copy_opac_visible,
14719                           (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14720                           crahp.name AS age_protect,
14721                           CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14722                           (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14723                           acp.copy_number AS copy_number,
14724                           acp.circ_as_type AS circ_as_type,
14725                           acp.loan_duration AS loan_duration_int,
14726                           CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14727                           acp.fine_level AS fine_level_int,
14728                           CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14729
14730                           -- Call Number
14731                           TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14732                           acnp.label AS copy_call_number_prefix,
14733                           acn.label AS copy_call_number_label,
14734                           acns.label AS copy_call_number_suffix,
14735                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14736                           acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14737                           acn.label_sortkey AS copy_call_number_label_sortkey,
14738                           acns.label_sortkey AS copy_call_number_suffix_sortkey,
14739                           racnd.dewey AS call_number_dewey,
14740                           racnd.dewey_block_tens AS call_number_dewey_block_tens,
14741                           racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14742                           racnd.dewey_range_tens AS call_number_dewey_range_tens,
14743                           racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14744
14745                           -- Misc
14746                           COALESCE(rmsr.title, acp.dummy_title) AS title,
14747                           COALESCE(rmsr.author, acp.dummy_author) AS author,
14748                           rmsr.publisher AS publisher,
14749                           public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14750                           COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14751                           array_to_string(rmsr.issn, ', ') AS issn,
14752                           part.label AS part_label,
14753                           part.label_sortkey AS part_label_sortkey,
14754                           acn.record AS bib_id,
14755                           rmsr.tcn_value AS tcn_value,
14756                           acn.deleted AS call_deleted,
14757                           bre.deleted AS bib_deleted,
14758                           ccs.holdable AS status_holdable,
14759                           acpl.holdable AS location_holdable,
14760                           acp.circulate AS location_circulate,
14761                           awsi.name AS inventory_workstation,
14762                           aucr.usrname AS creating_user,
14763                           aued.usrname AS editing_user,
14764
14765                           -- Aggregates
14766                           -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14767                           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,
14768                           COUNT(DISTINCT combcirc.id) AS circ_total,
14769                           STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14770
14771                         FROM
14772                           asset.copy acp
14773                           LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14774                           INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14775                           LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14776                           INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14777                           LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14778                           INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14779                           INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14780                           INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14781                           LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14782                           LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14783                           LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14784                           INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14785                           LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14786                           INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14787                           LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14788                           INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14789                           LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14790                           LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14791                           INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14792                           INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14793                           LEFT JOIN (
14794                                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14795                                 FROM biblio.monograph_part bmp
14796                                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14797                                 WHERE NOT bmp.deleted
14798                           ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14799
14800                         GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14801                           16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14802                           31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14803                           46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14804                           61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14805                           76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14806                           91,92,93,94,95,96
14807
14808                 ]]></oils_persist:source_definition>
14809                 <field_groups>
14810                         <group name="common" reporter:label="Common Fields"/>
14811                         <group name="dates" reporter:label="Date Fields"/>
14812                         <group name="title" reporter:label="Call Number and Title Fields"/>
14813                         <group name="org" reporter:label="Libraries"/>
14814                 </field_groups>
14815                 <fields oils_persist:primary="copy_id">
14816                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14817                         <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14818                         <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14819                         <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14820                         <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14821                         <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14822                         <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14823                         <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14824                         <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"/>
14825                         <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"/>
14826                         <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14827                         <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14828                         <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14829                         <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14830                         <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14831                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14832                         <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14833                         <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14834                         <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14835                         <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14836                         <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14837                         <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14838                         <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14839                         <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14840                         <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14841                         <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14842                         <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14843                         <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14844                         <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14845                         <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14846                         <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14847                         <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14848                         <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14849                         <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14850                         <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14851                         <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14852                         <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14853                         <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14854                         <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14855                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14856                         <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14857                         <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14858                         <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14859                         <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14860                         <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14861                         <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14862                         <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14863                         <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14864                         <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14865                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14866                         <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14867                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14868                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14869                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14870                         <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14871                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14872                         <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14873                         <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14874                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14875                         <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14876                         <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14877                         <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14878                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14879                         <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14880                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14881                         <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14882                         <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14883                         <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14884                         <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14885                         <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14886                         <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14887                         <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14888                         <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14889                         <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14890                         <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14891                         <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14892                         <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14893                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14894                         <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14895                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14896                         <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14897                         <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14898                         <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14899                         <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14900                         <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14901                         <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14902                         <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14903                         <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14904                         <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14905                         <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14906                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14907                         <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14908                         <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14909                         <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14910                 </fields>
14911                 <links>
14912                         <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14913                         <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14914                         <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14915                         <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14916                         <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14917                         <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14918                 </links>
14919         </class>
14920
14921         <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14922                 <oils_persist:source_definition><![CDATA[
14923
14924                         SELECT
14925                           -- ids
14926                           acp.id AS copy_id,
14927                           acn.id AS acn_id,
14928                           acp.circ_lib AS circ_lib_id,
14929                           acp.status AS status_id,
14930                           acp.location AS location_id,
14931                           acp.age_protect AS age_protect_id,
14932                           aous.id AS circ_sys_id,
14933                           acn.owning_lib AS owning_lib_id,
14934                           aouos.id AS owning_sys_id,
14935                           awsi.id AS inv_workstation_id,
14936
14937                           -- OUs
14938                           aou.shortname AS circ_lib_shortname,
14939                           aou.name AS circ_lib_name,
14940                           aous.shortname AS circ_sys_shortname,
14941                           aous.name AS circ_sys_name,
14942                           aouo.shortname AS owning_lib_shortname,
14943                           aouo.name AS owning_lib_name,
14944                           aouos.shortname AS owning_sys_shortname,
14945                           aouos.name AS owning_sys_name,
14946
14947                           -- dates
14948                           acp.create_date AS create_date_time,
14949                           (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14950                           (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14951                           EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14952                           CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14953                           TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14954                           TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14955                           acp.active_date AS active_date_time,
14956                           (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14957                           EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14958                           EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14959                           CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14960                           TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14961                           TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14962                           acp.edit_date AS edit_date_time,
14963                           (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14964                           (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14965                           EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14966                           CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14967                           TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14968                           TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14969                           acp.status_changed_time AS status_changed_time_time,
14970                           CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14971                           TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14972                           TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14973                           ali.inventory_date AS latest_inv_date,
14974                           (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14975                           EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14976                           EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14977                           CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14978                           TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14979                           TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14980
14981                           -- acp
14982                           acp.barcode AS barcode,
14983                           ccs.name AS status,
14984                           acpl.name AS location_name,
14985                           acp.circ_modifier AS circ_modifier_code,
14986                           ccm.name AS circ_modifier_name,
14987                           acp.price AS price,
14988                           acp.cost AS acq_price,
14989                           acp.deleted AS copy_deleted,
14990                           acp.ref AS reference,
14991                           acp.circulate AS copy_circulate,
14992                           (acp.circulate AND acpl.circulate) AS circulate,
14993                           acp.holdable AS copy_holdable,
14994                           acp.deposit AS deposit,
14995                           acp.deposit_amount AS deposit_amount,
14996                           acp.alert_message AS alert_message,
14997                           acp.opac_visible AS copy_opac_visible,
14998                           (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14999                           crahp.name AS age_protect,
15000                           CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
15001                           (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
15002                           acp.copy_number AS copy_number,
15003                           acp.circ_as_type AS circ_as_type,
15004                           acp.loan_duration AS loan_duration_int,
15005                           CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15006                           acp.fine_level AS fine_level_int,
15007                           CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15008
15009                           -- Call Number
15010                           TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15011                           acnp.label AS copy_call_number_prefix,
15012                           acn.label AS copy_call_number_label,
15013                           acns.label AS copy_call_number_suffix,
15014                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15015                           acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15016                           acn.label_sortkey AS copy_call_number_label_sortkey,
15017                           acns.label_sortkey AS copy_call_number_suffix_sortkey,
15018                           racnd.dewey AS call_number_dewey,
15019                           racnd.dewey_block_tens AS call_number_dewey_block_tens,
15020                           racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15021                           racnd.dewey_range_tens AS call_number_dewey_range_tens,
15022                           racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15023
15024                           -- Misc
15025                           COALESCE(rmsr.title, acp.dummy_title) AS title,
15026                           COALESCE(rmsr.author, acp.dummy_author) AS author,
15027                           rmsr.publisher AS publisher,
15028                           public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15029                           COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15030                           array_to_string(rmsr.issn, ', ') AS issn,
15031                           part.label AS part_label,
15032                           part.label_sortkey AS part_label_sortkey,
15033                           acn.record AS bib_id,
15034                           rmsr.tcn_value AS tcn_value,
15035                           acn.deleted AS call_deleted,
15036                           bre.deleted AS bib_deleted,
15037                           ccs.holdable AS status_holdable,
15038                           acpl.holdable AS location_holdable,
15039                           acp.circulate AS location_circulate,
15040                           awsi.name AS inventory_workstation,
15041
15042                           -- Aggregates
15043                           -- may decide these price games aren't worth it, but estimated collection value is useful
15044                           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,
15045                           STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15046                           MAX(combcirc.xact_start) AS last_circ_datetime,
15047                           (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15048                           (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15049                           EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15050                           CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15051                           TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15052                           TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15053                           COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15054                           (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15055                           (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,
15056                           EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15057                           CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15058                           TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15059                           TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15060                           COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15061                           COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15062                           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,
15063                           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,
15064                           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,
15065                           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
15066
15067                         FROM
15068                           asset.copy acp
15069                           LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15070                           INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15071                           LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15072                           INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15073                           LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15074                           INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15075                           INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15076                           INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15077                           LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15078                           LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15079                           LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15080                           INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15081                           LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15082                           INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15083                           LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15084                           INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15085                           LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15086                           LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15087                           LEFT JOIN (
15088                                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15089                                 FROM biblio.monograph_part bmp
15090                                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15091                                 WHERE NOT bmp.deleted
15092                           ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15093
15094                         GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15095                           16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15096                           31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15097                           46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15098                           61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15099                           76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15100                           91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15101
15102                 ]]></oils_persist:source_definition>
15103                 <field_groups>
15104                         <group name="common" reporter:label="Common Fields"/>
15105                         <group name="dates" reporter:label="Date Fields"/>
15106                         <group name="inv" reporter:label="Inventory Fields"/>
15107                         <group name="title" reporter:label="Call Number and Title Fields"/>
15108                         <group name="org" reporter:label="Libraries"/>
15109                 </field_groups>
15110                 <fields oils_persist:primary="copy_id">
15111                          <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15112                          <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15113                          <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"/>
15114                          <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15115                          <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15116                          <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15117                          <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15118                          <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"/>
15119                          <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15120                          <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15121                          <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15122                          <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15123                          <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15124                          <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15125                          <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15126                          <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15127                          <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15128                          <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15129                          <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15130                          <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15131                          <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15132                          <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15133                          <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15134                          <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15135                          <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15136                          <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"/>
15137                          <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15138                          <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15139                          <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15140                          <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15141                          <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15142                          <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15143                          <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15144                          <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15145                          <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15146                          <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15147                          <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15148                          <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15149                          <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15150                          <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15151                          <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15152                          <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15153                          <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15154                          <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15155                          <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15156                          <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15157                          <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15158                          <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15159                          <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15160                          <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15161                          <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15162                          <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15163                          <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15164                          <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15165                          <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15166                          <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15167                          <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15168                          <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15169                          <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15170                          <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15171                          <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15172                          <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15173                          <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15174                          <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15175                          <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15176                          <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15177                          <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15178                          <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15179                          <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15180                          <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15181                          <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15182                          <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15183                          <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15184                          <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15185                          <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15186                          <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15187                          <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15188                          <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15189                          <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15190                          <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15191                          <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15192                          <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15193                          <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15194                          <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15195                          <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15196                          <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15197                          <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15198                          <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15199                          <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15200                          <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15201                          <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15202                          <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15203                          <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15204                          <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15205                          <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15206                          <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15207                          <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15208                          <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15209                          <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15210                          <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15211                          <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15212                          <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15213                          <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15214                          <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15215                          <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15216                          <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15217                          <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15218                          <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15219                          <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15220                          <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15221                          <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15222                          <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15223                          <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15224                          <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15225                          <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15226                          <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15227                          <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15228                          <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15229                          <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15230                          <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15231                          <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15232                          <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15233                          <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15234                          <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15235                          <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"/>
15236                          <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"/>
15237                          <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"/>
15238                 </fields>
15239                 <links>
15240                         <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15241                         <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15242                         <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15243                         <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15244                         <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15245                 </links>
15246         </class>
15247
15248         <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15249                 <oils_persist:source_definition><![CDATA[
15250
15251                         SELECT
15252                           -- ids
15253                           xact.id AS xact_id,
15254                           COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15255                           COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15256
15257                           -- OUs
15258                           COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15259                           COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15260                           COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15261                           COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15262
15263                           -- billings
15264                           billings.total_amount AS billing_grand_total,
15265                           billings.total_unvoided_amount AS billing_total,
15266
15267                           billings.voided_billing_count AS billing_voided_count,
15268                           billings.all_billing_types AS all_billing_types,
15269                           billings.billing_types AS billing_types,
15270
15271                           billings.total_voided_amount AS billing_total_voided,
15272                           billings.total_overdue_amount AS billing_overdue_amount,
15273                           billings.total_lost_amount AS billing_lost_amount,
15274                           billings.total_long_od_amount AS billing_long_od_amount,
15275                           billings.total_damaged_amount AS billing_damaged_amount,
15276                           billings.total_deposit_amount AS billing_deposit_amount,
15277                           billings.total_rental_amount AS billing_rental_amount,
15278
15279                           -- payments
15280                           payments.total_amount AS payment_grand_total,
15281                           payments.total_unvoided_amount AS payment_total,
15282
15283                           payments.voided_payment_count AS payment_voided_count,
15284                           payments.all_payment_types AS all_payment_types,
15285                           payments.payment_types AS payment_types,
15286
15287                           payments.total_voided_amount AS payment_total_voided,
15288                           payments.total_account_adjustment AS payment_account_adjustment_amount,
15289                           payments.total_cash_payment AS payment_cash_amount,
15290                           payments.total_check_payment AS payment_check_amount,
15291                           payments.total_credit_card_payment AS payment_credit_card_amount,
15292                           payments.total_debit_card_payment AS payment_debit_card_amount,
15293                           payments.total_credit_payment AS payment_credit_amount,
15294                           payments.total_forgive_payment AS payment_forgive_amount,
15295                           payments.total_work_payment AS payment_work_amount,
15296                           payments.total_goods_payment AS payment_goods_amount,
15297                           payments.total_currency_payment AS payment_currency_amount,
15298                           payments.total_non_currency_payment AS payment_non_currency_amount,
15299
15300                           -- dates
15301                           xact.xact_start AS xact_start,
15302                           CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15303                           TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15304                           TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15305                           xact.xact_finish AS xact_finish,
15306                           CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15307                           TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15308                           TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15309                           billings.earliest_billing_ts AS earliest_billing_ts,
15310                           CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15311                           TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15312                           TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15313                           billings.latest_billing_ts AS latest_billing_ts,
15314                           CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15315                           TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15316                           TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15317                           payments.earliest_payment_ts AS earliest_payment_ts,
15318                           CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15319                           TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15320                           TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15321                           payments.latest_payment_ts AS latest_payment_ts,
15322                           CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15323                           TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15324                           TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15325
15326                           -- Misc
15327                           CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15328                           (xact.xact_finish IS NOT NULL) AS xact_closed
15329
15330                         FROM
15331                           money.billable_xact xact
15332                           LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15333                           LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15334                           LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15335                           LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15336                           LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15337                           LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15338
15339                           -- oohh nooo.... If not done this way you encounter situations
15340                           -- like multiplying billing totals x number of payments and
15341                           -- payment totals x number of billings and other fabulous fiduciary fantasies.
15342                           LEFT JOIN (
15343                                 SELECT
15344                                   xact,
15345                                   MIN(billing_ts) AS earliest_billing_ts,
15346                                   MAX(billing_ts) AS latest_billing_ts,
15347
15348                                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15349                                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15350                                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15351
15352                                   SUM(amount) AS total_amount,
15353                                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15354                                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15355                                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15356                                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15357                                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15358                                   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.
15359                                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15360                                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15361
15362                                 FROM
15363                                   money.all_billings
15364                                 GROUP BY 1
15365                           ) billings ON (xact.id = billings.xact)
15366                           -- Can't include accepting user or cash_drawer because that will "duplicate"
15367                           -- rows if multiple staff accept payments on a single xact...
15368                           LEFT JOIN (
15369                                 SELECT
15370                                   xact,
15371                                   MIN(payment_ts) AS earliest_payment_ts,
15372                                   MAX(payment_ts) AS latest_payment_ts,
15373
15374                                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15375                                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15376                                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15377
15378                                   SUM(amount) AS total_amount,
15379                                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15380                                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15381                                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15382                                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15383                                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15384                                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15385                                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15386                                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15387                                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15388                                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15389                                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15390                                   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,
15391                                   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
15392
15393                                 FROM
15394                                   money.all_payments
15395                                 GROUP BY 1
15396                           ) payments ON (xact.id = payments.xact)
15397
15398                 ]]></oils_persist:source_definition>
15399                 <field_groups>
15400                         <group name="common" reporter:label="Common Fields"/>
15401                         <group name="bill" reporter:label="Billing Fields"/>
15402                         <group name="pay" reporter:label="Payment Fields"/>
15403                         <group name="dates" reporter:label="Date Fields"/>
15404                         <group name="org" reporter:label="Libraries"/>
15405                 </field_groups>
15406                 <fields oils_persist:primary="xact_id">
15407                          <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15408                          <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"/>
15409                          <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"/>
15410                          <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15411                          <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15412                          <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15413                          <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15414                          <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15415                          <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15416                          <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15417                          <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15418                          <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15419                          <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15420                          <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15421                          <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15422                          <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15423                          <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15424                          <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15425                          <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15426                          <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15427                          <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15428                          <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15429                          <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15430                          <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15431                          <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15432                          <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15433                          <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15434                          <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15435                          <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15436                          <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15437                          <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15438                          <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15439                          <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15440                          <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15441                          <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15442                          <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15443                          <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15444                          <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15445                          <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15446                          <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15447                          <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15448                          <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15449                          <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15450                          <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15451                          <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15452                          <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15453                          <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15454                          <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15455                          <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15456                          <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15457                          <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15458                          <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15459                          <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15460                          <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15461                          <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15462                          <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15463                          <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15464                          <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15465                          <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15466                          <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15467                          <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15468                          <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15469                 </fields>
15470         </class>
15471
15472         <class id="coauf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::openathens_uid_field" oils_persist:tablename="config.openathens_uid_field" reporter:label="OpenAthens unique identifiers">
15473                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15474                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
15475                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15476                 </fields>
15477                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15478                         <actions>
15479                                 <retrieve/>
15480                         </actions>
15481                 </permacrud>
15482         </class>
15483
15484         <class id="coanf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::openathens_name_field" oils_persist:tablename="config.openathens_name_field" reporter:label="OpenAthens name fields">
15485                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15486                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
15487                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15488                 </fields>
15489                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15490                         <actions>
15491                                 <retrieve/>
15492                         </actions>
15493                 </permacrud>
15494         </class>
15495
15496         <class id="coai" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::openathens_identity" oils_persist:tablename="config.openathens_identity" reporter:label="Sign-on to OpenAthens">
15497                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15498                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15499                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15500                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15501                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15502                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15503                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15504                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15505                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15506                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15507                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15508                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15509                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15510                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15511                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15512                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15513                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15514                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15515                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15516                 </fields>
15517                 <links>
15518                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15519                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15520                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15521                 </links>
15522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15523                         <actions>
15524                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15525                                 <retrieve/>
15526                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15527                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15528                         </actions>
15529                 </permacrud>
15530         </class>
15531
15532         <class id="acqr_inv_totals" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Totals">
15533                 <oils_persist:source_definition><![CDATA[
15534                         WITH invoice_entry_totals AS (
15535                                 SELECT acqinv.id,
15536                                         SUM(COALESCE(acqie.cost_billed, 0.00)) AS total_invoice_entry_cost_billed,
15537                                         SUM(COALESCE(acqie.amount_paid, 0.00)) AS total_invoice_entry_amount_paid
15538                                 FROM acq.invoice acqinv
15539                                 LEFT JOIN acq.invoice_entry acqie ON (acqinv.id = acqie.invoice)
15540                                 GROUP BY 1
15541                         ), invoice_item_totals AS (
15542                                 SELECT acqinv.id,
15543                                         SUM(COALESCE(acqii.cost_billed, 0.00)) AS total_invoice_item_cost_billed,
15544                                         SUM(COALESCE(acqii.amount_paid, 0.00)) AS total_invoice_item_amount_paid
15545                                 FROM acq.invoice acqinv
15546                                 LEFT JOIN acq.invoice_item  acqii ON (acqinv.id = acqii.invoice)
15547                                 GROUP BY 1
15548                         )
15549                         SELECT id,
15550                                 total_invoice_entry_cost_billed, total_invoice_entry_amount_paid,
15551                                 total_invoice_item_cost_billed, total_invoice_item_amount_paid,
15552                                 total_invoice_entry_cost_billed + total_invoice_item_cost_billed AS total_cost_billed,
15553                                 total_invoice_entry_amount_paid + total_invoice_item_amount_paid AS total_amount_paid
15554                         FROM invoice_entry_totals
15555                         JOIN invoice_item_totals USING (id)
15556                 ]]></oils_persist:source_definition>
15557                 <fields oils_persist:primary="id">
15558                         <field reporter:label="Invoice" name="id" reporter:datatype="link"/>
15559                         <field reporter:label="Total Billed for Line Items" name="total_invoice_entry_cost_billed" reporter:datatype="money"/>
15560                         <field reporter:label="Total Paid for Line Items" name="total_invoice_entry_amount_paid" reporter:datatype="money"/>
15561                         <field reporter:label="Total Billed for Direct Charges" name="total_invoice_item_cost_billed" reporter:datatype="money"/>
15562                         <field reporter:label="Total Paid for Direct Charges" name="total_invoice_item_amount_paid" reporter:datatype="money"/>
15563                         <field reporter:label="Total Billed" name="total_cost_billed" reporter:datatype="money"/>
15564                         <field reporter:label="Total Paid" name="total_amount_paid" reporter:datatype="money"/>
15565                 </fields>
15566                 <links>
15567                         <link field="id" reltype="has_a" key="id" map="" class="acqinv"/>
15568                 </links>
15569         </class>
15570
15571         <class id="acqr_debit_by_fund" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Debits by Fund">
15572                 <oils_persist:source_definition><![CDATA[
15573                         WITH invoice_funds AS (
15574                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15575                                 FROM acq.invoice_entry acqie
15576                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15577                                 UNION ALL
15578                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15579                                 FROM acq.invoice_item acqii
15580                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15581                         )
15582                         SELECT invoice, fund, encumbrance, SUM (amount) AS total_amount
15583                         FROM invoice_funds
15584                         GROUP BY 1, 2, 3
15585                 ]]></oils_persist:source_definition>
15586                 <fields>
15587                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link"/>
15588                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
15589                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool"/>
15590                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money"/>
15591                 </fields>
15592                 <links>
15593                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15594                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
15595                 </links>
15596         </class>
15597
15598         <class id="acqr_debit_by_fund_tag" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Debits by Fund Tag">
15599                 <oils_persist:source_definition><![CDATA[
15600                         WITH invoice_funds AS (
15601                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15602                                 FROM acq.invoice_entry acqie
15603                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15604                                 UNION ALL
15605                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15606                                 FROM acq.invoice_item acqii
15607                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15608                         )
15609                         SELECT invoice, tag, encumbrance, SUM(amount) AS total_amount
15610                         FROM invoice_funds
15611                         LEFT JOIN acq.fund_tag_map acqftm ON (invoice_funds.fund = acqftm.fund)
15612                         GROUP BY 1, 2, 3
15613                 ]]></oils_persist:source_definition>
15614                 <fields>
15615                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link"/>
15616                         <field reporter:label="Fund Tag" name="tag" reporter:datatype="link"/>
15617                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool"/>
15618                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money"/>
15619                 </fields>
15620                 <links>
15621                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15622                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
15623                 </links>
15624         </class>
15625
15626         <!-- ********************************************************************************************************************* -->
15627 </IDL>
15628 <!-- Local Variables: -->
15629 <!-- indent-tabs-mode: t -->
15630 <!-- tab-width: 4 -->
15631 <!-- nxml-child-indent: 4 -->
15632 <!-- End: -->
15633 <!--
15634         vim:noet:ts=4:sw=4:
15635 -->