]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1350042 PCRUD access for various IDL classes
[working/Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
78                 <fields>
79                         <field name="usr" oils_persist:virtual="true" />
80                         <field name="forgive_payment" oils_persist:virtual="true" />
81                         <field name="work_payment" oils_persist:virtual="true" />
82                         <field name="credit_payment" oils_persist:virtual="true" />
83                         <field name="goods_payment" oils_persist:virtual="true" />
84                 </fields>
85                 <links>
86                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
87                 </links>
88         </class>
89
90         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
91                 <fields>
92                         <field name="workstation" oils_persist:virtual="true" />
93                         <field name="cash_payment" oils_persist:virtual="true" />
94                         <field name="check_payment" oils_persist:virtual="true" />
95                         <field name="credit_card_payment" oils_persist:virtual="true" />
96                 </fields>
97                 <links>
98                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
99                 </links>
100         </class>
101
102         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
103                 <fields>
104                         <field name="id" oils_persist:virtual="true" />
105                         <field name="children" oils_persist:virtual="true" />
106                         <field name="owner_doc" oils_persist:virtual="true" />
107                         <field name="intra_doc_id" oils_persist:virtual="true" />
108                         <field name="parent_node" oils_persist:virtual="true" />
109                         <field name="node_type" oils_persist:virtual="true" />
110                         <field name="namespace_uri" oils_persist:virtual="true" />
111                         <field name="name" oils_persist:virtual="true" />
112                         <field name="value" oils_persist:virtual="true" />
113                 </fields>
114         </class>
115
116         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
117                 <fields>
118                         <field name="title" oils_persist:virtual="true" />
119                         <field name="author" oils_persist:virtual="true" />
120                         <field name="doc_id" oils_persist:virtual="true" />
121                         <field name="doc_type" oils_persist:virtual="true" />
122                         <field name="pubdate" oils_persist:virtual="true" />
123                         <field name="isbn" oils_persist:virtual="true" />
124                         <field name="publisher" oils_persist:virtual="true" />
125                         <field name="tcn" oils_persist:virtual="true" />
126                         <field name="subject" oils_persist:virtual="true" />
127                         <field name="types_of_resource" oils_persist:virtual="true" />
128                         <field name="call_numbers" oils_persist:virtual="true" />
129                         <field name="edition" oils_persist:virtual="true" />
130                         <field name="online_loc" oils_persist:virtual="true" />
131                         <field name="synopsis" oils_persist:virtual="true" />
132                         <field name="physical_description" oils_persist:virtual="true" />
133                         <field name="toc" oils_persist:virtual="true" />
134                         <field name="copy_count" oils_persist:virtual="true" />
135                         <field name="series" oils_persist:virtual="true" />
136                         <field name="serials" oils_persist:virtual="true" />
137                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
138                 </fields>
139         </class>
140
141         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
142                 <fields>
143                         <field name="err_msg" oils_persist:virtual="true" />
144                         <field name="type" oils_persist:virtual="true" />
145                 </fields>
146         </class>
147
148         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
149                 <fields>
150                         <field name="err_msg" oils_persist:virtual="true" />
151                         <field name="type" oils_persist:virtual="true" />
152                 </fields>
153         </class>
154
155         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
156                 <fields oils_persist:primary="matchpoint">
157                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
158                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
159                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
160                 </fields>
161                 <links>
162                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
163                 </links>
164         </class>
165
166         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
167         <!-- when the time is right, turn me into a view.  -->
168                 <fields>
169             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
170             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
171             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
172             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
173             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
174             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
175             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
176             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
177             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
178             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
179                 </fields>
180         </class>
181
182         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
183                 <fields>
184                         <field name="public_name" oils_persist:virtual="true" />
185                         <field name="target_url" oils_persist:virtual="true" />
186                         <field name="target_coverage" oils_persist:virtual="true" />
187                         <field name="target_embargo" oils_persist:virtual="true" />
188                 </fields>
189         </class>
190
191         <!-- Actually in the DB -->
192         <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">
193                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
194                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
195                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
196                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
197                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
198                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
199                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
200                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
201                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
202                 </fields>
203                 <links>
204                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
205                 </links>
206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
207                         <actions>
208                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
209                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
210                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
211                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
212                         </actions>
213                 </permacrud>
214         </class>
215
216         <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">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
219                         <field reporter:label="Group" name="grp" reporter:datatype="link"/>
220                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
221                 </fields>
222                 <links>
223                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
224                 </links>
225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
226                         <actions>
227                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
228                     <context link="grp" field="owner"/>
229                 </create>
230                                 <retrieve/>
231                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
232                     <context link="grp" field="owner"/>
233                 </update>
234                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
235                     <context link="grp" field="owner"/>
236                 </delete>
237                         </actions>
238                 </permacrud>
239         </class>
240
241         <class  id="vibtg" 
242             controller="open-ils.cstore open-ils.pcrud" 
243             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
244             oils_persist:tablename="vandelay.import_bib_trash_group" 
245             reporter:label="Import/Overlay Field Groups for Removal">
246                 <fields oils_persist:primary="id" 
247                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
248                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
249                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
250                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
251                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
252                 </fields>
253                 <links>
254                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
255                 </links>
256                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
257                         <actions>
258                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
259                                 <retrieve/>
260                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
261                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
262                         </actions>
263                 </permacrud>
264         </class>
265
266
267         <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">
268                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
269                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
270                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
271                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
272                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
273                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
274                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
275                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
276                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
277                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
278                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
279                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
280                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
281                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
282                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
283                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
284                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
285                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
286                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
287                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
288                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
289                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
290                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
291                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
292                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
293                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
294                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
295                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
296                 </fields>
297                 <links>
298                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
299                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
300                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
301                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
302                 </links>
303                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
304                         <actions>
305                                 <create permission="CREATE_IMPORT_ITEM">
306                     <context link="definition" field="owner"/>
307                                 </create>
308                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
309                     <context link="definition" field="owner"/>
310                                 </retrieve>
311                                 <update permission="UPDATE_IMPORT_ITEM">
312                     <context link="definition" field="owner"/>
313                                 </update>
314                                 <delete permission="DELETE_IMPORT_ITEM">
315                     <context link="definition" field="owner"/>
316                                 </delete>
317                         </actions>
318                 </permacrud>
319         </class>
320
321         <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">
322                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
323                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
324                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
325                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
326                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
327                         <field reporter:label="Keep" name="keep" reporter:datatype="bool"/>
328                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
329                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
330                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
331                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
332                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
333                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
334                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
335                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
336                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
337                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
338                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
339                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
340                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
341                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
342                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
343                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
344                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
345                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
346                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
347                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
348                 </fields>
349                 <links>
350                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
351                 </links>
352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
353                         <actions>
354                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
355                                 <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"/>
356                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
357                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
358                         </actions>
359                 </permacrud>
360         </class>
361
362         <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">
363                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
364                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
365                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
366                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
367                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
368                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
369                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
370                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
371                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
372                 </fields>
373                 <links>
374                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
375                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
376                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
377                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
378                 </links>
379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
380                         <actions>
381                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
382                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
383                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
384                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
385                         </actions>
386                 </permacrud>
387         </class>
388
389         <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">
390                 <fields oils_persist:primary="code">
391                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
392                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
393                 </fields>
394                 <links>
395                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
396                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
397                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
398                 </links>
399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
400                         <actions>
401                                 <retrieve/>
402                         </actions>
403                 </permacrud>
404         </class>
405
406         <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">
407                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
408                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
409                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
410                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
411                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
412                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
413                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
414                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
415                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
416                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
417                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
418                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
419                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
420                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
421                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
422                 </fields>
423                 <links>
424                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
425                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
426                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
427                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
428             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
429             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
430             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
431                 </links>
432                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
433                         <actions>
434                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
435                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
436                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
437                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
438                         </actions>
439                 </permacrud>
440         </class>
441
442         <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">
443                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
444                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
445                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
446                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
447                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
448                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
449                 </fields>
450                 <links/>
451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
452                         <actions>
453                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
454                 <retrieve/>
455                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
456                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
457                         </actions>
458                 </permacrud>
459         </class>
460
461         <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">
462                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
463                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
464                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
465                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
466                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
467                 </fields>
468                 <links>
469                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
470                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
471                 </links>
472                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
473                         <actions>
474                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
475                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
476                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
477                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
478                         </actions>
479                 </permacrud>
480         </class>
481
482         <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">
483                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
484                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
485                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
486                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
487                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
488                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
489                 </fields>
490                 <links>
491                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
492                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
493                 </links>
494                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
495                         <actions>
496                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
497                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
498                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
499                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
500                         </actions>
501                 </permacrud>
502         </class>
503
504         <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">
505                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
506                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
507                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
508                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
509                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
510                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
511                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
512                 </fields>
513                 <links>
514                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
515                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
516                 </links>
517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
518                         <actions>
519                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
520                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
521                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
522                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
523                         </actions>
524                 </permacrud>
525         </class>
526
527         <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">
528                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
529                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
530                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
531                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
532                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
533                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
534                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
535                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
536                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
537                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
538                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
539                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
540                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
541                 </fields>
542                 <links>
543                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
544                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
545                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
546             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
547             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
548                 </links>
549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
550                         <actions>
551                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
552                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
553                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
554                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
555                         </actions>
556                 </permacrud>
557         </class>
558
559         <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">
560                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
561                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
562                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
563                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
564                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
565                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
566                 </fields>
567                 <links/>
568                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
569                         <actions>
570                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
571                 <retrieve/>
572                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
573                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
574                         </actions>
575                 </permacrud>
576         </class>
577
578         <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">
579                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
580                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
581                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
582                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
583                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
584                 </fields>
585                 <links>
586                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
587                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
588                 </links>
589                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
590                         <actions>
591                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
592                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
593                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
594                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
595                         </actions>
596                 </permacrud>
597         </class>
598
599         <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">
600                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
601                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
602                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
603                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
604                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
605                 </fields>
606                 <links>
607                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
608                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
609                 </links>
610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
611                         <actions>
612                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
613                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
614                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
615                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
616                         </actions>
617                 </permacrud>
618         </class>
619
620         <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">
621                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
622                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
623                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
624                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
625                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
626                 </fields>
627                 <links>
628                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
629                 </links>
630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
631                         <actions>
632                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
633                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
634                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
635                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
636                         </actions>
637                 </permacrud>
638         </class>
639
640         <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">
641                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
642                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
643                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
644                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
645                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
646                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
647                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
648                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
649             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
650                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
651                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
652                 </fields>
653                 <links>
654                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
655                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
656                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
657                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
658                 </links>
659                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
660                         <actions>
661                                 <create permission="ADMIN_IMPORT_MATCH_SET">
662                     <context link="match_set" field="owner"/>
663                                 </create>
664                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
665                     <context link="match_set" field="owner"/>
666                                 </retrieve>
667                                 <update permission="ADMIN_IMPORT_MATCH_SET">
668                     <context link="match_set" field="owner"/>
669                                 </update>
670                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
671                     <context link="match_set" field="owner"/>
672                                 </delete>
673                         </actions>
674                 </permacrud>
675         </class>
676
677         <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">
678                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
679                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
680                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
681                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
682                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
683                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
684                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
685                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
686                 </fields>
687                 <links>
688                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
689                 </links>
690                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
691                         <actions>
692                                 <create permission="ADMIN_IMPORT_MATCH_SET">
693                     <context link="match_set" field="owner"/>
694                                 </create>
695                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
696                     <context link="match_set" field="owner"/>
697                                 </retrieve>
698                                 <update permission="ADMIN_IMPORT_MATCH_SET">
699                     <context link="match_set" field="owner"/>
700                                 </update>
701                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
702                     <context link="match_set" field="owner"/>
703                                 </delete>
704                         </actions>
705                 </permacrud>
706         </class>
707
708         <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">
709                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
710                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
711                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
712                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
713                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
714                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
715                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
716                 </fields>
717                 <links>
718                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
719                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
720                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
721                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
722                 </links>
723         </class>
724
725     <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">
726         <fields oils_persist:primary="name">
727             <field reporter:label="Name" name="name" reporter:datatype="text"/>
728             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
729             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
730             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
731         </fields>
732         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
733             <actions>
734                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
735                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
736                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
737                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
738             </actions>
739         </permacrud>
740     </class>
741
742     <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">
743         <fields oils_persist:primary="id">
744             <field reporter:label="ID" name="id" reporter:datatype="id"/>
745             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
746             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
747             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
748             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
749         </fields>
750         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
751             <actions>
752                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
753                 <retrieve/>
754                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
755                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
756             </actions>
757         </permacrud>
758     </class>
759
760         <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">
761                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
762                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
763                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
764                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
765                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
766                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
767                 </fields>
768                 <links>
769                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
770                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
771                 </links>
772         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
773             <actions>
774                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
775                 <retrieve/>
776                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
777                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
778             </actions>
779         </permacrud>
780         </class>
781
782         <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">
783                 <fields oils_persist:primary="name">
784                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
785                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true"/>
786                         <field reporter:label="Description" name="description" reporter:datatype="text" />
787                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
788                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
789                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
790                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
791                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
792                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
793                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
794                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
795                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
796                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
797                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
798                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
799                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
800                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
801                 </fields>
802                 <links>
803                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
804                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
805                 </links>
806         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
807             <actions>
808                 <create permission="ADMIN_SVF" global_required="true"/>
809                 <retrieve/>
810                 <update permission="ADMIN_SVF" global_required="true"/>
811                 <delete permission="ADMIN_SVF" global_required="true"/>
812             </actions>
813         </permacrud>
814         </class>
815
816         <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">
817                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
818                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
819                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
820                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
821             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
822                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
823                 </fields>
824                 <links/>
825         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
826             <actions>
827                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
828                 <retrieve/>
829                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
830                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
831             </actions>
832         </permacrud>
833         </class>
834
835         <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">
836                 <fields oils_persist:primary="coded_value">
837                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
838                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
839                 </fields>
840                 <links>
841                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
842                 </links>
843         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
844             <actions>
845                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
846                 <retrieve/>
847                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
848                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
849             </actions>
850         </permacrud>
851         </class>
852
853         <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">
854                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
855                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
856                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
857                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
858                 </fields>
859                 <links>
860                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
861                 </links>
862         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
863             <actions>
864                 <retrieve/>
865             </actions>
866         </permacrud>
867         </class>
868
869
870         <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">
871                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
872                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
873                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
874                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
875                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
876                 </fields>
877                 <links>
878                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
879                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
880                 </links>
881         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
882             <actions>
883                 <retrieve/>
884             </actions>
885         </permacrud>
886         </class>
887
888
889         <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">
890                 <fields oils_persist:primary="source">
891                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
892                         <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 -->
893                 </fields>
894                 <links>
895                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
896                 </links>
897         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
898             <actions>
899                 <retrieve/>
900             </actions>
901         </permacrud>
902         </class>
903
904         <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">
905                 <fields>
906                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
907                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
908                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
909                 </fields>
910                 <links>
911                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
912                 </links>
913         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
914             <actions>
915                 <retrieve/>
916             </actions>
917         </permacrud>
918         </class>
919
920         <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">
921                 <fields oils_persist:primary="id">
922                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
923                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
924                 </fields>
925                 <links>
926                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
927                 </links>
928         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
929             <actions>
930                 <retrieve/>
931             </actions>
932         </permacrud>
933         </class>
934
935         <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">
936                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
937                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
938                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
939                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
940                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
941                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
942                 </fields>
943                 <links>
944                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
945                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
946                 </links>
947         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
948             <actions>
949                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
950                 <retrieve/>
951                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
952                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
953             </actions>
954         </permacrud>
955         </class>
956
957         <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">
958                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
959                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
960                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
961                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
962                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
963                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
964                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
965                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
966             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
967             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
968                 </fields>
969                 <links>
970                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
971                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
972                 </links>
973         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
974             <actions>
975                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
976                 <retrieve/>
977                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
978                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
979             </actions>
980         </permacrud>
981         </class>
982
983         <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">
984                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
985                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
986                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
987                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
988                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
989                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
990                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
991                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
992                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
993                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
994                 </fields>
995                 <links>
996                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
997                 </links>
998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
999             <actions>
1000                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1001                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1002                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1003                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1004             </actions>
1005         </permacrud>
1006         </class>
1007
1008     <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">
1009         <fields oils_persist:primary="name">
1010             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1011             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1012             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1013             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1014             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1015             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1016             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1017             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1018             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1019             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1020         </fields>
1021         <links>
1022             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1023             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1024         </links>
1025         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1026             <actions>
1027                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1028                 <retrieve/>
1029                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1030                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1031             </actions>
1032         </permacrud>
1033     </class>
1034
1035     <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">
1036         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1037             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1038             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1039             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1040             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1041             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1042             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1043             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1044         </fields>
1045         <links>
1046             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1047         </links>
1048         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1049             <actions>
1050                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1051                 <retrieve/>
1052                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1053                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1054             </actions>
1055         </permacrud>
1056     </class>
1057
1058     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1059                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1060                         oils_persist:tablename="config.z3950_index_field_map" 
1061                         reporter:label="Z39.50 Index Field Map">
1062         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1063             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1064             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1065             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1066             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1067             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1068             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1069         </fields>
1070         <links>
1071             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1072             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1073             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1074         </links>
1075         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1076             <actions>
1077                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1078                 <retrieve/>
1079                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1080                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1081             </actions>
1082         </permacrud>
1083     </class>
1084
1085
1086         <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">
1087                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1088                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1089                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1090                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1091                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1092                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1093                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1094                 </fields>
1095                 <links>
1096             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1097             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1098                 </links>
1099                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1100                         <actions>
1101                                 <retrieve/>
1102                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1103                         </actions>
1104                 </permacrud>
1105         </class>
1106
1107         <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">
1108                 <fields oils_persist:primary="key">
1109                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1110                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1111                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1112                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1113                 </fields>
1114                 <links/>
1115                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1116                         <actions>
1117                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1118                                 <retrieve/>
1119                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1120                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1121                         </actions>
1122                 </permacrud>
1123         </class>
1124
1125         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1126                 <fields oils_persist:primary="module">
1127                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1128                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1129                 </fields>
1130                 <links/>
1131         </class>
1132
1133         <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">
1134                 <fields oils_persist:primary="module">
1135                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1136                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1137                 </fields>
1138                 <links/>
1139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1140                         <actions>
1141                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1142                                 <retrieve/>
1143                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1144                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1145                         </actions>
1146                 </permacrud>
1147         </class>
1148
1149         <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">
1150                 <fields oils_persist:primary="module">
1151                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1152                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1153                 </fields>
1154                 <links/>
1155                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1156                         <actions>
1157                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1158                                 <retrieve/>
1159                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1160                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1161                         </actions>
1162                 </permacrud>
1163         </class>
1164
1165         <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">
1166                 <fields oils_persist:primary="module">
1167                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1168                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1169                 </fields>
1170                 <links/>
1171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1172                         <actions>
1173                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1174                                 <retrieve/>
1175                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1176                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1177                         </actions>
1178                 </permacrud>
1179         </class>
1180
1181         <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">
1182                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1183                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1184                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1185                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1186                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1187                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1188                 </fields>
1189                 <links>
1190                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1191                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1192                 </links>
1193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1194                         <actions>
1195                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1196                     <context link="event_def" field="owner"/>
1197                 </create>
1198                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1199                     <context link="event_def" field="owner"/>
1200                 </retrieve>
1201                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1202                     <context link="event_def" field="owner"/>
1203                 </update>
1204                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1205                     <context link="event_def" field="owner"/>
1206                 </delete>
1207                         </actions>
1208                 </permacrud>
1209         </class>
1210
1211         <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">
1212                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1213                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1214                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1215                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1216                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1217                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1218                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1219                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1220                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1221                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1222                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1223                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1224                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1225                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1226                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1227                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1228                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1229                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1230                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1231                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1232                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1233                 </fields>
1234                 <links>
1235                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1236                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1237                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1238                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1239                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1240                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1241                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1242                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1243                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1244                 </links>
1245                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1246                         <actions>
1247                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1248                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1249                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1250                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1251                         </actions>
1252                 </permacrud>
1253         </class>
1254
1255         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1256                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1257                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1258                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1259                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1260                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1261                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1262                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1263                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1264                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1265                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1266                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1267                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1268                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1269                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1270                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1271                 </fields>
1272                 <links>
1273                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1274                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1275                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1276                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1277                 </links>
1278         </class>
1279
1280         <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">
1281                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1282                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1283                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1284                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1285                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1286                 </fields>
1287                 <links>
1288                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1289                 </links>
1290                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291                         <actions>
1292                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1293                     <context link="event_def" field="owner"/>
1294                 </create>
1295                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1296                     <context link="event_def" field="owner"/>
1297                 </retrieve>
1298                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1299                     <context link="event_def" field="owner"/>
1300                 </update>
1301                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1302                     <context link="event_def" field="owner"/>
1303                 </delete>
1304                         </actions>
1305                 </permacrud>
1306         </class>
1307
1308         <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">
1309                 <oils_persist:source_definition><![CDATA[
1310                 SELECT  atevdef.hook,
1311                         atevdef.name,
1312                         atevdef.reactor,
1313                         atev.id,
1314                         atev.event_def,
1315                         atev.add_time,
1316                         atev.run_time,
1317                         atev.start_time,
1318                         atev.update_time,
1319                         atev.complete_time,
1320                         atev.update_process,
1321                         atev.state,
1322                         atev.user_data,
1323                         atev.template_output,
1324                         atev.error_output,
1325                         atev.async_output,
1326                         targ_circ.id AS target_circ,
1327                         targ_ahr.id AS target_hold,
1328                         COALESCE(
1329                                 targ_circ.circ_lib,
1330                                 targ_ahr.pickup_lib
1331                         ) AS perm_lib
1332                 FROM action_trigger.event atev
1333                 JOIN action_trigger.event_definition atevdef ON
1334                         (atevdef.id = atev.event_def)
1335                 JOIN action_trigger.hook ath ON
1336                         (ath.key = atevdef.hook)
1337                 LEFT JOIN action.circulation targ_circ ON
1338                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1339                 LEFT JOIN action.hold_request targ_ahr ON
1340                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1341                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1342                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1343                                 'circ.staff.max_visible_event_age',
1344                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1345                         ) UNION
1346                         SELECT '1000 YEARS'::INTERVAL AS value
1347                 ) ous)
1348                 ]]></oils_persist:source_definition>
1349                 <fields oils_persist:primary="id">
1350                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1351                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1352                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1353                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1354                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1355                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1356                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1357                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1358                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1359                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1360                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1361                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1362                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1363                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1364                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1365                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1366                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1367                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1368                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1369                 </fields>
1370                 <links>
1371                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1372                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1373                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1374                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1375                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1376                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1377                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1378                 </links>
1379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1380                         <actions>
1381                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1382                         </actions>
1383                 </permacrud>
1384         </class>
1385
1386         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1387                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1388                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1389                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1390                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1391                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1392                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1393                 </fields>
1394                 <links>
1395                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1396                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1397                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1398                 </links>
1399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1400                         <actions>
1401                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1402                         </actions>
1403                 </permacrud>
1404         </class>
1405
1406         <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">
1407                 <fields oils_persist:primary="code">
1408                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1409                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1410                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1411                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1412                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1413                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1414                 </fields>
1415                 <links/>
1416         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1417             <actions>
1418                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1419                 <retrieve/>
1420                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1421                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1422             </actions>
1423         </permacrud>
1424         </class>
1425
1426         <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">
1427                 <fields oils_persist:primary="code">
1428                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1429                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1430                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1431                 </fields>
1432                 <links/>
1433         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1434             <actions>
1435                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1436                 <retrieve/>
1437                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1438                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1439             </actions>
1440         </permacrud>
1441         </class>
1442
1443         <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">
1444                 <fields oils_persist:primary="code">
1445                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1446                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1447                 </fields>
1448                 <links/>
1449         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1450             <actions>
1451                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1452                 <retrieve/>
1453                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1454                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1455             </actions>
1456         </permacrud>
1457         </class>
1458
1459         <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">
1460                 <fields oils_persist:primary="code">
1461                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1462                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1463                 </fields>
1464                 <links/>
1465         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1466             <actions>
1467                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1468                 <retrieve/>
1469                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1470                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1471             </actions>
1472         </permacrud>
1473         </class>
1474
1475         <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">
1476                 <fields oils_persist:primary="code">
1477                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1478                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1479                 </fields>
1480                 <links/>
1481         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1482             <actions>
1483                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1484                 <retrieve/>
1485                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1486                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1487             </actions>
1488         </permacrud>
1489         </class>
1490
1491         <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">
1492                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1493                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1494                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1495                 </fields>
1496                 <links/>
1497         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1498             <actions>
1499                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1500                 <retrieve/>
1501                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1502                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1503             </actions>
1504         </permacrud>
1505         </class>
1506
1507         <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">
1508                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1509                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1510                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1511                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1512                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1513                 </fields>
1514         <links>
1515             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1516             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1517             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1518         </links>
1519         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1520             <actions>
1521                 <create permission="UPDATE_COPY">
1522                     <context link="target_copy" field="circ_lib"/>
1523                 </create>
1524                 <retrieve/>
1525                 <update permission="UPDATE_COPY">
1526                     <context link="target_copy" field="circ_lib"/>
1527                 </update>
1528                 <delete permission="UPDATE_COPY">
1529                     <context link="target_copy" field="circ_lib"/>
1530                 </delete>
1531             </actions>
1532         </permacrud>
1533         </class>
1534
1535         <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">
1536                 <fields oils_persist:primary="code">
1537                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1538                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1539                 </fields>
1540                 <links/>
1541         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1542             <actions>
1543                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1544                 <retrieve/>
1545                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1546                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1547             </actions>
1548         </permacrud>
1549         </class>
1550
1551         <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">
1552                 <fields oils_persist:primary="code">
1553                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1554                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1555                 </fields>
1556                 <links/>
1557         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1558             <actions>
1559                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1560                 <retrieve/>
1561                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1562                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1563             </actions>
1564         </permacrud>
1565         </class>
1566
1567         <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">
1568                 <fields oils_persist:primary="code">
1569                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1570                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1571                 </fields>
1572                 <links/>
1573         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1574             <actions>
1575                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1576                 <retrieve/>
1577                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1578                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1579             </actions>
1580         </permacrud>
1581         </class>
1582
1583     <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">
1584         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1585             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1586             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1587             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1588             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1589             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1590             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1591             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1592             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1593             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1594             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1595             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1596             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1597             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1598             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1599             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1600             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1601             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1602         </fields>
1603         <links/>
1604         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1605             <actions>
1606                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1607                 <retrieve/>
1608                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1609                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1610             </actions>
1611         </permacrud>
1612     </class>
1613
1614     <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">
1615         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1616             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1617             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1618             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1619             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1620             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1621             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1622             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1623             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1624             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1625             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1626             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1627             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1628             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1629             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1630             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1631             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1632             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1633             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1634             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1635         </fields>
1636         <links/>
1637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1638             <actions>
1639                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1640                 <retrieve/>
1641                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1642                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1643             </actions>
1644         </permacrud>
1645     </class>
1646
1647     <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">
1648         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1649             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1650             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1651             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1652             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1653             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1654         </fields>
1655         <links>
1656             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1657             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1658             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1659         </links>
1660         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1661             <actions>
1662                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1663                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1664                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1665                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1666             </actions>
1667         </permacrud>
1668     </class>
1669
1670         <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">
1671                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1672                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1673                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1674                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1675                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1676                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1677                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1678                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1679                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1680                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1681                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1682                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1683                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1684                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1685                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1686                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1687                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1688             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1689                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1690                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1691                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1692                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1693                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1694                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1695                 </fields>
1696                 <links>
1697                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1698                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1699                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1700                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1701                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1702                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1703                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1704                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1705                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1706                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1707                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1708                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1709                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1710             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1711                 </links>
1712         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1713             <actions>
1714                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1715                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1716                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1717                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1718             </actions>
1719         </permacrud>
1720         </class>
1721
1722         <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">
1723                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1724                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1725                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1726                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1727                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1728                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1729                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1730                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1731                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1732                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1733                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1734                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1735                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1736                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1737                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1738                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1739             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1740                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1741                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1742             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1743                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1744                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1745                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1746                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1747             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1748             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1749             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1750                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1751                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1752                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1753                 </fields>
1754                 <links>
1755                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1756                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1757                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1758                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1759                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1760                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1761                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1762                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1763                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1764                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1765                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1766                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1767                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1768                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1769             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1770                 </links>
1771         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1772             <actions>
1773                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1774                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1775                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1776                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1777             </actions>
1778         </permacrud>
1779         </class>
1780
1781     <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">
1782         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1783             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1784             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1785             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1786         </fields>
1787         <links/>
1788         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1789             <actions>
1790                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1791                 <retrieve/>
1792                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1793                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1794             </actions>
1795         </permacrud>
1796     </class>
1797
1798     <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">
1799         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1800             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1801             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1802             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1803             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1804             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1805             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1806             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1807         </fields>
1808         <links>
1809             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1810         </links>
1811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1812             <actions>
1813                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1814                 <retrieve/>
1815                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1816                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1817             </actions>
1818         </permacrud>
1819     </class>
1820
1821     <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">
1822         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
1823             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1824             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
1825             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1826             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
1827             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1828         </fields>
1829         <links>
1830             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
1831             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1832         </links>
1833         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1834             <actions>
1835                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1836                     <context link="matchpoint" field="org_unit"/>
1837                 </create>
1838                 <retrieve/>
1839                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1840                     <context link="matchpoint" field="org_unit"/>
1841                 </update>
1842                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1843                     <context link="matchpoint" field="org_unit"/>
1844                 </delete>
1845             </actions>
1846         </permacrud>
1847     </class>
1848
1849     <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">
1850         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
1851             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1852             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1853             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
1854         </fields>
1855         <links>
1856             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1857             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
1858         </links>
1859         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1860             <actions>
1861                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1862                     <context link="limit_set" field="owning_lib"/>
1863                 </create>
1864                 <retrieve/>
1865                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1866                     <context link="limit_set" field="owning_lib"/>
1867                 </update>
1868                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1869                     <context link="limit_set" field="owning_lib"/>
1870                 </delete>
1871             </actions>
1872         </permacrud>
1873     </class>
1874     <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">
1875         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
1876             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1877             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1878             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
1879         </fields>
1880         <links>
1881             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1882             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
1883         </links>
1884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1885             <actions>
1886                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1887                     <context link="limit_set" field="owning_lib"/>
1888                 </create>
1889                 <retrieve/>
1890                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1891                     <context link="limit_set" field="owning_lib"/>
1892                 </update>
1893                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1894                     <context link="limit_set" field="owning_lib"/>
1895                 </delete>
1896             </actions>
1897         </permacrud>
1898     </class>
1899
1900     <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">
1901         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
1902             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1903             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1904             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
1905             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
1906         </fields>
1907         <links>
1908             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1909             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
1910         </links>
1911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1912             <actions>
1913                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1914                     <context link="limit_set" field="owning_lib"/>
1915                 </create>
1916                 <retrieve/>
1917                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1918                     <context link="limit_set" field="owning_lib"/>
1919                 </update>
1920                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1921                     <context link="limit_set" field="owning_lib"/>
1922                 </delete>
1923             </actions>
1924         </permacrud>
1925     </class>
1926
1927         <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">
1928                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
1929                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1930                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1931                 </fields>
1932                 <links/>
1933         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1934             <actions>
1935                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
1936                 <retrieve/>
1937                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
1938                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
1939             </actions>
1940         </permacrud>
1941         </class>
1942
1943         <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">
1944                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
1945                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
1946                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
1947                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
1948                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
1949                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
1950                 </fields>
1951                 <links>
1952                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
1953                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
1954                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
1955                 </links>
1956         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1957             <actions>
1958                 <create permission="ADMIN_SURVEY">
1959                     <context link="survey" field="owner"/>
1960                 </create>
1961                 <retrieve/>
1962                 <update permission="ADMIN_SURVEY">
1963                     <context link="survey" field="owner"/>
1964                 </update>
1965                 <delete permission="ADMIN_SURVEY">
1966                     <context link="survey" field="owner"/>
1967                 </delete>
1968             </actions>
1969         </permacrud>
1970         </class>
1971         <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">
1972                 <fields oils_persist:primary="id" oils_persist:sequence="">
1973                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
1974                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
1975                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
1976                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
1977                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
1978                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
1979                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
1980                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
1981                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
1982                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
1983                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
1984                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
1985                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
1986                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
1987                 </fields>
1988                 <links>
1989                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1990                 </links>
1991                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1992                         <actions>
1993                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
1994                                         <context link="usr" field="home_ou" />
1995                                 </retrieve>
1996                         </actions>
1997                 </permacrud>
1998         </class>
1999         <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">
2000                 <fields oils_persist:primary="id" oils_persist:sequence="">
2001                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2002                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2003                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2004                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2005                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2006                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2007                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2008                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2009                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2010                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2011                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2012                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2013                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2014                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2015                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2016                 </fields>
2017                 <links>
2018                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2019                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2020                 </links>
2021         </class>
2022         <class id="aun" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_note" oils_persist:tablename="actor.usr_note" reporter:label="User Note">
2023                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2024                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2025                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2026                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2027                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2028                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2029                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2030                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2031                 </fields>
2032                 <links>
2033                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2034                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2035                 </links>
2036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2037             <actions>
2038                 <create permission="UPDATE_USER" context_field="owner">
2039                     <context link="usr" field="home_ou"/>
2040                 </create>
2041                                 <!-- note: public notes are still accessible via API -->
2042                 <retrieve permission="UPDATE_USER">
2043                     <context link="usr" field="home_ou"/>
2044                                 </retrieve>
2045                 <update permission="UPDATE_USER">
2046                     <context link="usr" field="home_ou"/>
2047                                 </update>
2048                 <delete permission="UPDATE_USER">
2049                     <context link="usr" field="home_ou"/>
2050                                 </delete>
2051             </actions>
2052         </permacrud>
2053         </class>
2054         <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">
2055                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2056                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2057                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2058                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2059                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2060                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2061                 </fields>
2062                 <links>
2063                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2064                 </links>
2065         </class>
2066         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2067                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2068                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2069                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2070                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2071                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2072                 </fields>
2073                 <links>
2074                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2075                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2076                 </links>
2077         </class>
2078         <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">
2079                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2080                         <field name="field" reporter:datatype="link"/>
2081                         <field name="id" reporter:datatype="id" />
2082                         <field name="source" reporter:datatype="link"/>
2083                         <field name="value" reporter:datatype="text"/>
2084                 </fields>
2085                 <links>
2086                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2087                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2088                 </links>
2089         </class>
2090         <class id="aihu" controller="open-ils.cstore" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2091                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2092                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2093                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2094                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2095                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2096                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2097                 </fields>
2098                 <links>
2099                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2100                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2101                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2102                 </links>
2103         </class>
2104         <class id="ancihu" controller="open-ils.cstore" 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">
2105                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2106                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2107                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2108                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2109                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2110                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2111                 </fields>
2112                 <links>
2113                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2114                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2115                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2116                 </links>
2117         </class>
2118         <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">
2119                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2120                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2121                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2122                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2123                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2124                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2125                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2126                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2127                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2128                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2129                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2130                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2131                 </fields>
2132                 <links>
2133                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2134                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2135                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2136                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2137                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2138                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2139                 </links>
2140         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2141             <actions>
2142                 <create permission="TRANSIT_COPY" context_field="owner">
2143                     <context link="target_copy" field="circ_lib"/>
2144                 </create>
2145                 <retrieve/>
2146                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2147                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2148             </actions>
2149         </permacrud>
2150         </class>
2151         <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">
2152                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2153                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2154                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2155                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2156                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2157                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2158                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2159                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2160                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2161                 </fields>
2162                 <links>
2163                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2164                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2165                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2166                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2167                 </links>
2168         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2169             <actions>
2170                 <create permission="ADMIN_SURVEY">
2171                     <context link="survey" field="owner"/>
2172                 </create>
2173                 <retrieve/>
2174                 <update permission="ADMIN_SURVEY">
2175                     <context link="survey" field="owner"/>
2176                 </update>
2177                 <delete permission="ADMIN_SURVEY">
2178                     <context link="survey" field="owner"/>
2179                 </delete>
2180             </actions>
2181         </permacrud>
2182         </class>
2183         <class id="ccbi" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2184                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2185                         <field name="bucket" />
2186                         <field name="id" reporter:datatype="id" />
2187                         <field name="target_copy" reporter:datatype="link"/>
2188                         <field name="create_time" reporter:datatype="timestamp" />
2189                         <field name="pos" reporter:datatype="int" />
2190                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2191                 </fields>
2192                 <links>
2193                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2194                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2195             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2196                 </links>
2197         </class>
2198         <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">
2199                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2200                         <field name="id" reporter:datatype="id" />
2201                         <field name="item" reporter:datatype="link"/>
2202                         <field name="note" reporter:datatype="text" />
2203                 </fields>
2204                 <links>
2205                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2206                 </links>
2207         </class>
2208
2209         <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">
2210                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2211                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2212                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2213                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2214                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2215                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2216                 </fields>
2217                 <links>
2218                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2219                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2220                 </links>
2221                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2222                         <actions>
2223                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2224                                 <retrieve/>
2225                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2226                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2227                         </actions>
2228                 </permacrud>
2229         </class>
2230
2231         <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">
2232                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2233                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2234                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2235                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2236                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2237                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2238                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2239                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2240                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2241                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2242                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2243                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2244                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2245                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2246                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2247                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2248                 </fields>
2249                 <links>
2250                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2251                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2252                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2253                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2254                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2255                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2256                 </links>
2257                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2258                         <actions>
2259                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2260                                 <retrieve/>
2261                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2262                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2263                         </actions>
2264                 </permacrud>
2265         </class>
2266
2267         <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">
2268                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2269                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2270                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2271                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2272                 </fields>
2273                 <links>
2274                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2275                 </links>
2276                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2277                         <actions>
2278                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2279                                 <retrieve/>
2280                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2281                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2282                         </actions>
2283                 </permacrud>
2284         </class>
2285
2286         <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">
2287                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2288                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2289                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2290                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2291                 </fields>
2292                 <links>
2293                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2294                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2295                 </links>
2296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2297                         <actions>
2298                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2299                                 <retrieve/>
2300                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2301                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2302                         </actions>
2303                 </permacrud>
2304         </class>
2305
2306         <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">
2307                 <fields oils_persist:primary="code">
2308                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2309                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2310                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2311                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2312                 </fields>
2313                 <links>
2314                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2315                 </links>
2316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2317                         <actions>
2318                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2319                                 <retrieve/>
2320                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2321                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2322                         </actions>
2323                 </permacrud>
2324         </class>
2325
2326         <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">
2327                 <fields oils_persist:primary="code">
2328                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2329                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2330                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2331                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2332                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2333                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2334                 </fields>
2335                 <links>
2336                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2337                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2338                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2339                 </links>
2340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2341                         <actions>
2342                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2343                                 <retrieve/>
2344                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2345                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2346                         </actions>
2347                 </permacrud>
2348         </class>
2349
2350     <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">
2351         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2352             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2353             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2354             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2355         </fields>
2356         <links>
2357             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2358             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2359         </links>
2360         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2361             <actions>
2362                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2363                 <retrieve/>
2364                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2365                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2366             </actions>
2367         </permacrud>
2368     </class>
2369
2370         <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">
2371                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2372                         <field name="active" reporter:datatype="bool"/>
2373                         <field name="create_date" reporter:datatype="timestamp"/>
2374                         <field name="creator" />
2375                         <field name="deleted" reporter:datatype="bool"/>
2376                         <field name="edit_date" reporter:datatype="timestamp"/>
2377                         <field name="editor" />
2378                         <field name="id" reporter:datatype="id" />
2379                         <field name="last_xact_id" />
2380                         <field name="marc" />
2381                         <field name="source" />
2382                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2383                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2384                         <field name="heading" />
2385                         <field name="simple_heading" />
2386                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2387                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2388                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2389                 </fields>
2390                 <links>
2391                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2392                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2393                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2394                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2395                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2396                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2397                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2398                 </links>
2399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2400                         <actions>
2401                                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2402                                 <retrieve/>
2403                                 <update permission="UPDATE_MARC" global_required="true"/>
2404                                 <delete permission="UPDATE_MARC" global_required="true"/>
2405                         </actions>
2406                 </permacrud>
2407         </class>
2408         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2409                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2410                         <field name="char_encoding" />
2411                         <field name="id" />
2412                         <field name="record" />
2413                         <field name="record_status" />
2414                         <field name="thesaurus" />
2415                 </fields>
2416                 <links>
2417                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2418                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2419                 </links>
2420         </class>
2421         <class id="abl" controller="open-ils.cstore" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
2422                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2423                         <field name="id" reporter:datatype="id" />
2424                         <field name="bib" reporter:datatype="link" />
2425                         <field name="authority" reporter:datatype="link" />
2426                 </fields>
2427                 <links>
2428                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2429                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2430                 </links>
2431         </class>
2432         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2433                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2434                         <field name="id" reporter:datatype="id" />
2435                         <field name="record" reporter:datatype="link" />
2436                         <field name="atag" reporter:datatype="link" />
2437                         <field name="value" reporter:datatype="text" />
2438                 </fields>
2439                 <links>
2440                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2441                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2442                 </links>
2443         </class>
2444         <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">
2445                 <fields oils_persist:primary="code" oils_persist:sequence="">
2446                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2447                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2448                 </fields>
2449                 <links/>
2450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2451             <actions>
2452                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2453                 <retrieve/>
2454                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2455                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2456             </actions>
2457         </permacrud>
2458         </class>
2459         <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">
2460                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2461                         <field name="accepting_usr" />
2462                         <field name="amount" reporter:datatype="money" />
2463                         <field name="amount_collected" reporter:datatype="money" />
2464                         <field name="approval_code" reporter:datatype="text"/>
2465                         <field name="cash_drawer" reporter:datatype="link"/>
2466                         <field name="cc_first_name" reporter:datatype="text"/>
2467                         <field name="cc_last_name" reporter:datatype="text"/>
2468                         <field name="cc_number" reporter:datatype="text"/>
2469                         <field name="cc_order_number" reporter:datatype="text"/>
2470                         <field name="cc_type" reporter:datatype="text"/>
2471                         <field name="cc_processor" reporter:datatype="text"/>
2472                         <field name="expire_month" reporter:datatype="int" />
2473                         <field name="expire_year" reporter:datatype="int" />
2474                         <field name="id" reporter:datatype="id" />
2475                         <field name="note" reporter:datatype="text"/>
2476                         <field name="payment_ts" reporter:datatype="timestamp"/>
2477                         <field name="xact" reporter:datatype="link"/>
2478                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2479                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2480                 </fields>
2481                 <links>
2482                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2483                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2484                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2485                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2486                 </links>
2487         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2488             <actions>
2489                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2490                     <context link="xact" jump="usr" field="home_ou"/>
2491                 </retrieve>
2492                         </actions>
2493                 </permacrud>
2494         </class>
2495         <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">
2496                 <fields oils_persist:primary="name">
2497                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2498                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2499                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2500                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2501                 </fields>
2502                 <links/>
2503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2504             <actions>
2505                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2506                 <retrieve/>
2507                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2508                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2509             </actions>
2510         </permacrud>
2511         </class>
2512
2513         <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">
2514                 <fields oils_persist:primary="alias">
2515                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2516                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2517                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2518                 </fields>
2519                 <links>
2520                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2521                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2522                 </links>
2523         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2524             <actions>
2525                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2526                 <retrieve/>
2527                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2528                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2529             </actions>
2530         </permacrud>
2531         </class>
2532
2533         <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">
2534                 <fields oils_persist:primary="name">
2535                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2536                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2537                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2538                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2539                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2540                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2541                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2542                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2543                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2544                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2545                 </fields>
2546                 <links>
2547                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2548                 </links>
2549         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2550             <actions>
2551                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2552                 <retrieve/>
2553                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2554                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2555             </actions>
2556         </permacrud>
2557         </class>
2558
2559         <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">
2560                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2561                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2562                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2563                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2564                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2565                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2566                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2567                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2568                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2569                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2570                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2571                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2572                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2573                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2574                 </fields>
2575                 <links>
2576                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2577                 </links>
2578         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2579             <actions>
2580                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2581                 <retrieve/>
2582                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2583                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2584             </actions>
2585         </permacrud>
2586         </class>
2587         <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">
2588                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2589                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2590                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2591                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2592                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2593                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2594                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2595                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2596                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2597                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2598                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2599                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2600                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2601                 </fields>
2602                 <links>
2603                 </links>
2604                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2605                         <actions>
2606                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2607                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2608                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2609                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2610                         </actions>
2611                 </permacrud>
2612         </class>
2613         <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">
2614                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2615                         <field name="id" reporter:datatype="id" />
2616                         <field name="name" reporter:datatype="text"/>
2617                         <field name="xpath" reporter:datatype="text"/>
2618                         <field name="format" reporter:datatype="link"/>
2619                         <field name="first_word" reporter:datatype="bool" />
2620                 </fields>
2621                 <links/>
2622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2623             <actions>
2624                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2625                 <retrieve/>
2626                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2627                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2628             </actions>
2629         </permacrud>
2630         </class>
2631         <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">
2632                 <fields oils_persist:primary="code" oils_persist:sequence="">
2633                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2634                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2635                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2636                 </fields>
2637                 <links/>
2638         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2639             <actions>
2640                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2641                 <retrieve/>
2642                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2643                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2644             </actions>
2645         </permacrud>
2646         </class>
2647         <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">
2648                 <fields oils_persist:primary="code" oils_persist:sequence="">
2649                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2650                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2651                 </fields>
2652                 <links/>
2653         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2654             <actions>
2655                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2656                 <retrieve/>
2657                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2658                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2659             </actions>
2660         </permacrud>
2661         </class>
2662     <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">
2663         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2664             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2665             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2666             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2667             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2668         </fields>
2669         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2670             <actions>
2671                 <retrieve/>
2672             </actions>
2673         </permacrud>
2674     </class>
2675         <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">
2676                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2677                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2678                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2679                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2680                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2681                 </fields>
2682                 <links>
2683                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2684                 </links>
2685         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2686             <actions>
2687                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2688                 <retrieve/>
2689                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2690                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2691             </actions>
2692         </permacrud>
2693         </class>
2694         <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">
2695                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2696                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2697                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2698                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2699                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2700                 </fields>
2701                 <links>
2702                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2703                 </links>
2704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2705             <actions>
2706                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2707                 <retrieve/>
2708                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2709                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2710             </actions>
2711         </permacrud>
2712         </class>
2713         <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">
2714                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2715                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2716                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2717                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2718                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2719                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2720                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2721                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2722                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2723                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2724                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2725                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2726                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2727                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2728                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2729                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2730                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2731                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2732                 </fields>
2733                 <links>
2734                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2735                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2736                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2737                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2738                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2739                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2740                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2741                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2742                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2743                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2744                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2745                 </links>
2746         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2747             <actions>
2748                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2749                 <retrieve/>
2750                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2751                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2752             </actions>
2753         </permacrud>
2754         </class>
2755         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2756                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2757                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2758                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2759                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2760                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2761                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2762                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2763                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2764                 </fields>
2765                 <links>
2766                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2767                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
2768         </links>
2769         </class>
2770         <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">
2771                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
2772                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2773                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
2774                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
2775                 </fields>
2776                 <links>
2777                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
2778                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
2779                 </links>
2780         </class>
2781         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
2782                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
2783                         <field name="id" reporter:datatype="id" />
2784                         <field name="value" oils_persist:i18n="true" />
2785                 </fields>
2786                 <links/>
2787         </class>
2788         <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">
2789                 <fields oils_persist:primary="usr" oils_persist:sequence="">
2790                         <field name="balance_owed" reporter:datatype="money" />
2791                         <field name="total_owed" reporter:datatype="money" />
2792                         <field name="total_paid" reporter:datatype="money" />
2793                         <field name="usr" reporter:datatype="link"/>
2794                 </fields>
2795                 <links>
2796                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2797         </links>
2798         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2799             <actions>
2800                 <retrieve permission="VIEW_USER">
2801                     <context link="usr" field="home_ou"/>
2802                 </retrieve>
2803             </actions>
2804         </permacrud>
2805         </class>
2806         <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">
2807                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
2808                         <field name="collector" />
2809                         <field name="enter_time" reporter:datatype="timestamp"/>
2810                         <field name="id" reporter:datatype="id" />
2811                         <field name="location" reporter:datatype="link"/>
2812                         <field name="usr" reporter:datatype="link"/>
2813                 </fields>
2814                 <links>
2815                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2816                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
2817                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
2818                 </links>
2819         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2820             <actions>
2821                 <create permission="money.collections_tracker.create" context_field="location"/>
2822                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
2823                 <delete permission="money.collections_tracker.create" context_field="location"/>
2824             </actions>
2825         </permacrud>
2826         </class>
2827         <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">
2828                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
2829                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2830                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2831                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
2832                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2833                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
2834                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
2835                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
2836                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2837                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
2838                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
2839                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
2840                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
2841                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
2842                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
2843                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
2844                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
2845                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2846                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
2847                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
2848                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
2849                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2850                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2851                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2852                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2853                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2854                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2855                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2856                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2857                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
2858                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
2859                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
2860                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
2861                 </fields>
2862                 <links>
2863                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2864                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2865                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2866                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
2867                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
2868                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
2869                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
2870                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
2871                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
2872                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
2873                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
2874                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
2875                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
2876                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
2877                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
2878                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
2879                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
2880                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
2881                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
2882                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
2883                 </links>
2884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2885             <actions>
2886                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2887                 <retrieve/>
2888                 <update permission="UPDATE_MARC" global_required="true"/>
2889             </actions>
2890         </permacrud>
2891         </class>
2892         <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">
2893                 <fields oils_persist:primary="id">
2894                         <field name="dow_0_close" />
2895                         <field name="dow_0_open" />
2896                         <field name="dow_1_close" />
2897                         <field name="dow_1_open" />
2898                         <field name="dow_2_close" />
2899                         <field name="dow_2_open" />
2900                         <field name="dow_3_close" />
2901                         <field name="dow_3_open" />
2902                         <field name="dow_4_close" />
2903                         <field name="dow_4_open" />
2904                         <field name="dow_5_close" />
2905                         <field name="dow_5_open" />
2906                         <field name="dow_6_close" />
2907                         <field name="dow_6_open" />
2908                         <field name="id" reporter:datatype="id" />
2909                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
2910                 </fields>
2911                 <links>
2912                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
2913                 </links>
2914         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2915             <actions>
2916                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
2917                 <retrieve/>
2918                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
2919                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
2920             </actions>
2921         </permacrud>
2922         </class>
2923         <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">
2924                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
2925                         <field name="id" reporter:datatype="id" />
2926                         <field name="record" reporter:datatype="link"/>
2927                         <field name="label" reporter:datatype="text"/>
2928                         <field name="label_sortkey" reporter:datatype="text"/>
2929                 </fields>
2930                 <links>
2931                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2932                 </links>
2933         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2934             <actions>
2935                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
2936                 <retrieve/>
2937                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
2938                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
2939             </actions>
2940         </permacrud>
2941         </class>
2942         <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">
2943                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
2944                         <field name="id" reporter:datatype="id" />
2945                         <field name="target_copy" reporter:datatype="link" />
2946                         <field name="part" reporter:datatype="link"/>
2947                 </fields>
2948                 <links>
2949                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2950                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
2951                 </links>
2952         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2953             <actions>
2954                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
2955                 <retrieve/>
2956                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
2957                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
2958             </actions>
2959         </permacrud>
2960         </class>
2961         <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">
2962                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
2963                         <field name="close_end" reporter:datatype="timestamp" />
2964                         <field name="close_start" reporter:datatype="timestamp" />
2965                         <field name="id" reporter:datatype="id" />
2966                         <field name="org_unit" reporter:datatype="org_unit"/>
2967                         <field name="reason" reporter:datatype="text"/>
2968                 </fields>
2969                 <links>
2970                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2971                 </links>
2972         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2973             <actions>
2974                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2975                 <retrieve/>
2976                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2977                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2978             </actions>
2979         </permacrud>
2980         </class>
2981         <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">
2982                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
2983                         <field name="extended" reporter:datatype="interval"/>
2984                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
2985                         <field name="max_renewals" reporter:datatype="int" />
2986                         <field name="name" reporter:datatype="text"/>
2987                         <field name="normal" reporter:datatype="interval"/>
2988                         <field name="shrt" reporter:datatype="interval"/>
2989                 </fields>
2990                 <links>
2991                 </links>
2992         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2993             <actions>
2994                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
2995                 <retrieve/>
2996                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
2997                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
2998             </actions>
2999         </permacrud>
3000         </class>
3001
3002         <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">
3003                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3004                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3005                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3006             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3007                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3008             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3009                 </fields>
3010                 <links>
3011             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3012                 </links>
3013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3014             <actions>
3015                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3016                 <retrieve/>
3017                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3018                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3019             </actions>
3020                 </permacrud>
3021         </class>
3022
3023         <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">
3024                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3025                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3026                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3027                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3028             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3029                 </fields>
3030                 <links>
3031                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3032                 </links>
3033                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3034             <actions>
3035                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3036                 <retrieve/>
3037                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3038                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3039             </actions>
3040                 </permacrud>
3041         </class>
3042
3043         <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">
3044                 <fields oils_persist:primary="id" oils_persist:sequence="">
3045                         <field name="balance_owed" reporter:datatype="money"/>
3046                         <field name="id" reporter:datatype="id" />
3047                         <field name="last_billing_note" reporter:datatype="text"/>
3048                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3049                         <field name="last_billing_type" reporter:datatype="text"/>
3050                         <field name="last_payment_note" reporter:datatype="text"/>
3051                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3052                         <field name="last_payment_type" reporter:datatype="text"/>
3053                         <field name="total_owed" reporter:datatype="money"/>
3054                         <field name="total_paid" reporter:datatype="money"/>
3055                         <field name="usr" reporter:datatype="link"/>
3056                         <field name="xact_finish" reporter:datatype="timestamp" />
3057                         <field name="xact_start" reporter:datatype="timestamp" />
3058                         <field name="xact_type" reporter:datatype="text"/>
3059                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3060                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3061                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3062                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3063                         <field name="billing_location" reporter:datatype="link"/>
3064                 </fields>
3065                 <links>
3066                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3067                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3068                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3069                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3070                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3071                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3072                 </links>
3073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3074                         <actions>
3075                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3076                                         <context link="usr" field="home_ou" />
3077                                 </retrieve>
3078                         </actions>
3079                 </permacrud>
3080         </class>
3081         <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">
3082                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3083                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3084                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3085                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3086                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3087                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3088                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3089                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3090                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3091                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3092                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3093                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3094                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3095                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3096                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3097                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3098                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3099                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3100                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3101                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3102                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3103                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3104                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3105                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3106                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3107                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3108                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3109                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3110                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3111                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3112                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3113                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3114                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3115                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3116                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3117                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3118                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3119                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3120                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3121                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3122                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3123                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3124                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3125                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3126                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3127                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3128                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3129                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3130                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3131                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3132                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3133                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3134                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3135                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3136                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3137                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3138                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3139                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3140                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3141                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3142                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3143                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3144                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3145                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3146                 </fields>
3147                 <links>
3148                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3149                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3150                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3151                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3152                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3153                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3154                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3155                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3156                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3157                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3158                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3159                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3160                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3161                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3162                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3163                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3164                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3165                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3166                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3167                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3168                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3169                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3170                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3171                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3172                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3173                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3174                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3175                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3176                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3177                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3178                 </links>
3179                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3180                         <actions>
3181                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3182                         </actions>
3183                 </permacrud>
3184         </class>
3185         <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">
3186                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3187                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3188                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3189                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3190                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3191                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3192                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3193                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3194                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3195         </fields>
3196                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3197                         <actions>
3198                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3199                                 <retrieve/>
3200                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3201                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3202                         </actions>
3203                 </permacrud>
3204         </class>
3205         <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">
3206                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3207                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3208                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3209                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3210                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3211         </fields>
3212         <links>
3213                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3214                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3215                 </links>
3216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3217                         <actions>
3218                                 <retrieve permission="RUN_REPORTS">
3219                                         <context link="usr" field="home_ou" />
3220                                 </retrieve>
3221                         </actions>
3222                 </permacrud>
3223         </class>
3224         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3225                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3226                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3227                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3228                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3229                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3230                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3231                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3232         </fields>
3233         <links>
3234                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3235                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3236                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3237                 </links>
3238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3239                         <actions>
3240                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3241                                         <context link="usr" field="home_ou" />
3242                                         <context link="ws" field="owning_lib" />
3243                                 </retrieve>
3244                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3245                                         <context link="usr" field="home_ou" />
3246                                         <context link="ws" field="owning_lib" />
3247                                 </create>
3248                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3249                                         <context link="usr" field="home_ou" />
3250                                         <context link="ws" field="owning_lib" />
3251                                 </update>
3252                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3253                                         <context link="usr" field="home_ou" />
3254                                         <context link="ws" field="owning_lib" />
3255                                 </delete>
3256                         </actions>
3257                 </permacrud>
3258         </class>
3259         <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">
3260                 <fields oils_persist:primary="name">
3261                         <field name="name" reporter:datatype="text"/>
3262                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3263                 </fields>
3264                 <links/>
3265                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3266                         <actions>
3267                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3268                                 <retrieve/>
3269                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3270                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3271                         </actions>
3272                 </permacrud>
3273         </class>
3274         <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">
3275                 <fields oils_persist:primary="name">
3276                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3277                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3278                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3279                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3280                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3281                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3282                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3283                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3284                 </fields>
3285                 <links>
3286                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3287                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3288                 </links>
3289                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3290                         <actions>
3291                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3292                                 <retrieve/>
3293                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3294                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3295                         </actions>
3296                 </permacrud>
3297         </class>
3298         <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">
3299                 <fields oils_persist:primary="name">
3300                         <field name="name" reporter:datatype="text"/>
3301                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3302                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3303                         <field name="datatype" reporter:datatype="text"/>
3304                         <field name="view_perm" reporter:datatype="link"/>
3305                         <field name="update_perm" reporter:datatype="link"/>
3306                         <field name="fm_class" reporter:datatype="text"/>
3307                         <field name="grp" reporter:datatype="link"/>
3308                 </fields>
3309                 <links>
3310                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3311                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3312                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3313                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3314                 </links>
3315                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3316                         <actions>
3317                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3318                                 <retrieve/>
3319                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3320                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3321                         </actions>
3322                 </permacrud>
3323         </class>
3324         <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">
3325                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3326                         <field name="id" />
3327                         <field name="name"  reporter:datatype="text"/>
3328                         <field name="org_unit" reporter:datatype="org_unit"/>
3329                         <field name="value"  reporter:datatype="text"/>
3330                 </fields>
3331                 <links>
3332                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3333                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3334                 </links>
3335         </class>
3336         <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">
3337                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3338                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3339                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3340                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3341                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3342                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3343                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3344                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3345                 </fields>
3346                 <links>
3347                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3348                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3349                 </links>
3350         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3351             <actions>
3352                 <create permission="CREATE_COPY_NOTE">
3353                     <context link="owning_copy" field="circ_lib"/>
3354                 </create>
3355                 <retrieve permission="VIEW_COPY_NOTES">
3356                     <context link="owning_copy" field="circ_lib"/>
3357                 </retrieve>
3358                 <update permission="UPDATE_COPY_NOTE">
3359                     <context link="owning_copy" field="circ_lib"/>
3360                 </update>
3361                 <delete permission="DELETE_COPY_NOTE">
3362                     <context link="owning_copy" field="circ_lib"/>
3363                 </delete>
3364             </actions>
3365         </permacrud>
3366         </class>
3367         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3368                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3369                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3370                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3371                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3372                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3373                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3374                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3375                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3376                 </fields>
3377                 <links>
3378                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3379                 </links>
3380         </class>
3381         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3382                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3383                         <field name="fingerprint"  reporter:datatype="text"/>
3384                         <field name="id" reporter:datatype="id" />
3385                         <field name="master_record" reporter:datatype="link"/>
3386                         <field name="mods"  reporter:datatype="text"/>
3387                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3388                 </fields>
3389                 <links>
3390                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3391                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3392                 </links>
3393         </class>
3394         <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">
3395                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3396                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3397                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3398                 </fields>
3399                 <links/>
3400         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3401             <actions>
3402                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3403                 <retrieve/>
3404                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3405                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3406             </actions>
3407         </permacrud>
3408         </class>
3409         <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">
3410                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3411                         <field name="code"  reporter:datatype="text"/>
3412                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3413                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3414                 </fields>
3415                 <links/>
3416         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3417             <actions>
3418                 <create permission="CREATE_PERM" global_required="true"/>
3419                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3420                 <update permission="UPDATE_PERM" global_required="true"/>
3421                 <delete permission="DELETE_PERM" global_required="true"/>
3422             </actions>
3423         </permacrud>
3424         </class>
3425         <class id="mmrsm" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
3426                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3427                         <field name="id" reporter:datatype="id" />
3428                         <field name="metarecord" reporter:datatype="link"/>
3429                         <field name="source" reporter:datatype="link"/>
3430                 </fields>
3431                 <links>
3432                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3433                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3434                 </links>
3435         </class>
3436         <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">
3437                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3438                         <field name="id" reporter:datatype="id" />
3439                         <field name="field" reporter:datatype="link"/>
3440                         <field name="source" reporter:datatype="link"/>
3441                         <field name="value"  reporter:datatype="text"/>
3442                 </fields>
3443                 <links>
3444                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3445                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3446                 </links>
3447         </class>
3448         <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">
3449                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3450                         <field name="id" reporter:datatype="id" />
3451                         <field name="value" reporter:datatype="text"/>
3452                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3453                 </fields>
3454                 <links>
3455                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3456                 </links>
3457         </class>
3458         <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">
3459                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3460                         <field name="id" reporter:datatype="id" />
3461                         <field name="entry" reporter:datatype="link"/>
3462                         <field name="def" reporter:datatype="link"/>
3463                         <field name="source" reporter:datatype="link"/>
3464                 </fields>
3465                 <links>
3466                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3467                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3468                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3469                 </links>
3470         </class>
3471         <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">
3472                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3473                         <field name="id" reporter:datatype="id" />
3474                         <field name="entry" reporter:datatype="link"/>
3475                         <field name="simple_heading" reporter:datatype="link"/>
3476                 </fields>
3477                 <links>
3478                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3479                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3480                 </links>
3481         </class>
3482         <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">
3483                 <oils_persist:source_definition>
3484                         SELECT * FROM metabib.author_field_entry
3485                                                 UNION ALL
3486                         SELECT * FROM metabib.keyword_field_entry
3487                                                 UNION ALL
3488                         SELECT * FROM metabib.identifier_field_entry
3489                                                 UNION ALL
3490                         SELECT * FROM metabib.title_field_entry
3491                                                 UNION ALL
3492                         SELECT * FROM metabib.subject_field_entry
3493                                                 UNION ALL
3494                         SELECT * FROM metabib.series_field_entry
3495                 </oils_persist:source_definition>
3496                 <fields>
3497                         <field name="field" reporter:datatype="link"/>
3498                         <field name="id" reporter:datatype="id" />
3499                         <field name="source" reporter:datatype="link"/>
3500                         <field name="value"  reporter:datatype="text"/>
3501                 </fields>
3502                 <links>
3503                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3504                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3505                 </links>
3506         </class>
3507         <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">
3508                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3509                         <field name="field" reporter:datatype="link"/>
3510                         <field name="id" reporter:datatype="id" />
3511                         <field name="source" reporter:datatype="link"/>
3512                         <field name="value"  reporter:datatype="text"/>
3513                 </fields>
3514                 <links>
3515                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3516                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3517                 </links>
3518         </class>
3519         <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">
3520                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3521                         <field name="accepting_usr" reporter:datatype="link"/>
3522                         <field name="amount" reporter:datatype="money" />
3523                         <field name="amount_collected" reporter:datatype="money" />
3524                         <field name="cash_drawer" reporter:datatype="link"/>
3525                         <field name="id" reporter:datatype="id" />
3526                         <field name="note"  reporter:datatype="text"/>
3527                         <field name="payment_ts" reporter:datatype="timestamp"/>
3528                         <field name="xact" reporter:datatype="link"/>
3529                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3530                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3531                 </fields>
3532                 <links>
3533                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3534                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3535                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3536                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3537                 </links>
3538         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3539             <actions>
3540                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3541                     <context link="xact" jump="usr" field="home_ou"/>
3542                 </retrieve>
3543                         </actions>
3544                 </permacrud>
3545         </class>
3546         <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">
3547                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3548                         <field name="accepting_usr" reporter:datatype="link"/>
3549                         <field name="amount" reporter:datatype="money" />
3550                         <field name="amount_collected" reporter:datatype="money" />
3551                         <field name="id" reporter:datatype="id" />
3552                         <field name="note"  reporter:datatype="text"/>
3553                         <field name="payment_ts" reporter:datatype="timestamp"/>
3554                         <field name="xact" reporter:datatype="link"/>
3555                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3556                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3557                 </fields>
3558                 <links>
3559                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3560                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3561                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3562                 </links>
3563         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3564             <actions>
3565                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3566                     <context link="xact" jump="usr" field="home_ou"/>
3567                 </retrieve>
3568                         </actions>
3569                 </permacrud>
3570         </class>
3571         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3572                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3573                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3574                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3575                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3576                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3577                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3578                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3579                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3580                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3581                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3582                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3583                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3584                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3585                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3586                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3587                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3588                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3589                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3590                 </fields>
3591                 <links>
3592                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3593                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3594                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3595                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3596                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3597                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3598                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3599                 </links>
3600         </class>
3601
3602         <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">
3603                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3604                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3605                         <field name="name"  reporter:datatype="text"/>
3606                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3607                         <field name="block_list" reporter:datatype="text"/>
3608                         <field name="staff_alert" reporter:datatype="bool"/>
3609                         <field name="org_depth" reporter:datatype="int"/>
3610                 </fields>
3611                 <links/>
3612         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3613             <actions>
3614                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3615                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3616                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3617                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3618             </actions>
3619         </permacrud>
3620         </class>
3621         <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">
3622                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3623                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3624                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3625                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3626                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3627                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3628                 </fields>
3629                 <links>
3630                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3631                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3632                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3633         </links>
3634         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3635             <actions>
3636                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3637                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3638                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3639                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3640             </actions>
3641         </permacrud>
3642         </class>
3643         <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="Copy Status" oils_persist:field_safe="true">
3644                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3645                         <field name="holdable" reporter:datatype="bool"/>
3646                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3647                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3648                         <field name="opac_visible" reporter:datatype="bool"/>
3649             <field name="copy_active" reporter:datatype="bool"/>
3650             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3651                 </fields>
3652                 <links/>
3653         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3654             <actions>
3655                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3656                 <retrieve/>
3657                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3658                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3659             </actions>
3660         </permacrud>
3661         </class>
3662         <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">
3663                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3664                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3665                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3666                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3667                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3668                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3669                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3670                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3671                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3672                 </fields>
3673                 <links>
3674                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3675                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3676                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3677                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3678                 </links>
3679                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3680                         <actions>
3681                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3682                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3683                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3684                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3685                         </actions>
3686                 </permacrud>
3687         </class>
3688         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3689                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3690                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3691                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3692                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3693                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3694                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3695                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3696                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3697                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3698                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3699                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3700                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3701                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3702                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3703                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3704                 </fields>
3705                 <links>
3706                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3707                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3708                 </links>
3709         </class>
3710         <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">
3711                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3712                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3713                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3714                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3715                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3716                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3717                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3718                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3719                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3720                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3721                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3722                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3723                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3724                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3725                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3726                 </fields>
3727                 <links>
3728                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3729                 </links>
3730                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3731                         <actions>
3732                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3733                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3734                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3735                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3736                         </actions>
3737                 </permacrud>
3738         </class>
3739
3740
3741         <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">
3742                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
3743                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3744                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
3745                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3746                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
3747                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
3748                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
3749                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
3750                 </fields>
3751                 <links>
3752                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
3753                 </links>
3754         </class>
3755
3756         <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">
3757                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
3758                         <field name="call_number" />
3759                         <field name="create_date" reporter:datatype="timestamp"/>
3760                         <field name="creator" reporter:datatype="link"/>
3761                         <field name="id" reporter:datatype="id" />
3762                         <field name="pub" reporter:datatype="bool"/>
3763                         <field name="title"  reporter:datatype="text"/>
3764                         <field name="value"  reporter:datatype="text"/>
3765                 </fields>
3766                 <links>
3767                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3768                 </links>
3769         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3770             <actions>
3771                 <create permission="CREATE_VOLUME_NOTE">
3772                     <context link="call_number" field="owning_lib"/>
3773                 </create>
3774                 <retrieve permission="VIEW_VOLUME_NOTES">
3775                     <context link="call_number" field="owning_lib"/>
3776                 </retrieve>
3777                 <update permission="UPDATE_VOLUME_NOTE">
3778                     <context link="call_number" field="owning_lib"/>
3779                 </update>
3780                 <delete permission="DELETE_VOLUME_NOTE">
3781                     <context link="call_number" field="owning_lib"/>
3782                 </delete>
3783             </actions>
3784         </permacrud>
3785         </class>
3786         <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">
3787                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
3788                         <field name="create_date" reporter:datatype="timestamp"/>
3789                         <field name="creator" reporter:datatype="link"/>
3790                         <field name="edit_date" reporter:datatype="timestamp"/>
3791                         <field name="editor" reporter:datatype="link"/>
3792                         <field name="id" reporter:datatype="id" />
3793                         <field name="record" reporter:datatype="link"/>
3794                         <field name="value" reporter:datatype="text"/>
3795                 </fields>
3796                 <links>
3797                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3798                 </links>
3799         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3800             <actions>
3801                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3802                 <retrieve/>
3803                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3804                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3805             </actions>
3806         </permacrud>
3807         </class>
3808         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
3809         <oils_persist:source_definition>
3810 SELECT  usr,
3811         SUM(
3812             CASE
3813                 WHEN (
3814                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3815                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3816                 ) THEN 1
3817                 ELSE 0
3818             END
3819         ) AS out,
3820
3821         SUM(
3822             CASE
3823                 WHEN (
3824                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3825                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3826                 ) THEN 1
3827                 ELSE 0
3828             END
3829         ) AS overdue,
3830
3831         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
3832         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN 1 ELSE 0 END) AS claims_returned,
3833         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
3834   FROM  action.circulation
3835   WHERE checkin_time IS NULL
3836   GROUP BY 1
3837         </oils_persist:source_definition>
3838         <fields oils_persist:primary="usr">
3839             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3840             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3841             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3842             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3843             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3844             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3845         </fields>
3846         <links>
3847             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3848         </links>
3849         </class>
3850         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
3851         <oils_persist:source_definition>
3852 SELECT  usr,
3853         STRING_AGG(
3854             CASE
3855                 WHEN (
3856                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3857                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3858                 ) THEN id::TEXT
3859                 ELSE '0'
3860             END
3861         ,',') AS out,
3862
3863         STRING_AGG(
3864             CASE
3865                 WHEN (
3866                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3867                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3868                 ) THEN id::TEXT
3869                 ELSE '0'
3870             END
3871         ,',') AS overdue,
3872
3873         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
3874         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'CLAIMSRETURNED') THEN id::TEXT ELSE '0' END,',') AS claims_returned,
3875         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
3876   FROM  action.circulation
3877   WHERE checkin_time IS NULL
3878   GROUP BY 1
3879         </oils_persist:source_definition>
3880         <fields oils_persist:primary="usr">
3881             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3882             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3883             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3884             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3885             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3886             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3887         </fields>
3888         <links>
3889             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3890         </links>
3891         </class>
3892         <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">
3893                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3894                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3895                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3896                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3897                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3898                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3899                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3900                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3901                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3902                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3903                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3904                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3905                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3906                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3907                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3908                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3909                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3910                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3911                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3912                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3913                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3914                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3915                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3916                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
3917                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3918                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3919                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3920                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
3921                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
3922                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
3923                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
3924                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3925                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3926                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3927                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3928                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3929                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3930                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
3931                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
3932                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3933                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3934                 </fields>
3935                 <links>
3936                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
3937                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
3938                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
3939                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3940                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
3941                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3942                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3943                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3944                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3945                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
3946                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
3947                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
3948                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
3949                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3950                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3951                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
3952                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
3953                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
3954                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
3955                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
3956                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
3957                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
3958                 </links>
3959                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3960                         <actions>
3961                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
3962                         </actions>
3963                 </permacrud>
3964         </class>
3965         <class id="combcirc" controller="open-ils.cstore" 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">
3966                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3967                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3968                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3969                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3970                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3971                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3972                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3973                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3974                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3975                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3976                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3977                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3978                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3979                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3980                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3981                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3982                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3983                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3984                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3985                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3986                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3987                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3988                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3989                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
3990                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3991                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3992                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3993                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3994                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3995                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3996                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3997                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3998                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3999                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4000                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4001                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4002                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4003                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4004                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4005                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4006                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4007                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4008                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4009                 </fields>
4010                 <links>
4011                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4012                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4013                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4014                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4015                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4016                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4017                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4018                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4019                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4020                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4021                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4022                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4023                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4024                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4025                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4026                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4027                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4028                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4029                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4030                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4031                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4032                 </links>
4033         </class>
4034         <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">
4035                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4036                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4037                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4038                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4039                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4040                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4041                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4042                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4043                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4044                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4045                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4046                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4047                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4048                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4049                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4050                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4051                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4052                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4053                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4054                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4055                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4056                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4057                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4058                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4059                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4060                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
4061                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4062                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4063                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4064                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4065                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4066                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4067                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4068                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4069                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4070                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4071                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4072                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4073                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4074                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4075                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4076                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4077                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4078                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4079                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4080                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4081                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4082                 </fields>
4083                 <links>
4084                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4085                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4086                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4087                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4088                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4089                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4090                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4091                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4092                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4093                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4094                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4095                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4096                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4097                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4098                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4099                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4100                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4101                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4102                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4103                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4104                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4105                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4106                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4107                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4108                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4109                 </links>
4110         </class>
4111
4112         <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">
4113                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4114                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4115                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4116                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4117                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4118                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4119                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4120                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4121                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4122                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4123                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4124                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4125                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4126                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4127                 </fields>
4128                 <links>
4129                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4130                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4131                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4132                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4133                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4134                 </links>
4135                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4136                         <actions>
4137                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4138                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4139                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4140                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4141                         </actions>
4142                 </permacrud>
4143         </class>
4144
4145         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4146                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4147                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4148                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4149                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4150                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4151                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4152                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4153                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4154                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4155                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4156                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4157                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4158                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4159                 </fields>
4160                 <links>
4161                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4162                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4163                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4164                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4165                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4166                 </links>
4167                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4168                         <actions>
4169                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4170                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4171                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4172                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4173                         </actions>
4174                 </permacrud>
4175         </class>
4176         
4177         <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">
4178                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4179                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4180                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4181                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4182                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4183                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4184                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4185                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4186                 </fields>
4187                 <links>
4188                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4189                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4190                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4191                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4192                 </links>
4193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4194                         <actions>
4195                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4196                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4197                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4198                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4199                         </actions>
4200                 </permacrud>
4201         </class>
4202         
4203         <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">
4204                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4205                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4206                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4207                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4208                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4209                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4210                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4211                 </fields>
4212                 <links>
4213                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4214                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4215                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4216                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4217                 </links>
4218                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4219                         <actions>
4220                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4221                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4222                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4223                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4224                         </actions>
4225                 </permacrud>
4226         </class>
4227         
4228         <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">
4229                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4230                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4231                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4232                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4233                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4234                 </fields>
4235                 <links>
4236                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4237                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4238                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4239                 </links>
4240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4241                         <actions>
4242                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4243                     <context link="resource" field="owner" />
4244                 </create>
4245                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4246                     <context link="resource" field="owner" />
4247                 </retrieve>
4248                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4249                     <context link="resource" field="owner" />
4250                 </update>
4251                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4252                     <context link="resource" field="owner" />
4253                 </delete>
4254                         </actions>
4255                 </permacrud>
4256         </class>
4257         
4258         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4259                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4260                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4261                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4262                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4263                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4264                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4265                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4266                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4267                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4268                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4269                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4270                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4271                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4272                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4273                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4274                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4275                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4276                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4277                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4278                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4279                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4280                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4281                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4282                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4283                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4284                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4285                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4286                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4287                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4288                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4289                 </fields>
4290                 <links>
4291                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4292                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4293                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4294                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4295                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4296                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4297                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4298                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4299                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4300                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4301                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4302                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4303                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4304                 </links>
4305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4306                         <actions>
4307                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4308                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4309                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4310                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4311                         </actions>
4312                 </permacrud>
4313         </class>
4314         
4315         <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">
4316                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4317                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4318                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4319                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4320                 </fields>
4321                 <links>
4322                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4323                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4324                 </links>
4325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4326                         <actions>
4327                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4328                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4329                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4330                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4331                         </actions>
4332                 </permacrud>
4333         </class>
4334
4335         <class id="ccnbi" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
4336                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4337                         <field name="bucket" reporter:datatype="link"/>
4338                         <field name="id" reporter:datatype="id" />
4339                         <field name="target_call_number" reporter:datatype="link" />
4340                         <field name="create_time" reporter:datatype="timestamp" />
4341                         <field name="pos" reporter:datatype="int" />
4342                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4343                 </fields>
4344                 <links>
4345                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4346                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4347             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4348                 </links>
4349         </class>
4350         <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">
4351                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4352                         <field name="id" reporter:datatype="id" />
4353                         <field name="item" reporter:datatype="link"/>
4354                         <field name="note" reporter:datatype="text" />
4355                 </fields>
4356                 <links>
4357                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4358                 </links>
4359         </class>
4360         <class id="cbreb" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
4361                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4362                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4363                         <field name="btype" reporter:datatype="text"/>
4364                         <field name="id" reporter:datatype="id" />
4365                         <field name="name" reporter:datatype="text"/>
4366                         <field name="description" reporter:datatype="text"/>
4367                         <field name="owner" reporter:datatype="link"/>
4368                         <field name="pub" reporter:datatype="bool"/>
4369                         <field name="create_time" reporter:datatype="timestamp" />
4370                 </fields>
4371                 <links>
4372                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4373                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4374                 </links>
4375         </class>
4376         <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">
4377                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4378                         <field name="id" reporter:datatype="id" />
4379                         <field name="bucket" reporter:datatype="link"/>
4380                         <field name="note" reporter:datatype="text" />
4381                 </fields>
4382                 <links>
4383                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4384                 </links>
4385         </class>
4386         <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">
4387                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4388                         <field name="hold" reporter:datatype="link"/>
4389                         <field name="id" reporter:datatype="id" />
4390                         <field name="target_copy" reporter:datatype="link"/>
4391                         <field name="proximity" reporter:datatype="number"/>
4392                 </fields>
4393                 <links>
4394                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4395                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4396                 </links>
4397         </class>
4398         <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">
4399                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4400                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4401                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4402                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4403                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4404                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4405                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4406                 </fields>
4407                 <links>
4408                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4409                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4410                 </links>
4411         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4412             <actions>
4413                 <create permission="CREATE_HOLD_NOTIFICATION">
4414                                         <context link="hold" jump="usr" field="home_ou" />
4415                                 </create>
4416                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4417                                         <context link="hold" jump="usr" field="home_ou" />
4418                                 </retrieve>
4419                 <update permission="CREATE_HOLD_NOTIFICATION">
4420                                         <context link="hold" jump="usr" field="home_ou" />
4421                                 </update>
4422                 <delete permission="CREATE_HOLD_NOTIFICATION">
4423                                         <context link="hold" jump="usr" field="home_ou" />
4424                                 </delete>
4425             </actions>
4426         </permacrud>
4427         </class>
4428         <class id="acpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location" oils_persist:tablename="asset.copy_location" reporter:label="Copy/Shelving Location"  oils_persist:field_safe="true">
4429                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4430                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4431                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4432                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4433                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4434                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4435                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4436                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4437                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4438                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4439                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4440                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4441                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4442                 </fields>
4443                 <links>
4444                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4445                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4446                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4447                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4448                 </links>
4449         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4450             <actions>
4451                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4452                 <retrieve/>
4453                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4454                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4455             </actions>
4456         </permacrud>
4457         </class>
4458         <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">
4459                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4460                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4461                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4462                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4463                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4464             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4465             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4466             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4467                 </fields>
4468                 <links>
4469                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4470                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4471                 </links>
4472         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4473             <actions>
4474                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4475                 <retrieve/>
4476                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4477                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4478             </actions>
4479         </permacrud>
4480         </class>
4481         <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">
4482                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4483                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4484             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4485             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4486                 </fields>
4487                 <links>
4488                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4489                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4490                 </links>
4491         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4492             <actions>
4493                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4494                                         <context link="lgroup" field="owner" />
4495                 </create>
4496                 <retrieve/>
4497                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4498                                         <context link="lgroup" field="owner" />
4499                 </update>
4500                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4501                                         <context link="lgroup" field="owner" />
4502                 </delete>
4503             </actions>
4504         </permacrud>
4505         </class>
4506
4507     <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">
4508         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4509             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4510             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4511             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4512             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4513         </fields>
4514         <links>
4515             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4516             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4517         </links>
4518         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4519             <actions>
4520                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4521                 <retrieve/>
4522                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4523                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4524             </actions>
4525         </permacrud>
4526     </class>
4527
4528         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4529                 <fields>
4530                         <field name="sre_id" oils_persist:virtual="true" />
4531                         <field name="location" oils_persist:virtual="true" />
4532                         <field name="owning_lib" oils_persist:virtual="true" />
4533                         <field name="basic_holdings" oils_persist:virtual="true" />
4534                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4535                         <field name="supplement_holdings" oils_persist:virtual="true" />
4536                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4537                         <field name="index_holdings" oils_persist:virtual="true" />
4538                         <field name="index_holdings_add" oils_persist:virtual="true" />
4539                         <field name="online" oils_persist:virtual="true" />
4540                         <field name="missing" oils_persist:virtual="true" />
4541                         <field name="incomplete" oils_persist:virtual="true" />
4542                 </fields>
4543         </class>
4544
4545         <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">
4546                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4547                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4548                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4549                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4550                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4551                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4552                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4553                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4554                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4555                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4556                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4557                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4558                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4559                 </fields>
4560                 <links>
4561                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4562                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4563                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4564                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4565                 </links>
4566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4567                         <actions>
4568                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4569                                 <retrieve/>
4570                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4571                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4572                         </actions>
4573                 </permacrud>
4574         </class>
4575
4576         <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">
4577                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4578                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4579                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4580                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4581                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4582                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4583                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4584                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4585                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4586                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4587                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4588                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4589                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4590                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4591                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4592                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4593                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4594                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4595                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4596                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4597                 </fields>
4598                 <links>
4599                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4600                 </links>
4601                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4602                         <actions>
4603                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4604                                         <context link="subscription" field="owning_lib" />
4605                                 </create>
4606                                 <retrieve />
4607                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4608                                         <context link="subscription" field="owning_lib" />
4609                                 </update>
4610                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4611                                         <context link="subscription" field="owning_lib" />
4612                                 </delete>
4613                         </actions>
4614                 </permacrud>
4615         </class>
4616
4617         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4618                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4619                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4620                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4621                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4622                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4623                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4624                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4625                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4626                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4627                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4628                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4629                 </fields>
4630                 <links>
4631                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4632                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4633                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4634                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4635                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4636                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4637                 </links>
4638                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4639                         <actions>
4640                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4641                                 <retrieve />
4642                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4643                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4644                         </actions>
4645                 </permacrud>
4646         </class>
4647
4648         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4649                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4650                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4651                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4652                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4653                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4654                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4655                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4656                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4657                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4658                 </fields>
4659                 <links>
4660                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4661                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4662                 </links>
4663         </class>
4664
4665         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4666                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4667                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4668                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4669                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4670                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4671                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4672                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4673                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4674                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4675                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4676                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4677                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4678                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4679                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
4680                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
4681                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4682                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4683                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4684                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4685                 </fields>
4686                 <links>
4687                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
4688                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4689                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
4690                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
4691                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
4692                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
4693                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
4694                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
4695                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
4696                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
4697                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
4698                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
4699                 </links>
4700                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4701                         <actions>
4702                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4703                                 <retrieve />
4704                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4705                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4706                         </actions>
4707                 </permacrud>
4708         </class>
4709
4710         <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">
4711                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
4712                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4713                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4714                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4715                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4716                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4717                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4718                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4719                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4720                 </fields>
4721                 <links>
4722                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4723                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4724                 </links>
4725                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4726                         <actions>
4727                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4728                                         <context link="distribution" field="holding_lib" />
4729                                 </create>
4730                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
4731                                         <context link="distribution" field="holding_lib" />
4732                                 </retrieve>
4733                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4734                                         <context link="distribution" field="holding_lib" />
4735                                 </update>
4736                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4737                                         <context link="distribution" field="holding_lib" />
4738                                 </delete>
4739                         </actions>
4740                 </permacrud>
4741         </class>
4742
4743         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
4744                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
4745                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4746                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4747                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
4748                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4749                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
4750                 </fields>
4751                 <links>
4752                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4753                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
4754                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
4755                 </links>
4756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4757                         <actions>
4758                                 <create permission="ADMIN_SERIAL_STREAM">
4759                                         <context link="distribution" field="holding_lib" />
4760                                 </create>
4761                                 <retrieve />
4762                                 <update permission="ADMIN_SERIAL_STREAM">
4763                                         <context link="distribution" field="holding_lib" />
4764                                 </update>
4765                                 <delete permission="ADMIN_SERIAL_STREAM">
4766                                         <context link="distribution" field="holding_lib" />
4767                                 </delete>
4768                         </actions>
4769                 </permacrud>
4770         </class>
4771
4772         <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">
4773                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
4774                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4775                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4776                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4777                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
4778                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
4779                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
4780                 </fields>
4781                 <links>
4782                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4783                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
4784                 </links>
4785                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4786                         <actions>
4787                                 <create permission="ADMIN_SERIAL_STREAM">
4788                                         <context link="stream" jump="distribution" field="holding_lib" />
4789                                 </create>
4790                                 <retrieve permission="RECEIVE_SERIAL">
4791                                         <context link="stream" jump="distribution" field="holding_lib" />
4792                                 </retrieve>
4793                                 <update permission="ADMIN_SERIAL_STREAM">
4794                                         <context link="stream" jump="distribution" field="holding_lib" />
4795                                 </update>
4796                                 <delete permission="ADMIN_SERIAL_STREAM">
4797                                         <context link="stream" jump="distribution" field="holding_lib" />
4798                                 </delete>
4799                         </actions>
4800                 </permacrud>
4801         </class>
4802
4803         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
4804                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
4805                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4806                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4807                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4808                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4809                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4810                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4811                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
4812                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4813                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
4814                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
4815                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
4816                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
4817                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4818                 </fields>
4819                 <links>
4820                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4821                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4822                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4823                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
4824                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
4825                 </links>
4826                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4827                         <actions>
4828                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
4829                                         <context link="subscription" field="owning_lib" />
4830                                 </create>
4831                                 <retrieve/>
4832                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
4833                                         <context link="subscription" field="owning_lib" />
4834                                 </update>
4835                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
4836                                         <context link="subscription" field="owning_lib" />
4837                                 </delete>
4838                         </actions>
4839                 </permacrud>
4840         </class>
4841
4842         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
4843                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
4844                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4845                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
4846                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
4847                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4848                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
4849                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
4850                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4851                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
4852                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
4853                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
4854                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4855                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
4856                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
4857                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4858                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
4859                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4860                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
4861                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
4862                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
4863                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
4864                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
4865                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
4866                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
4867                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
4868                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
4869                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
4870                         <field reporter:label="Price" name="price" reporter:datatype="money" />
4871                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
4872                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
4873                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
4874                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
4875                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
4876                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
4877                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
4878                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
4879                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
4880                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4881                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4882                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4883                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
4884                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
4885                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4886                 </fields>
4887                 <links>
4888                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
4889                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4890                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4891                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4892                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4893                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
4894                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4895                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
4896                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
4897                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
4898                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
4899                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
4900                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
4901                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
4902                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
4903                 </links>
4904                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4905                         <actions>
4906                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4907                                 <retrieve/>
4908                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4909                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4910                         </actions>
4911                 </permacrud>
4912         </class>
4913
4914         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
4915                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
4916                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4917                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4918                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4919                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4920                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4921                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
4922                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4923                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
4924                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
4925                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
4926                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
4927                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
4928                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4929                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
4930                 </fields>
4931                 <links>
4932                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4933                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4934                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4935                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4936                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
4937                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
4938                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
4939                 </links>
4940                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4941                         <actions>
4942                                 <create permission="ADMIN_SERIAL_ITEM">
4943                                         <context link="stream" jump="distribution" field="holding_lib" />
4944                                 </create>
4945                                 <retrieve permission="ADMIN_SERIAL_ITEM">
4946                                         <context link="stream" jump="distribution" field="holding_lib" />
4947                                 </retrieve>
4948                                 <update permission="ADMIN_SERIAL_ITEM">
4949                                         <context link="stream" jump="distribution" field="holding_lib" />
4950                                 </update>
4951                                 <delete permission="ADMIN_SERIAL_ITEM">
4952                                         <context link="stream" jump="distribution" field="holding_lib" />
4953                                 </delete>
4954                         </actions>
4955                 </permacrud>
4956         </class>
4957
4958         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
4959                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
4960                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4961                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
4962                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4963                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4964                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4965                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4966                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4967                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4968                 </fields>
4969                 <links>
4970                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
4971                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4972                 </links>
4973                 <!-- Not available via PCRUD at this time -->
4974         </class>
4975         <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">
4976                 <fields>
4977                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
4978                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
4979                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
4980                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
4981                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
4982                 </fields>
4983                 <links>
4984                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4985                 </links>
4986         </class>
4987         <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">
4988                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
4989                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4990                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
4991                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
4992                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
4993                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
4994                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
4995                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
4996                 </fields>
4997                 <links>
4998                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4999                 </links>
5000         </class>
5001         <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">
5002                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5003                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5004                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5005                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5006                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5007                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5008                 </fields>
5009                 <links>
5010                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5011                 </links>
5012                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5013                         <actions>
5014                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5015                                         <context link="distribution" field="holding_lib" />
5016                                 </create>
5017                                 <retrieve/>
5018                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5019                                         <context link="distribution" field="holding_lib" />
5020                                 </update>
5021                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5022                                         <context link="distribution" field="holding_lib" />
5023                                 </delete>
5024                         </actions>
5025                 </permacrud>
5026         </class>
5027
5028         <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">
5029                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5030                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5031                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5032                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5033                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5034                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5035                 </fields>
5036                 <links>
5037                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5038                 </links>
5039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5040                         <actions>
5041                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5042                                         <context link="distribution" field="holding_lib" />
5043                                 </create>
5044                                 <retrieve/>
5045                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5046                                         <context link="distribution" field="holding_lib" />
5047                                 </update>
5048                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5049                                         <context link="distribution" field="holding_lib" />
5050                                 </delete>
5051                         </actions>
5052                 </permacrud>
5053         </class>
5054
5055         <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">
5056                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5057                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5058                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5059                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5060                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5061                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5062                 </fields>
5063                 <links>
5064                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5065                 </links>
5066                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5067                         <actions>
5068                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5069                                         <context link="distribution" field="holding_lib" />
5070                                 </create>
5071                                 <retrieve/>
5072                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5073                                         <context link="distribution" field="holding_lib" />
5074                                 </update>
5075                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5076                                         <context link="distribution" field="holding_lib" />
5077                                 </delete>
5078                         </actions>
5079                 </permacrud>
5080         </class>
5081
5082         <class id="ascecm" controller="open-ils.cstore" 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">
5083                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5084                         <field name="id" reporter:datatype="id" />
5085                         <field name="owning_copy" reporter:datatype="link"/>
5086                         <field name="stat_cat" reporter:datatype="link"/>
5087                         <field name="stat_cat_entry" reporter:datatype="link"/>
5088                 </fields>
5089                 <links>
5090                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5091                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5092                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5093                 </links>
5094         </class>
5095         <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">
5096                 <fields oils_persist:primary="code">
5097                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5098                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5099                 </fields>
5100                 <links/>
5101         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5102             <actions>
5103                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5104                 <retrieve/>
5105                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5106                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5107             </actions>
5108         </permacrud>
5109         </class>
5110         <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">
5111                 <fields oils_persist:primary="code">
5112                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5113                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5114                 </fields>
5115                 <links/>
5116         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5117             <actions>
5118                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5119                 <retrieve/>
5120                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5121                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5122             </actions>
5123         </permacrud>
5124         </class>
5125         <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">
5126                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5127                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5128                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5129                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5130                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5131                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5132                 </fields>
5133                 <links>
5134             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5135         </links>
5136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5137             <actions>
5138                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5139                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5140                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5141                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5142             </actions>
5143         </permacrud>
5144         </class>
5145         <class id="lasso" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso" oils_persist:tablename="actor.org_lasso" reporter:label="Org Lasso">
5146                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5147                         <field name="id" reporter:datatype="id" />
5148                         <field name="name" reporter:datatype="text"/>
5149                 </fields>
5150                 <links/>
5151         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5152             <actions>
5153                 <create permission="CREATE_LASSO" global_required="true"/>
5154                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5155                 <update permission="UPDATE_LASSO" global_required="true"/>
5156                 <delete permission="DELETE_LASSO" global_required="true"/>
5157             </actions>
5158         </permacrud>
5159         </class>
5160         <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="Org Lasso Map">
5161                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5162                         <field name="id" reporter:datatype="id" />
5163                         <field name="lasso" reporter:datatype="link"/>
5164                         <field name="org_unit" reporter:datatype="org_unit"/>
5165                 </fields>
5166                 <links>
5167                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5168                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5169                 </links>
5170         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5171             <actions>
5172                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5173                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5174                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5175                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5176             </actions>
5177         </permacrud>
5178         </class>
5179         <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">
5180                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5181                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5182                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5183                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5184                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5185                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5186                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5187                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5188                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5189                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5190                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5191                 </fields>
5192                 <links>
5193                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5194                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5195                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5196                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5197                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5198                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5199                 </links>
5200         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5201             <actions>
5202                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5203                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5204                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5205                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5206             </actions>
5207         </permacrud>
5208         </class>
5209         <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">
5210                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5211                         <field name="id" reporter:datatype="id" />
5212                         <field name="from_org" reporter:datatype="org_unit"/>
5213                         <field name="to_org" reporter:datatype="org_unit"/>
5214                         <field name="prox" reporter:datatype="int" />
5215                 </fields>
5216                 <links>
5217                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5218                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5219                 </links>
5220         </class>
5221         <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">
5222                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5223                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5224                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5225                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5226                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5227                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5228                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5229                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5230                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5231                 </fields>
5232                 <links/>
5233         </class>
5234         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5235                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5236                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5237                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5238                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5239                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5240                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5241                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5242                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5243                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5244                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5245                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5246                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5247                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5248                 </fields>
5249                 <links>
5250                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5251                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5252                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5253                 </links>
5254         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5255             <actions>
5256                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5257                 <retrieve/>
5258                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5259                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5260             </actions>
5261         </permacrud>
5262         </class>
5263         <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">
5264                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5265                         <field name="address_type"  reporter:datatype="text"/>
5266                         <field name="city"  reporter:datatype="text"/>
5267                         <field name="country"  reporter:datatype="text"/>
5268                         <field name="county"  reporter:datatype="text"/>
5269                         <field name="id" reporter:datatype="id" />
5270                         <field name="org_unit" reporter:datatype="org_unit"/>
5271                         <field name="post_code"  reporter:datatype="text"/>
5272                         <field name="state"  reporter:datatype="text"/>
5273                         <field name="street1"  reporter:datatype="text"/>
5274                         <field name="street2"  reporter:datatype="text"/>
5275                         <field name="valid" reporter:datatype="bool"/>
5276                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5277                 </fields>
5278                 <links>
5279                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5280                 </links>
5281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5282             <actions>
5283                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5284                 <retrieve/>
5285                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5286                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5287             </actions>
5288         </permacrud>
5289         </class>
5290         <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">
5291                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5292                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5293                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5294                         <field name="query_text" reporter:datatype="text"/>
5295                 </fields>
5296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5297             <actions>
5298                 <retrieve/>
5299             </actions>
5300         </permacrud>
5301         </class>
5302
5303         <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">
5304                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5305                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5306                         <field name="owner" reporter:datatype="org_unit"/>
5307                         <field name="code" reporter:datatype="text"/>
5308                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5309                         <field name="create_date" reporter:datatype="timestamp"/>
5310                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5311                 </fields>
5312                 <links>
5313                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5314                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5315                 </links>
5316         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5317             <actions>
5318                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5319                 <retrieve/>
5320                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5321                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5322             </actions>
5323         </permacrud>
5324         </class>
5325         <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">
5326                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5327                         <field name="id" reporter:datatype="id"/>
5328                         <field name="grp" reporter:datatype="link"/>
5329                         <field name="pos" reporter:datatype="int"/>
5330                         <field name="query" reporter:datatype="link"/>
5331                 </fields>
5332                 <links>
5333                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5334                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5335                 </links>
5336         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5337             <actions>
5338                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5339                     <context link="grp" field="owner"/>
5340                 </create>
5341                 <retrieve/>
5342                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5343                     <context link="grp" field="owner"/>
5344                 </update>
5345                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5346                     <context link="grp" field="owner"/>
5347                 </delete>
5348             </actions>
5349         </permacrud>
5350         </class>
5351
5352         <!-- A note: Please update alhr and ahopl when updating ahr -->
5353         <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">
5354                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5355                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5356                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5357                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5358                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5359                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5360                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5361                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5362                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5363                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5364                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5365                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5366                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5367                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5368                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5369                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5370                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5371                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5372                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5373                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5374                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5375                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5376                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5377                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5378                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5379                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5380                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5381                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5382                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5383                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5384                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5385                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5386                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5387                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5388                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5389                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5390                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5391                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5392                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5393                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5394                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5395                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5396                 </fields>
5397                 <links>
5398                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5399                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5400                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5401                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5402                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5403                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5404                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5405                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5406                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5407                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5408                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5409                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5410                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5411                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5412                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5413                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5414                 </links>
5415                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5416                         <actions>
5417                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5418                         </actions>
5419                 </permacrud>
5420         </class>
5421         <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">
5422                 <oils_persist:source_definition><![CDATA[
5423                 SELECT
5424                         ahr.*,
5425                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5426                                 copy_location_order_position,
5427                         CASE WHEN au.alias IS NOT NULL THEN
5428                                 au.alias
5429                         ELSE
5430                                 au.first_given_name
5431                         END AS usr_alias_or_first_given_name,
5432                         au.first_given_name AS usr_first_given_name,
5433                         au.second_given_name AS usr_second_given_name,
5434                         au.family_name AS usr_family_name,
5435                         au.prefix AS usr_prefix,
5436                         au.suffix AS usr_suffix,
5437                         au.alias AS usr_alias,
5438                         CASE WHEN au.alias IS NOT NULL THEN
5439                                 au.alias
5440                         ELSE
5441                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5442                                         COALESCE(au.family_name, ''),
5443                                         COALESCE(au.suffix, ''),
5444                                         ', ',
5445                                         COALESCE(au.prefix, ''),
5446                                         COALESCE(au.first_given_name, ''),
5447                                         COALESCE(au.second_given_name, '')
5448                                 ], ' '), E'\\s+,', ',')
5449                         END AS usr_alias_or_display_name,
5450                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5451                                 COALESCE(au.family_name, ''),
5452                                 COALESCE(au.suffix, ''),
5453                                 ', ',
5454                                 COALESCE(au.prefix, ''),
5455                                 COALESCE(au.first_given_name, ''),
5456                                 COALESCE(au.second_given_name, '')
5457                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5458                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5459                                 AS call_number_label,
5460                         siss.label AS issuance_label,
5461                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5462                         ahcm_1.copy_count AS potential_copies
5463                 FROM action.hold_request ahr
5464                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5465                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5466                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5467                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5468                 JOIN actor.usr au ON (au.id = ahr.usr)
5469                 JOIN (
5470                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5471                         FROM asset.copy_location
5472                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5473                 LEFT JOIN actor.usr_standing_penalty ausp 
5474                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5475                 LEFT JOIN config.standing_penalty csp
5476                         ON (
5477                                 csp.id = ausp.standing_penalty AND 
5478                                 csp.block_list LIKE '%CAPTURE%' AND (
5479                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5480                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5481                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5482                                         )
5483                                 )
5484                         )
5485                 JOIN (
5486                         SELECT COUNT(target_copy) AS copy_count, hold
5487                         FROM action.hold_copy_map
5488                         GROUP BY 2
5489                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5490                 LEFT JOIN serial.issuance siss
5491                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5492                 LEFT JOIN asset.copy_location_order acplo
5493                         ON (acp.location = acplo.location AND
5494                                 acp.circ_lib = acplo.org)
5495                 WHERE
5496                         ahr.capture_time IS NULL AND
5497                         ahr.cancel_time IS NULL AND
5498                         csp.id IS NULL AND
5499                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5500                         acp.status IN (0,7)
5501                 ]]></oils_persist:source_definition>
5502                 <fields oils_persist:primary="id">
5503                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5504                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5505                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5506                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5507                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5508                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5509                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5510                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5511                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5512                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5513                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5514                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5515                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5516                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5517                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5518                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5519                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5520                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5521                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5522                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5523                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5524                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5525                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5526                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5527                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5528                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5529                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5530                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5531                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5532                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5533                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5534                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5535                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5536                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5537                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5538                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5539                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5540                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5541                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5542                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5543                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5544                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5545                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5546                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5547                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5548                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5549                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5550                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5551                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5552                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5553                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5554                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5555                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5556                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5557                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5558                 </fields>
5559                 <links>
5560                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5561                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5562                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5563                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5564                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5565                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5566                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5567                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5568                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5569                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5570                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5571                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5572                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5573                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5574                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5575                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5576                 </links>
5577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5578                         <actions>
5579                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5580                         </actions>
5581                 </permacrud>
5582         </class>
5583         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5584                 <oils_persist:source_definition>
5585                         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 GROUP BY current_copy)x USING (current_copy, capture_time)
5586                 </oils_persist:source_definition>
5587                 <fields oils_persist:primary="id">
5588                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5589                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5590                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5591                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5592                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5593                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5594                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5595                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5596                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5597                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5598                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5599                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5600                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5601                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5602                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5603                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5604                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5605                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5606                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5607                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5608                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5609                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5610                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5611                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5612                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5613                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5614                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5615                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5616                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5617                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5618                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5619                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5620                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5621                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5622                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5623                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5624                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5625                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5626                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5627                 </fields>
5628                 <links>
5629                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5630                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5631                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5632                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5633                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5634                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5635                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5636                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5637                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5638                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5639                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5640                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5641                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5642                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5643                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5644                 </links>
5645         </class>
5646
5647         <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">
5648                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5649                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5650                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5651                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5652                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5653                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5654                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5655                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5656                 </fields>
5657                 <links>
5658                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5659                 </links>
5660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5661                         <actions>
5662                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5663                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5664                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5665                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5666                         </actions>
5667                 </permacrud>
5668         </class>
5669         <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">
5670                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5671                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5672                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5673                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5674                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5675                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5676                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5677                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5678                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5679                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5680                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5681                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5682                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5683                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5684                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5685                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5686                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5687                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5688                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5689                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5690                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5691                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5692                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5693                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5694                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5695                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5696                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5697                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5698                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5699                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5700                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5701                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5702                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5703                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5704                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5705                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5706                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5707                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5708                 </fields>
5709                 <links>
5710                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5711                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5712                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5713                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5714                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5715                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5716                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5717                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5718                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5719                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5720                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5721                 </links>
5722                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5723                         <actions>
5724                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5725                         </actions>
5726                 </permacrud>
5727         </class>
5728         <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">
5729                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5730                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5731                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5732                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5733                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5734                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5735                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5736                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5737                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5738                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5739                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5740                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5741                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5742                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5743                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5744                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5745                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5746                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5747                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5748                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5749                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5750                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5751                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5752                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5753                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5754                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5755                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5756                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5757                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5758                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5759                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5760                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5761                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5762                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5763                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5764                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5765                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5766                 </fields>
5767                 <links>
5768                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5769                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5770                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5771                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5772                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5773                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5774                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5775                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5776                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5777                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5778                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5779                 </links>
5780                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5781                         <actions>
5782                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5783                         </actions>
5784                 </permacrud>
5785         </class>
5786
5787         <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">
5788                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
5789                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
5790                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
5791                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
5792                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
5793                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
5794                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
5795                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5796                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
5797                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
5798                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
5799                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
5800                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
5801                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5802                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
5803                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
5804                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
5805                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5806                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
5807                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
5808                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
5809                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
5810                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
5811                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
5812                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
5813                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
5814                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
5815                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5816                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5817                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5818                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
5819                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
5820                 </fields>
5821                 <links>
5822                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
5823                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
5824                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
5825                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
5826                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
5827                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
5828                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
5829                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
5830                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
5831                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
5832                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
5833                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
5834                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
5835                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
5836                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
5837                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
5838                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
5839                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
5840                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
5841                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
5842                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
5843                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
5844                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
5845                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
5846                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
5847                 </links>
5848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5849             <actions>
5850                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
5851                 <retrieve />
5852                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
5853                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
5854             </actions>
5855         </permacrud>
5856         </class>
5857         <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">
5858                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
5859                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5860                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
5861                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
5862                 </fields>
5863                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5864                         <actions>
5865                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5866                                 <retrieve/>
5867                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5868                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5869                         </actions>
5870                 </permacrud>
5871         </class>
5872         <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">
5873                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
5874                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5875                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
5876                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
5877                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
5878                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
5879                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
5880                 </fields>
5881                 <links>
5882                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
5883                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5884                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
5885                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
5886                 </links>
5887                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5888                         <actions>
5889                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5890                                 <retrieve/>
5891                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5892                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5893                         </actions>
5894                 </permacrud>
5895         </class>
5896         <class id="ccnb" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
5897                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
5898                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5899                         <field name="btype" reporter:datatype="text"/>
5900                         <field name="id" reporter:datatype="id" />
5901                         <field name="name"  reporter:datatype="text"/>
5902                         <field name="description" reporter:datatype="text"/>
5903                         <field name="owner" reporter:datatype="link"/>
5904                         <field name="pub" reporter:datatype="bool"/>
5905                         <field name="create_time" reporter:datatype="timestamp" />
5906                 </fields>
5907                 <links>
5908                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5909                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
5910                 </links>
5911         </class>
5912         <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">
5913                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
5914                         <field name="id" reporter:datatype="id" />
5915                         <field name="bucket" reporter:datatype="link"/>
5916                         <field name="note" reporter:datatype="text" />
5917                 </fields>
5918                 <links>
5919                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5920                 </links>
5921         </class>
5922         <class id="asc" controller="open-ils.cstore" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
5923                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
5924                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5925                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5926                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5927                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5928                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5929                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5930                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5931                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5932                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5933                 </fields>
5934                 <links>
5935                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5936                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
5937                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
5938                 </links>
5939         </class>
5940         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
5941                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
5942                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
5943                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5944                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
5945                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5946                 </fields>
5947                 <links>
5948                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5949                 </links>
5950                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5951                         <actions>
5952                                 <retrieve permission="VIEW_USER">
5953                                         <context link="usr" field="home_ou" />
5954                                 </retrieve>
5955                         </actions>
5956                 </permacrud>
5957         </class>
5958     <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">
5959         <fields oils_persist:primary="field">
5960             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
5961             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
5962             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
5963         </fields>
5964         <links/>
5965         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5966             <actions>
5967                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
5968                 <retrieve />
5969                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
5970                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
5971             </actions>
5972         </permacrud>
5973     </class>
5974         <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">
5975                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
5976                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5977                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5978                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5979                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5980                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5981                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5982                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
5983                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5984                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5985                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5986                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5987                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
5988                 </fields>
5989                 <links>
5990                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5991                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
5992                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
5993                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
5994                 </links>
5995         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5996             <actions>
5997                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
5998                 <retrieve />
5999                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6000                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6001             </actions>
6002         </permacrud>
6003         </class>
6004         <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">
6005                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6006                         <field name="field" reporter:datatype="link"/>
6007                         <field name="id" reporter:datatype="id" />
6008                         <field name="source" reporter:datatype="link"/>
6009                         <field name="value"  reporter:datatype="text"/>
6010                 </fields>
6011                 <links>
6012                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6013                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6014                 </links>
6015         </class>
6016         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6017                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6018                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6019                         <field name="btype" reporter:datatype="text"/>
6020                         <field name="id" reporter:datatype="id" />
6021                         <field name="name"  reporter:datatype="text"/>
6022                         <field name="description" reporter:datatype="text"/>
6023                         <field name="owner" reporter:datatype="link"/>
6024                         <field name="pub" reporter:datatype="bool"/>
6025                         <field name="create_time" reporter:datatype="timestamp" />
6026                 </fields>
6027                 <links>
6028                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6029                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6030                 </links>
6031         </class>
6032         <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">
6033                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6034                         <field name="id" reporter:datatype="id" />
6035                         <field name="bucket" reporter:datatype="link"/>
6036                         <field name="note" reporter:datatype="text" />
6037                 </fields>
6038                 <links>
6039                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6040                 </links>
6041         </class>
6042         <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">
6043                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6044                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6045                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6046                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6047                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6048                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6049                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6050                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6051                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6052                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6053                 </fields>
6054                 <links>
6055                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6056                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6057                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6058                 </links>
6059         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6060             <actions>
6061                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6062                     <context link="xact" jump="usr" field="home_ou"/>
6063                 </retrieve>
6064                         </actions>
6065                 </permacrud>
6066         </class>
6067         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6068                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6069                         <field name="id" reporter:datatype="id" />
6070                         <field name="ind1" />
6071                         <field name="ind2" />
6072                         <field name="record" />
6073                         <field name="subfield" />
6074                         <field name="tag" />
6075                         <field name="value" />
6076                 </fields>
6077                 <links>
6078                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6079                 </links>
6080         </class>
6081         <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">
6082                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6083                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6084                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6085                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6086                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6087                 </fields>
6088                 <links>
6089                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6090                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6091                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6092                 </links>
6093         </class>
6094         <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">
6095                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6096                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6097                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6098                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6099                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6100                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6101                 </fields>
6102                 <links>
6103                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6104                 </links>
6105         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6106             <actions>
6107                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6108                 <retrieve/>
6109                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6110                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6111             </actions>
6112         </permacrud>
6113
6114         </class>
6115         <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">
6116                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6117                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6118                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6119                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6120                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6121                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6122                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6123                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6124                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6125                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6126                 </fields>
6127                 <links>
6128                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6129                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6130                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6131                 </links>
6132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6133             <actions>
6134                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6135                 <retrieve/>
6136                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6137                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6138             </actions>
6139         </permacrud>
6140         </class>
6141         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6142                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6143                         <field name="create_date" reporter:datatype="timestamp"/>
6144                         <field name="creator" reporter:datatype="link"/>
6145                         <field name="edit_date" reporter:datatype="timestamp"/>
6146                         <field name="editor" reporter:datatype="link"/>
6147                         <field name="id" reporter:datatype="id" />
6148                         <field name="pub" reporter:datatype="bool"/>
6149                         <field name="record" reporter:datatype="link"/>
6150                         <field name="value"  reporter:datatype="text"/>
6151                 </fields>
6152                 <links>
6153                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6154                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6155                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6156                 </links>
6157         </class>
6158         <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">
6159                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6160                         <field name="balance_owed" reporter:datatype="money" />
6161                         <field name="total_owed" reporter:datatype="money" />
6162                         <field name="total_paid" reporter:datatype="money" />
6163                         <field name="usr" reporter:datatype="link"/>
6164                 </fields>
6165                 <links>
6166                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6167                 </links>
6168         </class>
6169         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6170                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6171                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6172                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6173                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6174                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6175                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6176                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6177                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6178                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6179                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6180                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6181                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6182                 </fields>
6183                 <links>
6184                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6185                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6186                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6187                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6188                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6189                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6190                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6191                 </links>
6192         </class>
6193         <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">
6194                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6195                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6196                         <field name="quality" reporter:datatype="int" />
6197                         <field name="source" reporter:datatype="text"/>
6198                         <field name="transcendant" reporter:datatype="bool"/>
6199                         <field name="can_have_copies" reporter:datatype="bool"/>
6200                 </fields>
6201                 <links/>
6202         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6203             <actions>
6204                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6205                 <retrieve/>
6206                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6207                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6208             </actions>
6209         </permacrud>
6210         </class>
6211         <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">
6212                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6213                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6214                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6215                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6216                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6217                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6218                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6219                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6220                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6221                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6222                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6223                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6224                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6225                 </fields>
6226                 <links>
6227                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6228                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6229                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6230                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6231                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6232                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6233                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6234                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6235                 </links>
6236                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6237                         <actions>
6238                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6239                                         <context link="usr" field="home_ou" />
6240                                 </retrieve>
6241                         </actions>
6242                 </permacrud>
6243         </class>
6244         <class id="actsce" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
6245                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6246                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6247                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6248                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6249                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6250                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6251                 </fields>
6252                 <links>
6253                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6254                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6255                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6256                 </links>
6257         </class>
6258         <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">
6259                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6260                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6261                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6262                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6263                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6264                 </fields>
6265                 <links>
6266                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6267                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6268                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6269                 </links>
6270         </class>
6271         <class id="cubi" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
6272                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6273                         <field name="bucket" reporter:datatype="link"/>
6274                         <field name="id" reporter:datatype="id" />
6275                         <field name="target_user" reporter:datatype="link"/>
6276                         <field name="create_time" reporter:datatype="timestamp" />
6277                         <field name="pos" reporter:datatype="int" />
6278                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6279                 </fields>
6280                 <links>
6281                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6282                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6283             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6284                 </links>
6285         </class>
6286         <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">
6287                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6288                         <field name="id" reporter:datatype="id" />
6289                         <field name="item" reporter:datatype="link"/>
6290                         <field name="note" reporter:datatype="text" />
6291                 </fields>
6292                 <links>
6293                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6294                 </links>
6295         </class>
6296         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6297                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6298                         <field name="balance_owed" reporter:datatype="money" />
6299                         <field name="total_owed" reporter:datatype="money" />
6300                         <field name="total_paid" reporter:datatype="money" />
6301                         <field name="usr" reporter:datatype="link"/>
6302                 </fields>
6303                 <links>
6304                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6305                 </links>
6306         </class>
6307         <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">
6308                 <fields oils_persist:primary="code" oils_persist:sequence="">
6309                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6310                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6311                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6312                 </fields>
6313                 <links/>
6314         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6315             <actions>
6316                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6317                 <retrieve/>
6318                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6319                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6320             </actions>
6321         </permacrud>
6322         </class>
6323         <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">
6324                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6325                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6326                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6327                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6328                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6329                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6330                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6331                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6332                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6333                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6334                 </fields>
6335                 <links>
6336                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6337                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6338                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6339                 </links>
6340         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6341             <actions>
6342                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6343                     <context link="xact" jump="usr" field="home_ou"/>
6344                 </retrieve>
6345                         </actions>
6346                 </permacrud>
6347         </class>
6348         <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">
6349                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6350                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6351                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6352                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6353                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6354                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6355                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6356                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6357                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6358                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6359                 </fields>
6360                 <links>
6361                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6362                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6363                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6364                 </links>
6365         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6366             <actions>
6367                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6368                     <context link="xact" jump="usr" field="home_ou"/>
6369                 </retrieve>
6370                         </actions>
6371                 </permacrud>
6372         </class>
6373         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6374                 <fields oils_persist:primary="id" oils_persist:sequence="">
6375                         <field name="checkin_lib" reporter:datatype="link"/>
6376                         <field name="checkin_staff" reporter:datatype="link"/>
6377                         <field name="checkin_time" reporter:datatype="timestamp"/>
6378                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6379                         <field name="circ_staff" reporter:datatype="link"/>
6380                         <field name="desk_renewal" reporter:datatype="bool"/>
6381                         <field name="due_date" reporter:datatype="timestamp"/>
6382                         <field name="duration" reporter:datatype="interval"/>
6383                         <field name="duration_rule" reporter:datatype="link"/>
6384                         <field name="fine_interval" reporter:datatype="interval"/>
6385                         <field name="id" reporter:datatype="id" />
6386                         <field name="max_fine" reporter:datatype="money" />
6387                         <field name="max_fine_rule" reporter:datatype="link"/>
6388                         <field name="opac_renewal" reporter:datatype="bool"/>
6389                         <field name="phone_renewal" reporter:datatype="bool"/>
6390                         <field name="recurring_fine" reporter:datatype="money" />
6391                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6392                         <field name="renewal_remaining" reporter:datatype="int" />
6393             <field name="grace_period" reporter:datatype="interval" />
6394                         <field name="stop_fines" reporter:datatype="text"/>
6395                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6396                         <field name="target_copy" reporter:datatype="link"/>
6397                         <field name="usr" reporter:datatype="link"/>
6398                         <field name="xact_finish" reporter:datatype="timestamp" />
6399                         <field name="xact_start" reporter:datatype="timestamp" />
6400                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6401                 </fields>
6402                 <links>
6403                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6404                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6405                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6406                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6407                 </links>
6408         </class>
6409         <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">
6410                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6411                         <field name="field" reporter:datatype="link"/>
6412                         <field name="id" reporter:datatype="id" />
6413                         <field name="source" reporter:datatype="link"/>
6414                         <field name="value" reporter:datatype="text"/>
6415                 </fields>
6416                 <links>
6417                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6418                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6419                 </links>
6420         </class>
6421         <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">
6422                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6423                         <field name="high" reporter:datatype="money" />
6424                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6425                         <field name="low" reporter:datatype="money" />
6426                         <field name="name" reporter:datatype="text"/>
6427                         <field name="normal" reporter:datatype="money" />
6428                         <field name="recurrence_interval" reporter:datatype="interval"/>
6429             <field name="grace_period" reporter:datatype="interval" />
6430                 </fields>
6431                 <links/>
6432         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6433             <actions>
6434                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6435                 <retrieve/>
6436                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6437                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6438             </actions>
6439         </permacrud>
6440         </class>
6441         <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">
6442                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6443                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6444                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6445                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6446                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6447                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6448                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6449                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6450                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6451                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6452                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6453                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6454                 </fields>
6455                 <links>
6456                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6457                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6458                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6459                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6460                 </links>
6461         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6462             <actions>
6463                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6464                     <context link="xact" jump="usr" field="home_ou"/>
6465                 </retrieve>
6466                         </actions>
6467                 </permacrud>
6468         </class>
6469         <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">
6470                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6471                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6472                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6473                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6474                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6475                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6476                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6477                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6478                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6479                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6480                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6481                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6482                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6483                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6484                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6485                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6486                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6487                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6488                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6489                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6490                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6491                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6492                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6493                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6494                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6495                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6496                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6497                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6498                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6499                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6500                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6501                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6502                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6503                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6504                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6505                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6506                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6507                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6508                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6509                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6510                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6511                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6512                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6513                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6514                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6515                 </fields>
6516                 <links>
6517                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6518                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6519                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6520                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6521                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6522                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6523                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6524                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6525                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6526                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6527                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6528                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6529                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6530                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6531                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6532                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6533                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6534                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6535                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6536                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6537                 </links>
6538         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6539             <actions>
6540                 <create permission="CREATE_COPY">
6541                     <context link="call_number" field="owning_lib"/>
6542                 </create>
6543                 <retrieve/>
6544                 <update permission="UPDATE_COPY">
6545                     <context link="call_number" field="owning_lib"/>
6546                 </update>
6547                 <delete permission="DELETE_COPY">
6548                     <context link="call_number" field="owning_lib"/>
6549                 </delete>
6550             </actions>
6551         </permacrud>
6552         </class>
6553
6554         <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">
6555                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6556                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6557                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6558                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6559                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6560                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6561                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6562                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6563                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6564                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6565                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6566                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6567                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6568                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6569                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6570                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6571                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6572                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6573                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6574                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6575                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6576                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6577                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6578                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6579                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6580                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6581                 </fields>
6582                 <links>
6583                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6584                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6585                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6586                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6587                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6588                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6589                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6590                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6591                 </links>
6592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6593                         <actions>
6594                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6595                                 <retrieve />
6596                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6597                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6598                         </actions>
6599                 </permacrud>
6600         </class>
6601
6602         <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">
6603                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6604                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6605                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6606                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6607                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6608                 </fields>
6609                 <links/>
6610         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6611             <actions>
6612                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6613                 <retrieve/>
6614                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6615                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6616             </actions>
6617         </permacrud>
6618         </class>
6619         <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">
6620                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6621                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6622                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6623                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6624                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6625                 </fields>
6626                 <links/>
6627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6628             <actions>
6629                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6630                 <retrieve/>
6631                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6632                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6633             </actions>
6634         </permacrud>
6635         </class>
6636         <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">
6637                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6638                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6639                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6640                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6641                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6642                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6643                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6644                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6645                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6646                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6647                 </fields>
6648                 <links>
6649                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6650                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6651                 </links>
6652         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6653             <actions>
6654                 <create permission="CREATE_PERM" global_required="true"/>
6655                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6656                 <update permission="UPDATE_PERM" global_required="true"/>
6657                 <delete permission="DELETE_PERM" global_required="true"/>
6658             </actions>
6659         </permacrud>
6660         </class>
6661         <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">
6662                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6663                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6664                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
6665                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
6666                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
6667                 </fields>
6668                 <links>
6669                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
6670                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
6671                 </links>
6672         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6673             <actions>
6674                 <create permission="ADMIN_SURVEY">
6675                     <context link="question" jump="survey" field="owner"/>
6676                 </create>
6677                 <retrieve/>
6678                 <update permission="ADMIN_SURVEY">
6679                     <context link="question" jump="survey" field="owner"/>
6680                 </update>
6681                 <delete permission="ADMIN_SURVEY">
6682                     <context link="question" jump="survey" field="owner"/>
6683                 </delete>
6684             </actions>
6685         </permacrud>
6686         </class>
6687         <class id="ancc" controller="open-ils.cstore" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
6688                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
6689                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6690                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
6691                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
6692                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
6693                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
6694                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
6695                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
6696                 </fields>
6697                 <links>
6698                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
6699                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
6700                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
6701                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6702                 </links>
6703         </class>
6704         <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">
6705                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6706                         <field name="balance_owed" reporter:datatype="money" />
6707                         <field name="total_owed" reporter:datatype="money" />
6708                         <field name="total_paid" reporter:datatype="money" />
6709                         <field name="usr" reporter:datatype="link"/>
6710                 </fields>
6711                 <links>
6712                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6713                 </links>
6714         </class>
6715         <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">
6716                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
6717                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
6718                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
6719                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
6720                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
6721                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
6722                 </fields>
6723                 <links>
6724                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6725                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6726                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6727                 </links>
6728         </class>
6729         <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">
6730                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
6731                         <field name="field" reporter:datatype="link"/>
6732                         <field name="id" reporter:datatype="id" />
6733                         <field name="source" reporter:datatype="link"/>
6734                         <field name="value" reporter:datatype="text"/>
6735                 </fields>
6736                 <links>
6737                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6738                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6739                 </links>
6740         </class>
6741         <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">
6742                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
6743                         <field name="field" reporter:datatype="link"/>
6744                         <field name="id" reporter:datatype="id" />
6745                         <field name="source" reporter:datatype="link"/>
6746                         <field name="value" reporter:datatype="text"/>
6747                 </fields>
6748                 <links>
6749                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6750                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6751                 </links>
6752         </class>
6753         <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">
6754                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
6755                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6756                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
6757                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
6758                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
6759                 </fields>
6760                 <links>
6761                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
6762                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6763                 </links>
6764         </class>
6765         <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">
6766                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
6767                         <field name="depth" reporter:datatype="int" />
6768                         <field name="grantable" reporter:datatype="bool"/>
6769                         <field name="grp" reporter:datatype="link"/>
6770                         <field name="id" reporter:datatype="id" />
6771                         <field name="perm" reporter:datatype="link"/>
6772                 </fields>
6773                 <links>
6774                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
6775                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6776                 </links>
6777         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6778             <actions>
6779                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
6780                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
6781                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
6782                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
6783             </actions>
6784         </permacrud>
6785         </class>
6786         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
6787                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
6788                         <field name="items" oils_persist:virtual="true" />
6789                         <field name="btype" reporter:datatype="text"/>
6790                         <field name="id" reporter:datatype="id" />
6791                         <field name="name" reporter:datatype="text"/>
6792                         <field name="description" reporter:datatype="text"/>
6793                         <field name="owner" reporter:datatype="link"/>
6794                         <field name="pub" reporter:datatype="bool"/>
6795                         <field name="create_time" reporter:datatype="timestamp" />
6796                 </fields>
6797                 <links>
6798                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6799                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
6800                 </links>
6801         </class>
6802         <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">
6803                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
6804                         <field name="id" reporter:datatype="id" />
6805                         <field name="bucket" reporter:datatype="link"/>
6806                         <field name="note" reporter:datatype="text" />
6807                 </fields>
6808                 <links>
6809                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
6810                 </links>
6811         </class>
6812         <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">
6813                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
6814                         <field name="id" reporter:datatype="int" />
6815                         <field name="usr" reporter:datatype="link"/>
6816                         <field name="work_ou" reporter:datatype="link"/>
6817                 </fields>
6818                 <links>
6819                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6820                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
6821                 </links>
6822         </class>
6823         <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">
6824                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
6825                         <field name="depth" reporter:datatype="int"/>
6826                         <field name="grantable" reporter:datatype="bool"/>
6827                         <field name="id" reporter:datatype="id" />
6828                         <field name="perm" reporter:datatype="link"/>
6829                         <field name="usr" reporter:datatype="link"/>
6830                 </fields>
6831                 <links>
6832                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6833                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6834                 </links>
6835         </class>
6836         <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">
6837                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
6838                         <field name="object_id" reporter:datatype="text"/>
6839                         <field name="grantable" reporter:datatype="bool"/>
6840                         <field name="id" reporter:datatype="id" />
6841                         <field name="perm" reporter:datatype="link"/>
6842                         <field name="usr" reporter:datatype="link"/>
6843                         <field name="object_type" reporter:datatype="text"/>
6844                 </fields>
6845                 <links>
6846                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6847                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6848                 </links>
6849         </class>
6850         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:core="true" reporter:label="Payments: All">
6851                 <fields oils_persist:primary="id" oils_persist:sequence="">
6852                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6853                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6854                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6855                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6856                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6857                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6858                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6859                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6860                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6861                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6862                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6863                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6864                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6865                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6866                 </fields>
6867                 <links>
6868                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6869                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6870                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6871                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6872                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6873                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6874                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6875                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6876                 </links>
6877         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6878             <actions>
6879                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6880                     <context link="xact" jump="usr" field="home_ou"/>
6881                 </retrieve>
6882                         </actions>
6883                 </permacrud>
6884         </class>
6885         <class id="mbp" controller="open-ils.cstore" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
6886                 <fields oils_persist:primary="id" oils_persist:sequence="">
6887                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6888                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6889                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6890                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6891                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6892                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6893                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6894                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6895                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6896                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6897                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6898                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6899                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6900                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6901                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6902                 </fields>
6903                 <links>
6904                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6905                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6906                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6907                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6908                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6909                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6910                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6911                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6912                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6913                 </links>
6914         </class>
6915         <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">
6916                 <fields oils_persist:primary="id" oils_persist:sequence="">
6917                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6918                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6919                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6920                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6921                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6922                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6923                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6924                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6925                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6926                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6927                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6928                 </fields>
6929                 <links>
6930                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6931                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6932                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6933                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6934                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6935                 </links>
6936         </class>
6937         <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">
6938                 <fields oils_persist:primary="id" oils_persist:sequence="">
6939                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6940                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6941                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6942                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6943                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6944                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6945                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6946                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
6947                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6948                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6949                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6950                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6951                 </fields>
6952                 <links>
6953                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6954                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6955                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6956                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6957                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6958                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6959                 </links>
6960         </class>
6961         <class id="cbrebi" controller="open-ils.cstore" 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">
6962                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
6963                         <field name="bucket" reporter:datatype="link"/>
6964                         <field name="id" reporter:datatype="id" />
6965                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
6966                         <field name="create_time" reporter:datatype="timestamp" />
6967                         <field name="pos" reporter:datatype="int" />
6968                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6969                 </fields>
6970                 <links>
6971                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
6972                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
6973             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
6974                 </links>
6975         </class>
6976         <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">
6977                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
6978                         <field name="id" reporter:datatype="id" />
6979                         <field name="item" reporter:datatype="link"/>
6980                         <field name="note" reporter:datatype="text" />
6981                 </fields>
6982                 <links>
6983                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
6984                 </links>
6985         </class>
6986         <class id="asce" controller="open-ils.cstore" oils_obj:fieldmapper="asset::stat_cat_entry" oils_persist:tablename="asset.stat_cat_entry" reporter:label="Item Stat Cat Entry">
6987                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
6988                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
6989                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6990                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6991                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6992                 </fields>
6993                 <links>
6994                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6995                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6996                 </links>
6997         </class>
6998     <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">
6999         <fields oils_persist:primary="field">
7000             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7001             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7002             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7003         </fields>
7004         <links/>
7005         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7006             <actions>
7007                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7008                 <retrieve />
7009                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7010                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7011             </actions>
7012         </permacrud>
7013     </class>
7014         <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">
7015                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7016                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7017                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7018                 </fields>
7019                 <links/>
7020         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7021             <actions>
7022                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7023                 <retrieve/>
7024                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7025                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7026             </actions>
7027         </permacrud>
7028         </class>
7029
7030
7031         <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">
7032                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7033                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7034                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7035                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7036                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7037                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7038                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7039                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7040                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7041                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7042                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7043                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7044                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7045                 </fields>
7046                 <links>
7047                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7048                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7049                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7050                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7051                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7052                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7053                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7054                 </links>
7055         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7056             <actions>
7057                 <create permission="TRANSIT_COPY">
7058                     <context link="target_copy" field="owner"/>
7059                 </create>
7060                 <retrieve/>
7061                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7062                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7063             </actions>
7064         </permacrud>
7065         </class>
7066         <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">
7067                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7068                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7069                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7070                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7071                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7072                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7073                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7074                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7075                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7076                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7077                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7078                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7079                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7080                 </fields>
7081                 <links>
7082                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7083                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7084                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7085                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7086                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7087                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7088                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7089                 </links>
7090         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7091             <actions>
7092                 <create permission="TRANSIT_COPY" context_field="owner">
7093                     <context link="target_copy" field="circ_lib"/>
7094                 </create>
7095                 <retrieve/>
7096                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7097                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7098             </actions>
7099         </permacrud>
7100         </class>
7101         <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">
7102                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7103                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7104                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7105                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7106                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7107                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7108                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7109                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7110                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7111                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7112                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7113                 </fields>
7114                 <links>
7115                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7116                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7117                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7118                 </links>
7119         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7120             <actions>
7121                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7122                     <context link="xact" jump="usr" field="home_ou"/>
7123                 </retrieve>
7124                         </actions>
7125                 </permacrud>
7126         </class>
7127         <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">
7128                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7129                         <field name="grp" />
7130                         <field name="id" reporter:datatype="id" />
7131                         <field name="usr" />
7132                 </fields>
7133                 <links>
7134                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7135                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7136                 </links>
7137         </class>
7138         <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">
7139                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7140                         <field name="id" reporter:datatype="id" />
7141                         <field name="fq_field" reporter:datatype="text"/>
7142                         <field name="identity_value" reporter:datatype="text"/>
7143                         <field name="translation" reporter:datatype="text"/>
7144                         <field name="string" reporter:datatype="text"/>
7145                 </fields>
7146                 <links>
7147                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7148                 </links>
7149         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7150             <actions>
7151                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7152                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7153                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7154                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7155             </actions>
7156         </permacrud>
7157         </class>
7158         <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">
7159                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7160                         <field name="id" reporter:datatype="id" />
7161                         <field name="fm_class" reporter:datatype="text"/>
7162                         <field name="field" reporter:datatype="text"/>
7163                         <field name="owner" reporter:datatype="org_unit"/>
7164                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7165                 </fields>
7166                 <links>
7167                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7168                 </links>
7169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7170             <actions>
7171                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7172                 <retrieve/>
7173                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7174                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7175             </actions>
7176         </permacrud>
7177         </class>
7178         <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">
7179                 <fields oils_persist:primary="code">
7180                         <field name="code" reporter:datatype="id" />
7181                         <field name="marc_code" reporter:datatype="text"/>
7182                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7183                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7184                 </fields>
7185                 <links/>
7186         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7187             <actions>
7188                 <create permission="CREATE_LOCALE" global_required="true"/>
7189                 <retrieve/>
7190                 <update permission="UPDATE_LOCALE" global_required="true"/>
7191                 <delete permission="DELETE_LOCALE" global_required="true"/>
7192             </actions>
7193         </permacrud>
7194         </class>
7195         <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">
7196                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7197                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7198                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7199                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7200             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7201                 </fields>
7202                 <links>
7203                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7204                 </links>
7205         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7206             <actions>
7207                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7208                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7209                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7210                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7211             </actions>
7212         </permacrud>
7213         </class>
7214
7215         <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">
7216                 <fields oils_persist:primary="id">
7217                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7218                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7219                 </fields>
7220                 <links/>
7221         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7222             <actions>
7223                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7224                 <retrieve/>
7225                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7226                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7227             </actions>
7228         </permacrud>
7229         </class>
7230
7231         <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">
7232                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7233                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7234                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7235                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7236                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7237                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7238                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7239                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7240                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7241                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7242                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7243                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7244                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7245                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7246                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7247                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7248                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7249                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7250                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7251                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7252                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7253                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7254                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7255                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7256                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7257                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7258                 </fields>
7259                 <links>
7260                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7261                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7262                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7263                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7264                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7265                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7266                 </links>
7267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7268             <actions>
7269                 <create permission="user_request.create">
7270                     <context link="usr" field="home_ou"/>
7271                                 </create>
7272                 <retrieve permission="user_request.view">
7273                     <context link="usr" field="home_ou"/>
7274                                 </retrieve>
7275                 <update permission="user_request.update">
7276                     <context link="usr" field="home_ou"/>
7277                                 </update>
7278                 <delete permission="user_request.delete">
7279                     <context link="usr" field="home_ou"/>
7280                                 </delete>
7281             </actions>
7282         </permacrud>
7283         </class>
7284
7285         <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">
7286                 <fields oils_persist:primary="code">
7287                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7288                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7289                 </fields>
7290                 <links/>
7291         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7292             <actions>
7293                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7294                 <retrieve/>
7295                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7296                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7297             </actions>
7298         </permacrud>
7299         </class>
7300
7301         <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">
7302                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7303                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7304                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7305                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7306                         <field reporter:label="Ratio" name="ratio" />
7307                 </fields>
7308                 <links>
7309                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7310                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7311                 </links>
7312                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7313                         <actions>
7314                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7315                                 <retrieve/>
7316                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7317                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7318                         </actions>
7319                 </permacrud>
7320         </class>
7321
7322         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7323                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7324                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7325                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7326                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7327                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7328                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7329                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7330                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7331                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7332                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7333                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7334                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7335                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7336                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7337                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7338                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7339                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7340                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7341                 </fields>
7342                 <links>
7343                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7344                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7345             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7346             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7347             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7348                 </links>
7349         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7350             <actions>
7351                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7352                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7353                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7354                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7355             </actions>
7356         </permacrud>
7357         </class>
7358
7359         <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">
7360                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7361                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7362                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7363                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7364                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7365                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7366                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7367                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7368                 </fields>
7369                 <links>
7370                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7371                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7372                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7373                 </links>
7374         </class>
7375
7376         <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">
7377                 <fields oils_persist:primary="code">
7378                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7379                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7380                 </fields>
7381                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7382             <actions>
7383                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7384                 <retrieve/>
7385                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7386                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7387             </actions>
7388                 </permacrud>
7389         </class>
7390
7391         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7392                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7393                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7394                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7395                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7396                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7397                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7398                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7399                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7400                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7401                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7402                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7403                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7404                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7405                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7406                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7407                 </fields>
7408                 <links>
7409                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7410                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7411                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7412                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7413                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7414                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7415                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7416                 </links>
7417         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7418             <actions>
7419                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7420                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7421                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7422                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7423             </actions>
7424         </permacrud>
7425         </class>
7426
7427         <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">
7428                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7429                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7430                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7431                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7432                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7433                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7434                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7435                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7436                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7437                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7438                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7439                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7440                 </fields>
7441                 <links>
7442                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7443                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7444                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7445                 </links>
7446         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7447             <actions>
7448                 <create   permission="ADMIN_INVOICE">
7449                                         <context link="invoice" field="receiver"/>
7450                                 </create>
7451                 <retrieve permission="ADMIN_INVOICE">
7452                                         <context link="invoice" field="receiver"/>
7453                                 </retrieve>
7454                 <update   permission="ADMIN_INVOICE">
7455                                         <context link="invoice" field="receiver"/>
7456                                 </update>
7457                                 <delete   permission="ADMIN_INVOICE">
7458                                         <context link="invoice" field="receiver"/>
7459                                 </delete>
7460             </actions>
7461         </permacrud>
7462         </class>
7463
7464         <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">
7465                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7466                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7467                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7468                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7469                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7470                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7471                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7472                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7473                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7474                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7475                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7476                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7477                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7478                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7479                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7480                 </fields>
7481                 <links>
7482                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7483                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7484                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7485                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7486                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7487                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7488                 </links>
7489         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7490             <actions>
7491                 <create   permission="ADMIN_INVOICE">
7492                                         <context link="invoice" field="receiver"/>
7493                                 </create>
7494                 <retrieve permission="ADMIN_INVOICE">
7495                                         <context link="invoice" field="receiver"/>
7496                                 </retrieve>
7497                 <update   permission="ADMIN_INVOICE">
7498                                         <context link="invoice" field="receiver"/>
7499                                 </update>
7500                                 <delete   permission="ADMIN_INVOICE">
7501                                         <context link="invoice" field="receiver"/>
7502                                 </delete>
7503             </actions>
7504         </permacrud>
7505         </class>
7506
7507         <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">
7508                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7509                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7510                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7511                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7512                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7513                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7514                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7515                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7516                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7517                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7518                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7519                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7520                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7521                 </fields>
7522                 <links>
7523                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7524                 </links>
7525         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7526             <actions>
7527                 <create permission="ADMIN_PROVIDER">
7528                     <context link="provider" field="owner"/>
7529                 </create>
7530                 <retrieve permission="ADMIN_PROVIDER">
7531                     <context link="provider" field="owner"/>
7532                 </retrieve>
7533                 <update permission="ADMIN_PROVIDER">
7534                     <context link="provider" field="owner"/>
7535                 </update>
7536                 <delete permission="ADMIN_PROVIDER">
7537                     <context link="provider" field="owner"/>
7538                 </delete>
7539             </actions>
7540         </permacrud>
7541         </class>
7542
7543         <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">
7544                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7545                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7546                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7547                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7548                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7549                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7550                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7551         </fields>
7552                 <links>
7553                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7554                 </links>
7555         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7556             <actions>
7557                 <create permission="ADMIN_PROVIDER">
7558                     <context link="provider" field="owner"/>
7559                 </create>
7560                 <retrieve permission="ADMIN_PROVIDER">
7561                     <context link="provider" field="owner"/>
7562                 </retrieve>
7563                 <update permission="ADMIN_PROVIDER">
7564                     <context link="provider" field="owner"/>
7565                 </update>
7566                 <delete permission="ADMIN_PROVIDER">
7567                     <context link="provider" field="owner"/>
7568                 </delete>
7569             </actions>
7570         </permacrud>
7571     </class>
7572         <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">
7573                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7574                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7575                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7576                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7577                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7578                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7579                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7580                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7581                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7582                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7583                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7584                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7585                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7586                 </fields>
7587                 <links>
7588                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7589                 </links>
7590         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7591             <actions>
7592                 <create permission="ADMIN_PROVIDER">
7593                     <context link="contact" jump='provider' field="owner"/>
7594                 </create>
7595                 <retrieve permission="ADMIN_PROVIDER">
7596                     <context link="contact" jump='provider' field="owner"/>
7597                 </retrieve>
7598                 <update permission="ADMIN_PROVIDER">
7599                     <context link="contact" jump='provider' field="owner"/>
7600                 </update>
7601                 <delete permission="ADMIN_PROVIDER">
7602                     <context link="contact" jump='provider' field="owner"/>
7603                 </delete>
7604             </actions>
7605         </permacrud>
7606         </class>
7607
7608         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7609                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7610                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7611                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7612                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7613                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7614                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7615                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7616                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7617                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7618                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7619                 </fields>
7620                 <links>
7621                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7622                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7623                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7624                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7625                 </links>
7626         </class>
7627
7628         <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">
7629                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7630                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7631                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7632                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7633                 </fields>
7634                 <links>
7635             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7636                 </links>
7637                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7638                         <actions>
7639                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7640                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7641                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7642                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7643                         </actions>
7644                 </permacrud>
7645         </class>
7646
7647         <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">
7648                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
7649                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
7650                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
7651                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
7652                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
7653                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
7654                 </fields>
7655                 <links>
7656                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7657                 </links>
7658                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7659                         <actions>
7660                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7661                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7662                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7663                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7664                         </actions>
7665                 </permacrud>
7666         </class>
7667
7668         <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">
7669                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
7670                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7671                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7672                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7673                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7674                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7675                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7676                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7677                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
7678                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7679                 </fields>
7680                 <links>
7681                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7682                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7683             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
7684             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
7685                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
7686                 </links>
7687         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7688             <actions>
7689                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7690                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
7691                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7692                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7693             </actions>
7694         </permacrud>
7695         </class>
7696
7697         <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">
7698                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
7699                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
7700                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
7701                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7702                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7703                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
7704                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
7705                 </fields>
7706                 <links>
7707                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7708                 </links>
7709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7710                         <actions>
7711                                 <create permission="ADMIN_FUNDING_SOURCE">
7712                     <context link="funding_source" field="owner"/>
7713                 </create>
7714                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
7715                     <context link="funding_source" field="owner"/>
7716                 </retrieve>
7717                                 <update permission="ADMIN_FUNDING_SOURCE">
7718                     <context link="funding_source" field="owner"/>
7719                 </update>
7720                                 <delete permission="ADMIN_FUNDING_SOURCE">
7721                     <context link="funding_source" field="owner"/>
7722                 </delete>
7723                         </actions>
7724                 </permacrud>
7725         </class>
7726
7727         <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">
7728                 <fields oils_persist:primary="id">
7729                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
7730                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
7731                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
7732                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
7733                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
7734                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7735                 </fields>
7736                 <links>
7737                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7738                 </links>
7739         </class>
7740
7741         <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">
7742                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
7743                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
7744                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7745                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
7746                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
7747                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7748                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
7749                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
7750                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7751                 </fields>
7752                 <links>
7753                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7754                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7755                 </links>
7756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7757                         <actions>
7758                                 <create permission="ADMIN_ACQ_FUND">
7759                     <context link="fund" field="org"/>
7760                 </create>
7761                                 <retrieve permission="ADMIN_ACQ_FUND">
7762                     <context link="fund" field="org"/>
7763                 </retrieve>
7764                                 <update permission="ADMIN_ACQ_FUND">
7765                     <context link="fund" field="org"/>
7766                 </update>
7767                                 <delete permission="ADMIN_ACQ_FUND">
7768                     <context link="fund" field="org"/>
7769                 </delete>
7770                         </actions>
7771                 </permacrud>
7772         </class>
7773
7774         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
7775                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
7776                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7777                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
7778                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7779                         <field reporter:label="Year" name="year" reporter:datatype="int" />
7780                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
7781                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7782                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
7783                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
7784                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7785                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
7786                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
7787                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7788                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7789                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
7790                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7791                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
7792                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
7793                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
7794                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
7795                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7796                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7797                 </fields>
7798                 <links>
7799                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7800                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7801             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
7802             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
7803             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
7804             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
7805             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
7806             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
7807             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
7808             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
7809             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
7810                 </links>
7811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
7812             <actions>
7813                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
7814                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
7815                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
7816                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
7817             </actions>
7818         </permacrud>
7819         </class>
7820
7821         <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">
7822                 <fields oils_persist:primary="fund">
7823                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7824                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7825                 </fields>
7826                 <links>
7827                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7828                 </links>
7829         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7830             <actions>
7831                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7832                                         <context link="fund" field="org" />
7833                 </retrieve>
7834             </actions>
7835         </permacrud>
7836         </class>
7837
7838         <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">
7839                 <fields oils_persist:primary="fund">
7840                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7841                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
7842                 </fields>
7843                 <links>
7844                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7845                 </links>
7846         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7847             <actions>
7848                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7849                                         <context link="fund" field="org" />
7850                 </retrieve>
7851             </actions>
7852         </permacrud>
7853         </class>
7854
7855         <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">
7856                 <fields oils_persist:primary="fund">
7857                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7858                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
7859                 </fields>
7860                 <links>
7861                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7862                 </links>
7863         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7864             <actions>
7865                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7866                                         <context link="fund" field="org" />
7867                 </retrieve>
7868             </actions>
7869         </permacrud>
7870         </class>
7871
7872         <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">
7873                 <fields oils_persist:primary="fund">
7874                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7875                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7876                 </fields>
7877                 <links>
7878                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7879                 </links>
7880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7881             <actions>
7882                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7883                                         <context link="fund" field="org" />
7884                 </retrieve>
7885             </actions>
7886         </permacrud>
7887         </class>
7888
7889         <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">
7890                 <fields oils_persist:primary="fund">
7891                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7892                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
7893                 </fields>
7894                 <links>
7895                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7896                 </links>
7897         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7898             <actions>
7899                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7900                                         <context link="fund" field="org" />
7901                 </retrieve>
7902             </actions>
7903         </permacrud>
7904         </class>
7905
7906    <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">
7907         <fields oils_persist:primary="fund">
7908             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7909             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7910         </fields>
7911         <links>
7912             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7913         </links>
7914     </class>
7915
7916    <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">
7917         <fields oils_persist:primary="fund">
7918             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7919             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
7920         </fields>
7921         <links>
7922             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7923         </links>
7924     </class>
7925
7926    <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">
7927         <fields oils_persist:primary="fund">
7928             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7929             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7930         </fields>
7931         <links>
7932             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7933         </links>
7934     </class>
7935
7936    <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">
7937         <fields oils_persist:primary="fund">
7938             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7939             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
7940         </fields>
7941         <links>
7942             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7943         </links>
7944     </class>
7945
7946    <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">
7947         <fields oils_persist:primary="fund">
7948             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7949             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
7950         </fields>
7951         <links>
7952             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7953         </links>
7954     </class>
7955
7956         <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">
7957                 <fields oils_persist:primary="funding_source">
7958                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7959                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
7960                 </fields>
7961                 <links>
7962                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7963                 </links>
7964         </class>
7965
7966         <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">
7967                 <fields oils_persist:primary="funding_source">
7968                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7969                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
7970                 </fields>
7971                 <links>
7972                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7973                 </links>
7974         </class>
7975
7976         <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">
7977                 <fields oils_persist:primary="funding_source">
7978                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7979                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
7980                 </fields>
7981                 <links>
7982                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7983                 </links>
7984         </class>
7985
7986         <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">
7987                 <fields oils_persist:primary="fund">
7988                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7989                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
7990                 </fields>
7991                 <links>
7992                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7993                 </links>
7994         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7995             <actions>
7996                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7997                                         <context link="fund" field="org" />
7998                 </retrieve>
7999             </actions>
8000         </permacrud>
8001     </class>
8002     <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">
8003         <oils_persist:source_definition><![CDATA[
8004             SELECT
8005                 acqf.*,
8006                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8007                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8008                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8009                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8010             FROM
8011                 acq.fund acqf
8012                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8013                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8014                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8015                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8016         ]]></oils_persist:source_definition>
8017         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8018             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8019             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8020             <field reporter:label="Name" name="name" reporter:datatype="text" />
8021             <field reporter:label="Year" name="year" reporter:datatype="int" />
8022             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8023             <field reporter:label="Code" name="code" reporter:datatype="text" />
8024             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8025             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8026             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8027             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8028             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8029
8030             <!-- non fund-native fields -->
8031             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8032             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8033             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8034             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8035         </fields>
8036         <links>
8037             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8038             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8039             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8040         </links>
8041         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8042             <actions>
8043                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8044             </actions>
8045         </permacrud>
8046         </class>
8047         <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">
8048                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8049                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8050                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8051                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8052                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8053                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8054                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8055                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8056                 </fields>
8057                 <links>
8058                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8059                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8060                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8061                 </links>
8062                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8063                         <actions>
8064                                 <create permission="ADMIN_ACQ_FUND">
8065                     <context link="fund" field="org"/>
8066                 </create>
8067                                 <retrieve permission="ADMIN_ACQ_FUND">
8068                     <context link="fund" field="org"/>
8069                 </retrieve>
8070                                 <update permission="ADMIN_ACQ_FUND">
8071                     <context link="fund" field="org"/>
8072                 </update>
8073                                 <delete permission="ADMIN_ACQ_FUND">
8074                     <context link="fund" field="org"/>
8075                 </delete>
8076                         </actions>
8077                 </permacrud>
8078         </class>
8079
8080     <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">
8081         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8082             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8083             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8084             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8085             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8086             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8087             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8088             <field reporter:label="Note" name="note" reporter:datatype="text" />
8089             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8090         </fields>
8091         <links>
8092             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8093             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8094             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8095         </links>
8096                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8097                         <actions>
8098                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8099                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8100                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8101                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8102                         </actions>
8103                 </permacrud>
8104     </class>
8105
8106         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8107                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8108                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8109                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8110                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8111                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8112                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8113                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8114                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8115                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8116                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8117                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8118                 </fields>
8119                 <links>
8120                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8121                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8122                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8123                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8124                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8125                 </links>
8126                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8127                         <actions>
8128                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8129                         </actions>
8130                 </permacrud>
8131         </class>
8132
8133         <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">
8134                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8135                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8136                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8137                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8138                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8139                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8140                 </fields>
8141                 <links>
8142                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8143                 </links>
8144                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8145                         <actions>
8146                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8147                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8148                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8149                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8150                         </actions>
8151                 </permacrud>
8152         </class>
8153
8154         <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">
8155                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8156                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8157                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8158                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8159                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8160                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8161                         <field reporter:label="State" name="state" reporter:datatype="text" />
8162                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8163                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8164                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8165                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8166                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8167                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8168                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8169                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8170                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8171                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8172                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8173                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8174                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8175                 </fields>
8176                 <links>
8177                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8178                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8179                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8180                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8181                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8182                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8183                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8184                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8185                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8186                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8187                 </links>
8188                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8189                         <actions>
8190                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8191                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8192                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8193                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8194                         </actions>
8195                 </permacrud>
8196         </class>
8197
8198         <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">
8199                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8200                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8201                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8202                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8203                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8204                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8205                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8206                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8207                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8208                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8209                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8210                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8211                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8212                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8213                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8214                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8215                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8216                 </fields>
8217                 <links>
8218                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8219                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8220                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8221                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8222                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8223                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8224                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8225                 </links>
8226                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8227             <actions>
8228                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8229             </actions>
8230                 </permacrud>
8231         </class>
8232
8233         <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">
8234                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8235                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8236                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8237                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8238                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8239                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8240                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8241                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8242                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8243                 </fields>
8244                 <links>
8245                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8246                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8247                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8248                 </links>
8249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8250             <actions>
8251                 <create permission="CREATE_PURCHASE_ORDER">
8252                     <context link="purchase_order" field="ordering_agency"/>
8253                 </create>
8254                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8255                     <context link="purchase_order" field="ordering_agency"/>
8256                 </retrieve>
8257                 <update permission="CREATE_PURCHASE_ORDER">
8258                     <context link="purchase_order" field="ordering_agency"/>
8259                 </update>
8260                 <delete permission="CREATE_PURCHASE_ORDER">
8261                     <context link="purchase_order" field="ordering_agency"/>
8262                 </delete>
8263             </actions>
8264                 </permacrud>
8265         </class>
8266
8267         <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">
8268                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8269                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8270                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8271                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8272                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8273                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8274                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8275                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8276                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8277                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8278                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8279                 </fields>
8280                 <links>
8281                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8282                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8283                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8284                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8285                 </links>
8286                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8287             <actions>
8288                 <create permission="CREATE_PURCHASE_ORDER">
8289                     <context link="purchase_order" field="ordering_agency"/>
8290                 </create>
8291                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8292                     <context link="purchase_order" field="ordering_agency"/>
8293                 </retrieve>
8294                 <update permission="CREATE_PURCHASE_ORDER">
8295                     <context link="purchase_order" field="ordering_agency"/>
8296                 </update>
8297                 <delete permission="CREATE_PURCHASE_ORDER">
8298                     <context link="purchase_order" field="ordering_agency"/>
8299                 </delete>
8300             </actions>
8301                 </permacrud>
8302         </class>
8303
8304         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8305                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8306                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8307                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8308                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8309                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8310                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8311                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8312                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8313                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8314                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8315                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8316                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8317                         <field reporter:label="State" name="state" reporter:datatype="text" />
8318                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8319                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8320                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8321                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8322                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8323                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8324                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8325                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8326                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8327                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8328                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8329                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8330                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8331                 </fields>
8332                 <links>
8333                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8334                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8335                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8336                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8337                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8338                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8339                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8340                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8341                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8342                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8343                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8344                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8345                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8346                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8347                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8348                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8349                 </links>
8350                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8351                         <actions>
8352                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8353                                         <context link="purchase_order" field="ordering_agency"/>
8354                                         <context link="picklist" field="org_unit"/>
8355                                 </retrieve>
8356                         </actions>
8357                 </permacrud>
8358         </class>
8359
8360         <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">
8361                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8362                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8363                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8364                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8365                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8366                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8367                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8368                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8369                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8370                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8371                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8372                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8373                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8374                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8375                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8376                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8377                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8378                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8379                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8380                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8381                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8382                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8383                 </fields>
8384                 <links>
8385                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8386                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8387                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8388                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8389                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8390                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8391                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8392                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8393                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8394                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8395                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8396                 </links>
8397                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8398                         <actions>
8399                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8400                                         <context link="purchase_order" field="ordering_agency"/>
8401                                         <context link="picklist" field="org_unit"/>
8402                                 </retrieve>
8403                         </actions>
8404                 </permacrud>
8405         </class>
8406
8407         <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">
8408                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8409                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8410                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8411                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8412                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8413                 </fields>
8414                 <links>
8415                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8416                 </links>
8417                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8418                         <actions>
8419                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8420                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8421                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8422                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8423                         </actions>
8424                 </permacrud>
8425         </class>
8426
8427         <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">
8428                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8429                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8430                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8431                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8432                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8433                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8434                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8435                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8436                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8437                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8438                 </fields>
8439                 <links>
8440                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8441                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8442                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8443                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8444                 </links>
8445         </class>
8446
8447         <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">
8448                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8449                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8450                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8451                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8452                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8453                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8454                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8455                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8456                 </fields>
8457                 <links>
8458                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8459                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8460                 </links>
8461         </class>
8462
8463         <class id="acqlid" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_detail" oils_persist:tablename="acq.lineitem_detail" reporter:label="Line Item Detail">
8464                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8465                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8466                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8467                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8468                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8469                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8470                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8471                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8472                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8473                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8474                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8475                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8476                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8477                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8478                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8479                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8480                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8481                 </fields>
8482                 <links>
8483                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8484                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8485                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8486                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8487                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8488                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8489                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8490                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8491                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8492                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8493                 </links>
8494         </class>
8495
8496         <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">
8497                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8498                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8499                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8500                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8501                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8502                 </fields>
8503                 <links/>
8504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8505                         <actions>
8506                                 <retrieve />
8507                         </actions>
8508                 </permacrud>
8509         </class>
8510
8511         <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">
8512                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8513                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8514                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8515                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8516                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8517                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8518             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8519                 </fields>
8520                 <links/>
8521         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8522             <actions>
8523                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8524                 <retrieve />
8525                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8526                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8527             </actions>
8528         </permacrud>
8529         </class>
8530
8531         <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">
8532                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8533                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8534                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8535                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8536                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8537                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8538                 </fields>
8539                 <links/>
8540         </class>
8541         <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">
8542                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8543                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8544                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8545                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8546                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8547                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8548                 </fields>
8549                 <links>
8550                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8551                 </links>
8552         </class>
8553
8554         <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">
8555             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8556                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8557                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8558                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8559                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8560                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8561                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8562         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8563
8564             </fields>
8565             <links>
8566                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8567             </links>
8568             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8569                 <actions>
8570                     <create permission="ADMIN_PROVIDER">
8571                         <context link="provider" field="owner"/>
8572                     </create>
8573                     <retrieve permission="ADMIN_PROVIDER">
8574                         <context link="provider" field="owner"/>
8575                     </retrieve>
8576                     <update permission="ADMIN_PROVIDER">
8577                         <context link="provider" field="owner"/>
8578                     </update>
8579                     <delete permission="ADMIN_PROVIDER">
8580                         <context link="provider" field="owner"/>
8581                     </delete>
8582                 </actions>
8583             </permacrud>
8584         </class>
8585         
8586         <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">
8587             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8588                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8589                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8590                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8591                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8592             </fields>
8593             <links>
8594                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8595             </links>
8596             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8597                 <actions>
8598                     <create permission="ADMIN_PROVIDER">
8599                         <context link="provider" field="owner"/>
8600                     </create>
8601                     <retrieve permission="ADMIN_PROVIDER">
8602                         <context link="provider" field="owner"/>
8603                     </retrieve>
8604                     <update permission="ADMIN_PROVIDER">
8605                         <context link="provider" field="owner"/>
8606                     </update>
8607                     <delete permission="ADMIN_PROVIDER">
8608                         <context link="provider" field="owner"/>
8609                     </delete>
8610                 </actions>
8611             </permacrud>
8612         </class>
8613         
8614         <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">
8615             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8616                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8617                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8618                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8619                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8620                 </fields>
8621                 <links/>
8622         </class>
8623
8624         <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">
8625                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8626                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8627                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8628                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8629                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8630                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8631                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8632                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8633                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8634                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8635                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8636                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8637                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8638                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8639                 </fields>
8640                 <links>
8641                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8642                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8643                 </links>
8644         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8645             <actions>
8646                 <create permission="ADMIN_PROVIDER">
8647                     <context link="provider" field="owner"/>
8648                 </create>
8649                 <retrieve permission="ADMIN_PROVIDER">
8650                     <context link="provider" field="owner"/>
8651                 </retrieve>
8652                 <update permission="ADMIN_PROVIDER">
8653                     <context link="provider" field="owner"/>
8654                 </update>
8655                 <delete permission="ADMIN_PROVIDER">
8656                     <context link="provider" field="owner"/>
8657                 </delete>
8658             </actions>
8659         </permacrud>
8660         </class>
8661
8662         <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">
8663                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
8664                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
8665                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
8666                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
8667                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
8668                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
8669                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
8670                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
8671                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
8672                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
8673                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
8674                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
8675                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
8676                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
8677                 </fields>
8678                 <links>
8679                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
8680                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8681                 </links>
8682         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8683             <actions>
8684                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8685                     <context link="account" jump="provider" field="owner"/>
8686                 </retrieve>
8687                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8688                     <context link="account" jump="provider" field="owner"/>
8689                 </update>
8690                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8691                     <context link="account" jump="provider" field="owner"/>
8692                 </delete>
8693             </actions>
8694         </permacrud>
8695         </class>
8696
8697
8698         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
8699                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
8700                         <field name="id" reporter:datatype="id" />
8701                         <field name="parent" reporter:datatype="link"/>
8702                         <field name="owner" reporter:datatype="link"/>
8703                         <field name="create_time" reporter:datatype="timestamp"/>
8704                         <field name="name" reporter:datatype="text"/>
8705                         <field name="shared" reporter:datatype="bool"/>
8706                         <field name="share_with" reporter:datatype="link"/>
8707                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8708                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
8709                 </fields>
8710                 <links>
8711                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8712                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
8713                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
8714                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8715                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
8716                 </links>
8717         </class>
8718         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
8719                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
8720                         <field name="id" reporter:datatype="id" />
8721                         <field name="parent" reporter:datatype="link"/>
8722                         <field name="owner" reporter:datatype="link"/>
8723                         <field name="create_time" reporter:datatype="timestamp"/>
8724                         <field name="name" reporter:datatype="text"/>
8725                         <field name="shared" reporter:datatype="bool"/>
8726                         <field name="share_with" reporter:datatype="link"/>
8727                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8728                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
8729                 </fields>
8730                 <links>
8731                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8732                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
8733                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
8734                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8735                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
8736                 </links>
8737         </class>
8738         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
8739                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
8740                         <field name="id" reporter:datatype="id" />
8741                         <field name="parent" reporter:datatype="link"/>
8742                         <field name="owner" reporter:datatype="link"/>
8743                         <field name="create_time" reporter:datatype="timestamp"/>
8744                         <field name="name" reporter:datatype="text"/>
8745                         <field name="shared" reporter:datatype="bool"/>
8746                         <field name="share_with" reporter:datatype="link"/>
8747                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8748                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8749                 </fields>
8750                 <links>
8751                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8752                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
8753                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
8754                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8755                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
8756                 </links>
8757         </class>
8758         <class id="rt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
8759                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
8760                         <field name="id" reporter:datatype="id" />
8761                         <field name="owner" reporter:datatype="link"/>
8762                         <field name="create_time" reporter:datatype="timestamp"/>
8763                         <field name="name" reporter:datatype="text"/>
8764                         <field name="data" reporter:datatype="text"/>
8765                         <field name="folder" reporter:datatype="link"/>
8766                         <field name="description" reporter:datatype="text"/>
8767                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8768                 </fields>
8769                 <links>
8770                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8771                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
8772                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
8773                 </links>
8774         </class>
8775         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
8776                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
8777                         <field name="id" reporter:datatype="id" />
8778                         <field name="owner" reporter:datatype="link"/>
8779                         <field name="create_time" reporter:datatype="timestamp"/>
8780                         <field name="template" reporter:datatype="link"/>
8781                         <field name="data" reporter:datatype="text"/>
8782                         <field name="folder" reporter:datatype="link"/>
8783                         <field name="recur" reporter:datatype="bool"/>
8784                         <field name="recurrence" reporter:datatype="interval"/>
8785                         <field name="name" reporter:datatype="text"/>
8786                         <field name="description" reporter:datatype="text"/>
8787                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
8788                 </fields>
8789                 <links>
8790                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8791                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
8792                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
8793                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
8794                 </links>
8795         </class>
8796         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
8797                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
8798                         <field name="id" reporter:datatype="id" />
8799                         <field name="runner" reporter:datatype="link"/>
8800                         <field name="start_time" reporter:datatype="timestamp"/>
8801                         <field name="complete_time" reporter:datatype="timestamp"/>
8802                         <field name="run_time" reporter:datatype="timestamp"/>
8803                         <field name="email" reporter:datatype="text"/>
8804                         <field name="excel_format" reporter:datatype="bool"/>
8805                         <field name="csv_format" reporter:datatype="bool"/>
8806                         <field name="html_format" reporter:datatype="bool"/>
8807                         <field name="error_code" reporter:datatype="int"/>
8808                         <field name="error_text" reporter:datatype="text"/>
8809                         <field name="report" reporter:datatype="link"/>
8810                         <field name="folder" reporter:datatype="link"/>
8811                         <field name="chart_pie" reporter:datatype="bool"/>
8812                         <field name="chart_bar" reporter:datatype="bool"/>
8813                         <field name="chart_line" reporter:datatype="bool"/>
8814                 </fields>
8815                 <links>
8816                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
8817                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
8818                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
8819                 </links>
8820         </class>
8821         <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">
8822                 <fields oils_persist:primary="id">
8823                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8824                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8825                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8826                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8827                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8828                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8829                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8830                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8831                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8832                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8833                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8834                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8835                 </fields>
8836                 <links>
8837                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8838                 </links>
8839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8840                         <actions>
8841                                 <retrieve />
8842                         </actions>
8843                 </permacrud>
8844         </class>
8845         <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">
8846                 <fields oils_persist:primary="id">
8847                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8848                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8849                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8850                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8851                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8852                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8853                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8854                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8855                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8856                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8857                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8858                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8859                 </fields>
8860                 <links>
8861                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8862                 </links>
8863         </class>
8864         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
8865                 <fields oils_persist:primary="id">
8866                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8867                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
8868                         <field reporter:label="Fingerprint" name="fingerprint" />
8869                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8870                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8871                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8872                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8873                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
8874                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8875                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8876                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8877                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
8878                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
8879                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
8880                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8881                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8882                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
8883                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
8884                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
8885                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
8886                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
8887                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
8888                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8889                 </fields>
8890                 <links>
8891                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
8892                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8893                 </links>
8894         </class>
8895         <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">
8896                 <fields oils_persist:primary="id">
8897                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
8898                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
8899                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
8900                 </fields>
8901                 <links>
8902                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
8903                 </links>
8904         </class>
8905         <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">
8906                 <fields oils_persist:primary="id">
8907                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
8908                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
8909                 </fields>
8910                 <links>
8911                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
8912                 </links>
8913         </class>
8914         <class id="rhrr" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
8915                 <fields oils_persist:primary="id">
8916                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
8917                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
8918                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
8919                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
8920                 </fields>
8921                 <links>
8922                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
8923                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
8924                 </links>
8925         </class>
8926         <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">
8927                 <fields oils_persist:primary="xact">
8928                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8929                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
8930                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
8931                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
8932                 </fields>
8933                 <links>
8934                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8935                 </links>
8936         </class>
8937         <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">
8938                 <fields oils_persist:primary="xact">
8939                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8940                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
8941                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
8942                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
8943                 </fields>
8944                 <links>
8945                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8946                 </links>
8947         </class>
8948         <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)">
8949                 <fields oils_persist:primary="id">
8950                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
8951                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
8952                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
8953                 </fields>
8954                 <links>
8955                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
8956                 </links>
8957         </class>
8958         <class id="erfcc" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::full_circ_count" oils_persist:tablename="extend_reporter.full_circ_count" reporter:label="Total Circulation Count, Including Legacy">
8959                 <fields oils_persist:primary="id">
8960                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
8961                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
8962                 </fields>
8963                 <links>
8964                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
8965                 </links>
8966         </class>
8967         <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">
8968                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
8969                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
8970                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
8971                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
8972                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
8973                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
8974                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
8975                 </fields>
8976                 <links>
8977                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8978                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
8979                 </links>
8980                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8981                         <actions>
8982                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8983                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8984                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8985                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8986                         </actions>
8987                 </permacrud>
8988         </class>
8989         <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">
8990                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
8991                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
8992                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
8993                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8994                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
8995                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
8996                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8997                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8998                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8999                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9000                 </fields>
9001                 <links>
9002                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9003                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9004                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9005                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9006                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9007                 </links>
9008                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9009                         <actions>
9010                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9011                                         <context link="formula" field="owner"/>
9012                                 </create>
9013                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9014                                         <context link="formula" field="owner"/>
9015                                 </retrieve>
9016                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9017                                         <context link="formula" field="owner"/>
9018                                 </update>
9019                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9020                                         <context link="formula" field="owner"/>
9021                                 </delete>
9022                         </actions>
9023                 </permacrud>
9024         </class>
9025
9026         <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">
9027                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9028                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9029                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9030                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9031                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9032                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9033                 </fields>
9034                 <links>
9035                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9036                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9037                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9038                 </links>
9039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9040                         <actions>
9041                                 <create permission="CREATE_PURCHASE_ORDER">
9042                                         <context link="formula" field="owner"/>
9043                 </create>
9044                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9045                                         <context link="formula" field="owner"/>
9046                 </retrieve>
9047                                 <update permission="CREATE_PURCHASE_ORDER">
9048                                         <context link="formula" field="owner"/>
9049                 </update>
9050                                 <delete permission="CREATE_PURCHASE_ORDER">
9051                                         <context link="formula" field="owner"/>
9052                 </delete>
9053                         </actions>
9054                 </permacrud>
9055         </class>
9056
9057         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9058                 <fields oils_persist:primary="id">
9059                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9060                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9061                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9062                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9063                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9064                 </fields>
9065                 <links>
9066                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9067                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9068                 </links>
9069         </class>
9070
9071         <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">
9072                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9073                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9074                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9075                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9076                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9077                 </fields>
9078                 <links>
9079                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9080                 </links>
9081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9082                         <actions>
9083                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9084                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9085                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9086                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9087                         </actions>
9088                 </permacrud>
9089         </class>
9090
9091         <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">
9092                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9093                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9094                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9095                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9096                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9097                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9098                 </fields>
9099                 <links>
9100                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9101                 </links>
9102                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9103                         <actions>
9104                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9105                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9106                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9107                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9108                         </actions>
9109                 </permacrud>
9110         </class>
9111
9112         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9113                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9114                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9115                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9116                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9117                 </fields>
9118                 <links>
9119                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9120                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9121                 </links>
9122         </class>
9123
9124         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9125                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9126                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9127                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9128                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9129                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9130                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9131                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9132                 </fields>
9133                 <links>
9134                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9135                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9136                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9137                 </links>
9138         </class>
9139
9140         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9141                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9142                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9143                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9144                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9145                 </fields>
9146                 <links>
9147                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9148                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9149                 </links>
9150         </class>
9151
9152         <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">
9153                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9154                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9155                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9156                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9157                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9158                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9159                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9160                 </fields>
9161                 <links>
9162                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9163                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9164                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9165                 </links>
9166         </class>
9167
9168         <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">
9169                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9170                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9172                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9173                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9174                 </fields>
9175                 <links>
9176                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9177                 </links>
9178                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9179             <actions>
9180                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9181                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9182                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9183                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9184             </actions>
9185                 </permacrud>
9186         </class>
9187
9188         <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">
9189                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9190                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9191                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9192                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9193                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9194                 </fields>
9195                 <links>
9196                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9197                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9198                 </links>
9199                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9200                         <actions>
9201                                 <create permission="ADMIN_CLAIM_POLICY">
9202                                         <context link="claim_policy" field="org_unit"/>
9203                 </create>
9204                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9205                                         <context link="claim_policy" field="org_unit"/>
9206                 </retrieve>
9207                                 <update permission="ADMIN_CLAIM_POLICY">
9208                                         <context link="claim_policy" field="org_unit"/>
9209                 </update>
9210                                 <delete permission="ADMIN_CLAIM_POLICY">
9211                                         <context link="claim_policy" field="org_unit"/>
9212                 </delete>
9213                         </actions>
9214                 </permacrud>
9215         </class>
9216
9217     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9218         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9219             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9220             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9221             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9222             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9223             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9224             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9225             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9226             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9227             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9228             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9229             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9230             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9231             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9232             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9233             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9234             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9235         </fields>
9236         <links>
9237             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9238         </links>
9239     </class>
9240
9241     <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">
9242         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
9243             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9244             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9245             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9246             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9247             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9248         </fields>
9249     </class>
9250
9251     <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">
9252         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9253             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9254             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9255             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9256             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9257             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9258             <field reporter:label="City" name="city" reporter:datatype="text"/>
9259             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9260             <field reporter:label="State" name="state" reporter:datatype="text"/>
9261             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9262             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9263             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9264         </fields>
9265     </class>
9266
9267     <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">
9268         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9269             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9270             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9271             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9272             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9273             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9274             <field reporter:label="City" name="city" reporter:datatype="text"/>
9275             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9276             <field reporter:label="State" name="state" reporter:datatype="text"/>
9277             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9278             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9279             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9280         </fields>
9281     </class>
9282
9283     <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">
9284         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9285             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9286             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9287             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9288             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9289             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9290             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9291         </fields>
9292     </class>
9293
9294         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9295                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9296                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9297                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9298                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9299                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9300                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9301                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9302                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9303                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9304                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9305                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9306                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9307                 </fields>
9308                 <links>
9309                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9310                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9311                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9312                 </links>
9313         </class>
9314
9315         <class id="afscv" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
9316                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9317                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9318                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9319                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9320                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9321                 </fields>
9322                 <links>
9323                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9324                 </links>
9325         </class>
9326
9327     <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">
9328         <fields>
9329             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9330             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9331             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9332         </fields>
9333                 <links>
9334                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9335                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9336                 </links>
9337     </class>
9338
9339     <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">
9340         <fields>
9341             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9342             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9343         </fields>
9344                 <links>
9345                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9346                 </links>
9347     </class>
9348
9349     <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">
9350         <fields>
9351             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9352             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9353             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9354         </fields>
9355                 <links>
9356                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9357                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9358                 </links>
9359     </class>
9360
9361     <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">
9362         <fields>
9363             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9364             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
9365         </fields>
9366                 <links>
9367                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9368                 </links>
9369     </class>
9370
9371     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9372                 <oils_persist:source_definition>
9373
9374             SELECT  DISTINCT l.*
9375               FROM  action.unfulfilled_hold_loops l
9376                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9377               WHERE l.count = m.max
9378
9379                 </oils_persist:source_definition>
9380         <fields>
9381             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9382             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9383             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9384         </fields>
9385                 <links>
9386                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9387                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9388                 </links>
9389     </class>
9390
9391         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9392                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9393                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9394                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9395                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9396                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9397                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9398                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9399                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9400                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9401                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9402                 </fields>
9403                 <links>
9404                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9405                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9406                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9407                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9408                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9409                 </links>
9410         </class>
9411
9412         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9413                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9414                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9415                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9416                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9417                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9418                 </fields>
9419                 <links>
9420                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9421                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9422                 </links>
9423         </class>
9424
9425         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9426                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9427                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9428                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9429                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9430                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9431                 </fields>
9432                 <links>
9433                 </links>
9434         </class>
9435
9436         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9437                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9438                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9439                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9440                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9441                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9442                 </fields>
9443                 <links>
9444                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9445                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9446                 </links>
9447         </class>
9448         
9449         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9450                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9451                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9452                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9453                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9454                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9455                 </fields>
9456                 <links>
9457                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9458                 </links>
9459         </class>
9460         
9461         <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">
9462                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9463                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9464                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9465                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9466                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9467                 </fields>
9468                 <links>
9469                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9470                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9471                 </links>
9472         </class>
9473
9474         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9475                 <fields oils_persist:primary="name">
9476                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9477                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9478                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9479                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9480                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9481                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9482                 </fields>
9483                 <links>
9484                 </links>
9485         </class>
9486
9487         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9488                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9489                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9490                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9491                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9492                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9493                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9494                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9495                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9496                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9497                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9498                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9499                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9500                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9501                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9502                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9503                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9504                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9505                 </fields>
9506                 <links>
9507                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9508                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9509                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9510                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9511                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9512                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9513                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9514                 </links>
9515         </class>
9516
9517         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9518                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9519                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9520                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9521                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9522                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9523                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9524                 </fields>
9525                 <links>
9526                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9527                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9528                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9529                 </links>
9530         </class>
9531
9532         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9533                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9534                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9535                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9536                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9537                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9538                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9539                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9540                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9541                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9542                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9543                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9544                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9545                 </fields>
9546                 <links>
9547                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9548                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9549                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9550                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9551                 </links>
9552         </class>
9553
9554         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9555                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9556                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9557                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9558                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9559                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9560                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9561                 </fields>
9562                 <links>
9563                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9564                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9565                 </links>
9566         </class>
9567
9568         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9569                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9570                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9571                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9572                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9573                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9574                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9575                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9576                 </fields>
9577                 <links>
9578                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9579                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9580                 </links>
9581         </class>
9582
9583         <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">
9584                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9585                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9586                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9587                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9588                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9589                 </fields>
9590                 <links>
9591                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9592                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9593                 </links>
9594         </class>
9595
9596         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9597                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9598                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9599                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9600                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9601                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9602                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9603                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9604                 </fields>
9605                 <links>
9606                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9607                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9608                 </links>
9609         </class>
9610
9611         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9612                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9613                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9614                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9615                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9616                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9617                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9618                 </fields>
9619                 <links>
9620                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9621                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9622                 </links>
9623         </class>
9624
9625         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
9626                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9627                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9628                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9629                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9630                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9631                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9632                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9633                 </fields>
9634                 <links>
9635                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9636                 </links>
9637         </class>
9638
9639         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
9640                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9641                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9642                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9643                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9644                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9645                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9646                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9647                 </fields>
9648                 <links>
9649                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9650                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9651                 </links>
9652         </class>
9653
9654         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
9655                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9656                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9657                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9658                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9659                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9660                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9661                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9662                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9663                 </fields>
9664                 <links>
9665                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9666                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9667                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9668                 </links>
9669         </class>
9670
9671         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
9672                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9673                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9674                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9675                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9676                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9677                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9678                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9679                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9680                 </fields>
9681                 <links>
9682                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9683                 </links>
9684         </class>
9685
9686         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
9687                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9688                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9689                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9690                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9691                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9692                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9693                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9694                 </fields>
9695                 <links>
9696                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9697                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9698                 </links>
9699         </class>
9700
9701         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
9702                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9703                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9704                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9705                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9706                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9707                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9708                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9709                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9710                 </fields>
9711                 <links>
9712                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9713                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9714                 </links>
9715         </class>
9716
9717         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
9718                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9719                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9720                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9721                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9722                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9723                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9724                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9725                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9726                 </fields>
9727                 <links>
9728                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9729                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9730                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9731                 </links>
9732         </class>
9733
9734         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
9735                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9736                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9737                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9738                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9739                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9740                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9741                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9742                 </fields>
9743                 <links>
9744                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9745                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9746                 </links>
9747         </class>
9748
9749         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
9750                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9751                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9752                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9753                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9754                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9755                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9756                 </fields>
9757                 <links>
9758                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9759                 </links>
9760         </class>
9761
9762         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
9763                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9764                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9765                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9766                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9767                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9768                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9769                 </fields>
9770                 <links>
9771                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9772                 </links>
9773         </class>
9774
9775         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
9776                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9777                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9778                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9779                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9780                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9781                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9782                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9783                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9784                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9785                 </fields>
9786                 <links>
9787                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9788                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9789                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9790                 </links>
9791         </class>
9792
9793         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
9794                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9795                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9796                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9797                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9798                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9799                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9800                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9801                 </fields>
9802                 <links>
9803                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9804                 </links>
9805         </class>
9806
9807         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
9808                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9809                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9810                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9811                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9812                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9813                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9814                 </fields>
9815                 <links>
9816                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9817                 </links>
9818         </class>
9819
9820         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
9821                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9822                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9823                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9824                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9825                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9826                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9827                 </fields>
9828                 <links>
9829                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9830                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9831                 </links>
9832         </class>
9833
9834         <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">
9835                 <fields oils_persist:primary="id">
9836                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
9837                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
9838                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
9839                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
9840                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
9841                 </fields>
9842                 <links>
9843                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
9844                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9845                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
9846                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
9847                 </links>
9848         </class>
9849
9850         <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">
9851                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
9852                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9853                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
9854                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
9855                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
9856                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9857                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9858                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
9859                 </fields>
9860                 <links/>
9861                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9862                         <actions>
9863                                 <retrieve/>
9864                         </actions>
9865                 </permacrud>
9866         </class>
9867
9868         <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">
9869                 <fields oils_persist:primary="ptype_key">
9870                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
9871                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9872                 </fields>
9873                 <links/>
9874                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9875                         <actions>
9876                                 <retrieve/>
9877                         </actions>
9878                 </permacrud>
9879         </class>
9880
9881         <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">
9882                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
9883                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9884                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
9885                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
9886                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9887                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9888                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9889                 </fields>
9890                 <links>
9891                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
9892                 </links>
9893                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9894                         <actions>
9895                                 <retrieve/>
9896                         </actions>
9897                 </permacrud>
9898         </class>
9899
9900         <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">
9901                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
9902                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9903                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
9904                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
9905                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9906                 </fields>
9907                 <links>
9908                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9909                 </links>
9910                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9911                         <actions>
9912                                 <retrieve/>
9913                         </actions>
9914                 </permacrud>
9915         </class>
9916
9917     <class
9918         id="uvs"
9919         controller="open-ils.cstore open-ils.pcrud"
9920         oils_obj:fieldmapper="url_verify::session"
9921         oils_persist:tablename="url_verify.session"
9922         reporter:label="URL Verification Session"
9923     >
9924         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
9925             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
9926             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9927                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
9928             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9929             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
9930             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9931             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
9932             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
9933             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
9934         </fields>
9935
9936         <links>
9937             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9938             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9939             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
9940             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
9941             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
9942         </links>
9943
9944         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9945             <actions>
9946                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
9947             </actions>
9948         </permacrud>
9949
9950     </class>
9951
9952     <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">
9953         <oils_persist:source_definition>
9954             SELECT
9955                 cbrebi.id AS id,  -- so we can have a pkey in our view
9956                 uvs.id AS session,
9957                 uvs.owning_lib,
9958                 cbrebi.target_biblio_record_entry
9959             FROM url_verify.session uvs
9960             JOIN container.biblio_record_entry_bucket cbreb
9961                 ON (uvs.container = cbreb.id)
9962             JOIN container.biblio_record_entry_bucket_item cbrebi
9963                 ON (cbrebi.bucket = cbreb.id)
9964         </oils_persist:source_definition>
9965         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
9966             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
9967             <field reporter:label="Session" name="session" reporter:datatype="link" />
9968             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
9969             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
9970         </fields>
9971         <links>
9972             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
9973             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
9974             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
9975         </links>
9976         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9977             <actions>
9978                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
9979             </actions>
9980         </permacrud>
9981     </class>
9982
9983     <class
9984         id="uvus"
9985         controller="open-ils.cstore open-ils.pcrud"
9986         oils_obj:fieldmapper="url_verify::url_selector"
9987         oils_persist:tablename="url_verify.url_selector"
9988         reporter:label="URL Verification URL Selector"
9989     >
9990         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
9991             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
9992             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
9993                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
9994             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
9995         </fields>
9996
9997         <links>
9998             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
9999             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10000         </links>
10001
10002         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10003             <actions>
10004                 <create permission="URL_VERIFY">
10005                     <context link="session" field="owning_lib"/>
10006                 </create>
10007                 <retrieve permission="URL_VERIFY">
10008                     <context link="session" field="owning_lib"/>
10009                 </retrieve>
10010                 <update permission="URL_VERIFY">
10011                     <context link="session" field="owning_lib"/>
10012                 </update>
10013                 <delete permission="URL_VERIFY">
10014                     <context link="session" field="owning_lib"/>
10015                 </delete>
10016             </actions>
10017         </permacrud>
10018
10019     </class>
10020
10021     <class
10022         id="uvu"
10023         controller="open-ils.cstore open-ils.pcrud"
10024         oils_obj:fieldmapper="url_verify::url"
10025         oils_persist:tablename="url_verify.url"
10026         reporter:label="URL Verification URL"
10027     >
10028         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10029             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10030                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10031                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10032                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10033                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10034             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10035             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10036             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10037             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10038             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10039             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10040             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10041             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10042             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10043             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10044             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10045             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10046             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10047         </fields>
10048
10049         <links>
10050             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10051             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10052             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10053             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10054             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10055         </links>
10056
10057         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10058             <actions>
10059                 <create permission="URL_VERIFY">
10060                     <context link="session" field="owning_lib"/>
10061                 </create>
10062                 <retrieve permission="URL_VERIFY">
10063                     <context link="session" field="owning_lib"/>
10064                 </retrieve>
10065                 <update permission="URL_VERIFY">
10066                     <context link="session" field="owning_lib"/>
10067                 </update>
10068                 <delete permission="URL_VERIFY">
10069                     <context link="session" field="owning_lib"/>
10070                 </delete>
10071             </actions>
10072         </permacrud>
10073
10074     </class>
10075
10076     <class
10077         id="uvva"
10078         controller="open-ils.cstore open-ils.pcrud"
10079         oils_obj:fieldmapper="url_verify::verification_attempt"
10080         oils_persist:tablename="url_verify.verification_attempt"
10081         reporter:label="URL Verification Attempt"
10082     >
10083         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10084             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10085                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10086                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10087             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10088             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10089         </fields>
10090
10091         <links>
10092             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10093             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10094         </links>
10095
10096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10097             <actions>
10098                 <create permission="URL_VERIFY">
10099                     <context link="session" field="owning_lib"/>
10100                 </create>
10101                 <retrieve permission="URL_VERIFY">
10102                     <context link="session" field="owning_lib"/>
10103                 </retrieve>
10104                 <update permission="URL_VERIFY">
10105                     <context link="session" field="owning_lib"/>
10106                 </update>
10107                 <delete permission="URL_VERIFY">
10108                     <context link="session" field="owning_lib"/>
10109                 </delete>
10110             </actions>
10111         </permacrud>
10112
10113     </class>
10114
10115     <class
10116         id="uvuv"
10117         controller="open-ils.cstore open-ils.pcrud"
10118         oils_obj:fieldmapper="url_verify::url_verification"
10119         oils_persist:tablename="url_verify.url_verification"
10120         reporter:label="URL Verification"
10121     >
10122         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10123             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10124                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10125                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10126             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10127             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10128             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10129             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10130                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10131         </fields>
10132
10133         <links>
10134             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10135             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10136             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10137         </links>
10138
10139         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10140             <actions>
10141                 <create permission="URL_VERIFY">
10142                     <context link="attempt" jump="session" field="owning_lib"/>
10143                 </create>
10144                 <retrieve permission="URL_VERIFY">
10145                     <context link="attempt" jump="session" field="owning_lib"/>
10146                 </retrieve>
10147                 <update permission="URL_VERIFY">
10148                     <context link="attempt" jump="session" field="owning_lib"/>
10149                 </update>
10150                 <delete permission="URL_VERIFY">
10151                     <context link="attempt" jump="session" field="owning_lib"/>
10152                 </delete>
10153             </actions>
10154         </permacrud>
10155
10156     </class>
10157
10158         <class
10159                 id="cfdi"
10160                 controller="open-ils.cstore open-ils.pcrud"
10161                 oils_obj:fieldmapper="config::filter_dialog_interface"
10162                 oils_persist:tablename="config.filter_dialog_interface"
10163                 reporter:label="FilterDialog Interface">
10164                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10165                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10166                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10167                 </fields>
10168                 <links>
10169                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10170                 </links>
10171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10172                         <actions>
10173                                 <retrieve />
10174                         </actions>
10175                 </permacrud>
10176         </class>
10177
10178         <class
10179                 id="cfdfs"
10180                 controller="open-ils.cstore open-ils.pcrud"
10181                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10182                 oils_persist:tablename="config.filter_dialog_filter_set"
10183                 reporter:label="FilterDialog Filter Set">
10184                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10185                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10186                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10187                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10188                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10189                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10190                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10191                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10192                 </fields>
10193                 <links>
10194                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10195                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10196                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10197                 </links>
10198                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10199                         <actions>
10200                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10201                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10202                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10203                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10204                         </actions>
10205                 </permacrud>
10206
10207         </class>
10208
10209         <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">
10210                 <fields oils_persist:primary="code">
10211                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10212                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10213                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10214                 </fields>
10215                 <links/>
10216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10217                         <actions>
10218                                 <retrieve/>
10219                         </actions>
10220                 </permacrud>
10221         </class>
10222
10223         <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">
10224                 <oils_persist:source_definition>
10225
10226             SELECT  b.id,
10227                     MAX(dcp.edit_date) AS last_delete_date
10228              FROM   biblio.record_entry b
10229                     JOIN asset.call_number cn ON (cn.record = b.id)
10230                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10231              WHERE  NOT b.deleted
10232              GROUP BY b.id
10233              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10234
10235                 </oils_persist:source_definition>
10236                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10237                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10238                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10239                 </fields>
10240                 <links>
10241                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10242                 </links>
10243                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10244                         <actions>
10245                                 <retrieve/>
10246                         </actions>
10247                 </permacrud>
10248         </class>
10249
10250         <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">
10251                 <oils_persist:source_definition>
10252
10253             -- -- If we uncomment the RIGHT JOIN against biblio.record_entry, then we'll get a row for every non-deleted bib, whether it has active holds or not.
10254             -- -- If we expect to use pcrud to query against specific bibs, we probably want to do this.  However, if we're using this to populate a report, we
10255             -- -- may not.
10256             -- SELECT
10257             --     bre.id AS "bib_id",
10258             --     COALESCE( z.copy_count, 0 ) AS "copy_count",
10259             --     COALESCE( z.hold_count, 0 ) AS "hold_count",
10260             --     COALESCE( z.copy_hold_ratio, 0 ) AS "hold_copy_ratio"
10261             -- FROM (
10262                 SELECT
10263                     y.bre AS "id",
10264                     COALESCE( x.copy_count, 0 ) AS "copy_count",
10265                     y.hold_count AS "hold_count",
10266                     (y.hold_count::REAL / (CASE WHEN x.copy_count = 0 OR x.copy_count IS NULL THEN 0.1 ELSE x.copy_count::REAL END)) AS "hold_copy_ratio"
10267                 FROM (
10268                         SELECT
10269                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS "bre",
10270                             COUNT(*) AS "hold_count"
10271                         FROM action.hold_request h
10272                         WHERE
10273                             cancel_time IS NULL
10274                             AND fulfillment_time IS NULL
10275                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10276                         GROUP BY 1
10277                     )y LEFT JOIN (
10278                         SELECT 
10279                             (SELECT id
10280                                 FROM biblio.record_entry 
10281                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number)
10282                             ) AS "bre", 
10283                             COUNT(*) AS "copy_count"
10284                         FROM asset.copy
10285                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10286                         WHERE copy.holdable 
10287                             AND NOT copy.deleted 
10288                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10289                         GROUP BY 1
10290                     )x ON x.bre = y.bre
10291                 -- )z RIGHT JOIN (
10292                 --     SELECT id
10293                 --     FROM biblio.record_entry
10294                 --     WHERE NOT deleted
10295                 -- )bre ON (z.bib_id = bre.id)
10296                 
10297
10298                 </oils_persist:source_definition>
10299                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10300                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10301                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10302                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10303                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10304                 </fields>
10305                 <links>
10306                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10307                 </links>
10308                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10309                         <actions>
10310                                 <retrieve/>
10311                         </actions>
10312                 </permacrud>
10313         </class>
10314
10315         <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">
10316                 <oils_persist:source_definition>
10317             SELECT *,
10318                 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,
10319                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10320             FROM
10321                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
10322                     FROM
10323                         action.hold_request ahr
10324                         JOIN reporter.hold_request_record rhrr USING (id)
10325                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10326                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10327                     WHERE
10328                         ahr.cancel_time IS NULL
10329                         AND ahr.fulfillment_time IS NULL
10330                     GROUP BY bib_record, pickup_lib
10331                 )x
10332                 JOIN
10333                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10334                     FROM
10335                         action.hold_request ahr
10336                         JOIN reporter.hold_request_record rhrr USING (id)
10337                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10338                     WHERE
10339                         ahr.cancel_time IS NULL
10340                         AND ahr.fulfillment_time IS NULL
10341                     GROUP BY bib_record
10342                 )y
10343                 USING (id)
10344                 </oils_persist:source_definition>
10345                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10346                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10347                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10348                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10349                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10350                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10351                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10352                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10353                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10354                 </fields>
10355                 <links>
10356                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10357                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10358                 </links>
10359                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10360                         <actions>
10361                                 <retrieve/>
10362                         </actions>
10363                 </permacrud>
10364         </class>
10365
10366         <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">
10367                 <oils_persist:source_definition>
10368             SELECT
10369                 ac.id,
10370                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10371                 MAX(actac.xact_start) AS last_circ
10372             FROM asset.copy ac
10373                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10374             GROUP BY ac.id
10375
10376             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10377             --SELECT
10378             --    ac.id,
10379             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10380             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10381             --FROM asset.copy ac
10382             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10383             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10384             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10385                 </oils_persist:source_definition>
10386                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10387                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10388                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10389                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10390                 </fields>
10391                 <links>
10392                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10393                 </links>
10394                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10395                         <actions>
10396                                 <retrieve/>
10397                         </actions>
10398                 </permacrud>
10399         </class>
10400
10401         <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">
10402                 <fields oils_persist:primary="id">
10403                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10404                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10405                 </fields>
10406                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10407                         <actions>
10408                                 <retrieve/>
10409                         </actions>
10410                 </permacrud>
10411         </class>
10412
10413         <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">
10414                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10415                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10416                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10417                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10418                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10419                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10420                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10421                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10422                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10423                 </fields>
10424                 <links>
10425                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10426                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10427                 </links>
10428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10429                         <actions>
10430                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10431                                 <retrieve/>
10432                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10433                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10434                         </actions>
10435                 </permacrud>
10436         </class>
10437
10438         <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">
10439                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10440                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10441                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10442                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10443                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10444                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10445                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10446                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10447                 </fields>
10448                 <links>
10449                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10450                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10451                 </links>
10452                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10453                         <actions>
10454                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10455                                 <retrieve/>
10456                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10457                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10458                         </actions>
10459                 </permacrud>
10460         </class>
10461
10462
10463         <!-- ********************************************************************************************************************* -->
10464         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10465         <!-- ********************************************************************************************************************* -->
10466         <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">
10467                 <fields oils_persist:primary="id">
10468                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10469                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10470                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10471                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10472                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10473                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10474                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10475                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10476                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10477                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10478                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10479                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10480                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10481                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10482                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10483                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10484                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10485                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10486                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10487                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10488                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10489                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10490                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10491                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10492                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10493                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10494                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10495                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10496                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10497                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10498                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10499                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10500                 </fields>
10501                 <links>
10502                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10503                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10504                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10505                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10506                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10507                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10508                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10509                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10510                 </links>
10511         </class>
10512
10513         <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">
10514                 <fields oils_persist:primary="id">
10515                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10516                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10517                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10518                 </fields>
10519                 <links>
10520                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10521                 </links>
10522         </class>
10523
10524         <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">
10525                 <fields oils_persist:primary="id">
10526                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10527                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10528                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10529                 </fields>
10530                 <links>
10531                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10532                 </links>
10533         </class>
10534
10535         <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">
10536                 <fields oils_persist:primary="id">
10537                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10538
10539                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10540                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10541                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10542
10543                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10544                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10545                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10546
10547                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10548                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10549
10550                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10551                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10552                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10553
10554                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10555                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10556
10557                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10558                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10559                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10560
10561                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10562                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10563                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10564
10565                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10566                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
10567                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
10568                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
10569
10570                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
10571                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
10572
10573                 </fields>
10574                 <links>
10575                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
10576                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10577                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
10578                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
10579                 </links>
10580         </class>
10581
10582         <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">
10583                 <oils_persist:source_definition>
10584
10585             SELECT
10586                 po.ordering_agency AS ordering_agency,
10587                 po.id AS purchase_order,
10588                 li.id AS lineitem,
10589                 lid.id AS lineitem_detail,
10590                 cpa.id AS claim_policy_action
10591             FROM
10592                 acq.lineitem_detail lid
10593                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
10594                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
10595                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
10596                 JOIN acq.claim_policy_action cpa ON (
10597                     cpa.claim_policy = cp.id
10598
10599                     -- we only care about claim policy actions whose claim
10600                     -- interval we'd reached or exceeded
10601                     AND (NOW() - cpa.action_interval) &gt; po.order_date
10602
10603                     -- filter out all claim policy actions where claim events
10604                     -- have occurred on or after the action's action_interval
10605                     AND NOT EXISTS (
10606                         SELECT 1
10607                         FROM
10608                             acq.claim_event evt
10609                             JOIN acq.claim claim ON (
10610                                 claim.id = evt.claim
10611                                 AND claim.lineitem_detail = lid.id
10612                             )
10613                         WHERE
10614                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
10615                     )
10616                 )
10617             WHERE
10618                 lid.cancel_reason IS NULL
10619                 AND li.cancel_reason IS NULL -- belt/suspenders
10620                 AND po.cancel_reason IS NULL -- belt/suspenders
10621                 AND lid.recv_time IS NULL
10622                 AND po.state = 'on-order'
10623             ORDER BY 1, 2, 3, 4, 5
10624
10625                 </oils_persist:source_definition>
10626                 <fields>
10627                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10628                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10629                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10630                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
10631                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
10632                 </fields>
10633                 <links>
10634                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10635                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10636                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10637                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
10638                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
10639                 </links>
10640         </class>
10641         <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">
10642                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10643                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10644                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10645                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10646                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10647                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10648                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10649                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10650                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10651                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10652                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10653                 </fields>
10654                 <links>
10655                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10656                 </links>
10657     </class>
10658         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
10659                 <oils_persist:source_definition>
10660             SELECT * FROM acq.lineitem_summary 
10661                                 WHERE item_count > (invoice_count + cancel_count)
10662         </oils_persist:source_definition>
10663                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10664                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10665                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10666                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10667                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10668                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10669                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10670                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10671                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10672                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10673                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10674                 </fields>
10675                 <links>
10676                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10677                 </links>
10678     </class>
10679         <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">
10680                 <oils_persist:source_definition>
10681
10682                         SELECT  t.*
10683                           FROM  action.transit_copy t
10684                                 JOIN actor.org_unit AS s ON (t.source = s.id)
10685                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
10686                           WHERE s.parent_ou &lt;&gt; d.parent_ou
10687
10688                 </oils_persist:source_definition>
10689                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
10690                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
10691                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
10692                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
10693                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
10694                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
10695                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
10696                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
10697                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
10698                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
10699                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
10700                 </fields>
10701                 <links>
10702                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
10703                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
10704                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
10705                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
10706                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10707                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
10708                 </links>
10709         </class>
10710
10711     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
10712                 <oils_persist:source_definition>
10713
10714         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
10715                 SELECT
10716                         cp.id as copy,
10717                         COUNT(circ.id),
10718                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10719                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10720                 FROM
10721                         asset.copy cp
10722                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
10723                 GROUP BY 1, 3, 4
10724                 UNION ALL
10725                 SELECT
10726                         cp.id as copy,
10727                         COUNT(circ.id),
10728                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10729                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10730                 FROM
10731                         asset.copy cp
10732                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
10733                 GROUP BY 1, 3, 4
10734                 UNION ALL
10735                 SELECT
10736                         id as copy,
10737                         circ_count,
10738                         -1 AS year,
10739                         false as is_renewal
10740                 FROM
10741                         extend_reporter.legacy_circ_count
10742         )x GROUP BY 1, 3, 4
10743
10744                 </oils_persist:source_definition>
10745         <fields>
10746             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
10747             <field reporter:label="Count" name="count" reporter:datatype="int"/>
10748             <field reporter:label="Year" name="year" reporter:datatype="int"/>
10749             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
10750         </fields>
10751                 <links>
10752                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
10753                 </links>
10754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10755                         <actions>
10756                                 <retrieve/>
10757                         </actions>
10758                 </permacrud>
10759     </class>
10760
10761         <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">
10762                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
10763                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
10764                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
10765                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
10766                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
10767                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
10768                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
10769                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
10770                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
10771                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
10772                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
10773                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
10774                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
10775                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
10776                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
10777                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
10778                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
10779                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
10780                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
10781                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
10782                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
10783                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
10784                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
10785                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
10786                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
10787                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
10788                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
10789                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
10790                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
10791                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
10792                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
10793                 </fields>
10794                 <links>
10795                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
10796                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
10797                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
10798                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10799                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
10800                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10801                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10802                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
10803                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
10804                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
10805                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
10806                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
10807                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
10808                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
10809                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
10810                 </links>
10811         </class>
10812
10813     <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">
10814         <fields oils_persist:primary="id">
10815             <field reporter:label="Title" name="title" reporter:datatype="text"/>
10816             <field reporter:label="Author" name="author" reporter:datatype="text"/>
10817             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
10818             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
10819             <field reporter:label="Price" name="price" reporter:datatype="money"/>
10820             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10821             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
10822             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
10823             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10824             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
10825             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10826             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
10827             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="text"/>
10828             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="text"/>
10829             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10830             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10831             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
10832             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
10833             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
10834             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
10835             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
10836             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
10837             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10838             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
10839             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
10840             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
10841             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
10842             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
10843             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
10844             <field reporter:label="Status" name="status" reporter:datatype="link"/>
10845             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
10846             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
10847             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
10848             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
10849         </fields>
10850         <links>
10851             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10852             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10853             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10854             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
10855             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
10856         </links>
10857     </class>
10858
10859     <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">
10860         <fields oils_persist:primary="id">
10861             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10862             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10863             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10864             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10865         </fields>
10866         <links>
10867             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10868             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10869         </links>
10870     </class>
10871
10872     <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">
10873         <fields oils_persist:primary="owning_lib">
10874             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10875             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10876             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10877         </fields>
10878         <links>
10879             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10880         </links>
10881     </class>
10882
10883     <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">
10884         <fields oils_persist:primary="id">
10885             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10886             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10887             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10888             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10889             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10890         </fields>
10891         <links>
10892             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10893             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10894             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10895         </links>
10896     </class>
10897
10898     <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">
10899         <fields oils_persist:primary="circ_lib">
10900             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10901             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10902             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10903             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10904         </fields>
10905         <links>
10906             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10907             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10908         </links>
10909     </class>
10910
10911     <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">
10912         <fields oils_persist:primary="id">
10913             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10914             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10915             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10916             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10917             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10918         </fields>
10919         <links>
10920             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10921             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10922             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10923         </links>
10924     </class>
10925
10926     <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">
10927         <fields oils_persist:primary="home_ou">
10928             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10929             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10930             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10931             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10932         </fields>
10933         <links>
10934             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10935             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10936         </links>
10937     </class>
10938         <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">
10939                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
10940                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
10941                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
10942                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
10943                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10944                 </fields>
10945                 <links>
10946                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10947                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
10948                 </links>
10949                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10950                         <actions>
10951                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10952                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
10953                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10954                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10955                         </actions>
10956                 </permacrud>
10957         </class>
10958         <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">
10959                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
10960                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
10961                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10962                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
10963                 </fields>
10964                 <links>
10965                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10966                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
10967                         </links>
10968                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10969                 <actions>
10970                                 <create permission="ADMIN_ACQ_FUND_TAG">
10971                                         <context link="tag" field="owner"/>
10972                                 </create>
10973                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10974                                         <context link="tag" field="owner"/>
10975                                 </retrieve>
10976                                 <update permission="ADMIN_ACQ_FUND_TAG">
10977                                         <context link="tag" field="owner"/>
10978                                 </update>
10979                                 <delete permission="ADMIN_ACQ_FUND_TAG">
10980                                         <context link="tag" field="owner"/>
10981                                 </delete>
10982                         </actions>
10983                 </permacrud>
10984         </class>
10985         <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">
10986                 <oils_persist:source_definition><![CDATA[
10987                 SELECT
10988                         poi.purchase_order AS purchase_order,
10989                         ii.invoice AS invoice,
10990                         NULL AS lineitem,
10991                         poi.id AS po_item,
10992                         NULL AS picklist
10993                 FROM
10994                         acq.po_item poi
10995                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
10996                 UNION SELECT
10997                         jub.purchase_order AS purchase_order,
10998                         ie.invoice AS invoice,
10999                         jub.id AS lineitem,
11000                         NULL AS po_item,
11001                         jub.picklist AS picklist
11002                 FROM
11003                         acq.lineitem jub
11004                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11005                 UNION SELECT
11006                         ii.purchase_order AS purchase_order,
11007                         ii.invoice AS invoice,
11008                         NULL AS lineitem,
11009                         NULL AS po_item,
11010                         NULL AS picklist
11011                 FROM
11012                         acq.invoice_item ii
11013                 WHERE ii.po_item IS NULL
11014                 UNION SELECT
11015                         ie.purchase_order AS purchase_order,
11016                         ie.invoice AS invoice,
11017                         NULL AS lineitem,
11018                         NULL AS po_item,
11019                         NULL AS picklist
11020                 FROM
11021                         acq.invoice_entry ie
11022                 WHERE ie.lineitem IS NULL
11023                 UNION SELECT
11024                         NULL AS purchase_order,
11025                         NULL AS invoice,
11026                         jub.id AS lineitem,
11027                         NULL AS po_item,
11028                         jub.picklist AS picklist
11029                 FROM
11030                         acq.lineitem jub
11031                 WHERE jub.purchase_order IS NULL
11032                 ]]></oils_persist:source_definition>
11033                 <fields>
11034                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11035                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11036                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11037                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11038                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11039                 </fields>
11040                 <links>
11041                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11042                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11043                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11044                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11045                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11046                 </links>
11047         </class>
11048         <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">
11049                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11050                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11051                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11052                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11053                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11054                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11055                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11056                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11057                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11058                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11059                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11060                 </fields>
11061                 <links>
11062                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11063                 </links>
11064                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11065                         <actions>
11066                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11067                                 <retrieve/>
11068                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11069                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11070                         </actions>
11071                 </permacrud>
11072         </class>
11073
11074         <class id="coustl" controller="open-ils.cstore open-ils.pcrud" 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">
11075                 <fields oils_persist:primary="date_applied" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11076                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11077                         <field name="date_applied" reporter:datatype="timestamp"/>
11078                         <field name="org" reporter:datatype="org_unit"/>
11079                         <field name="original_value" reporter:datatype="text"/>
11080                         <field name="new_value" reporter:datatype="text"/>
11081                         <field name="field_name" reporter:datatype="link"/>
11082                 </fields>
11083                 <links>
11084                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11085                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11086                 </links>
11087                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11088                         <actions>
11089                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11090                                 <retrieve/>
11091                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11092                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11093                         </actions>
11094                 </permacrud>
11095         </class>
11096         <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">
11097                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11098                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11099                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11100                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11101                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11102                 </fields>
11103                 <links>
11104                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11105                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11106                 </links>
11107         </class>
11108         <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">
11109                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11110                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11111                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11112                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11113                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11114                 </fields>
11115                 <links>
11116                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11117                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11118                 </links>
11119         </class>
11120         <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">
11121                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11122                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11123                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11124                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11125                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11126                 </fields>
11127                 <links>
11128                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11129                 </links>
11130                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11131                         <actions>
11132                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11133                                 <retrieve/>
11134                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11135                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11136                         </actions>
11137                 </permacrud>
11138         </class>
11139         <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">
11140                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11141                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11142                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11143                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11144                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11145                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11146                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11147                 </fields>
11148                 <links>
11149                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11150                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
11151                 </links>
11152                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11153                         <actions>
11154                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11155                                 <retrieve/>
11156                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11157                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11158                         </actions>
11159                 </permacrud>
11160         </class>
11161
11162         <!-- ********************************************************************************************************************* -->
11163
11164 </IDL>
11165
11166 <!--
11167     vim:noet:ts=4:sw=4:
11168 -->