]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1410369: Schema and supporting IDL entries
[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" oils_persist:i18n="true"/>
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                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
606                 </fields>
607                 <links>
608                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
609                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
610                 </links>
611                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
612                         <actions>
613                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
614                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
615                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
616                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
617                         </actions>
618                 </permacrud>
619         </class>
620
621         <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">
622                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
623                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
624                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
625                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
626                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
627                 </fields>
628                 <links>
629                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
630                 </links>
631                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
632                         <actions>
633                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
634                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
635                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
636                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
637                         </actions>
638                 </permacrud>
639         </class>
640
641         <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">
642                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
643                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
644                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
645                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
646                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
647                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
648                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
649                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
650             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
651                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
652                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
653                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
654                 </fields>
655                 <links>
656                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
657                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
658                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
659                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
660                 </links>
661                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
662                         <actions>
663                                 <create permission="ADMIN_IMPORT_MATCH_SET">
664                     <context link="match_set" field="owner"/>
665                                 </create>
666                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
667                     <context link="match_set" field="owner"/>
668                                 </retrieve>
669                                 <update permission="ADMIN_IMPORT_MATCH_SET">
670                     <context link="match_set" field="owner"/>
671                                 </update>
672                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
673                     <context link="match_set" field="owner"/>
674                                 </delete>
675                         </actions>
676                 </permacrud>
677         </class>
678
679         <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">
680                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
681                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
682                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
683                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
684                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
685                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
686                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
687                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
688                 </fields>
689                 <links>
690                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
691                 </links>
692                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
693                         <actions>
694                                 <create permission="ADMIN_IMPORT_MATCH_SET">
695                     <context link="match_set" field="owner"/>
696                                 </create>
697                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
698                     <context link="match_set" field="owner"/>
699                                 </retrieve>
700                                 <update permission="ADMIN_IMPORT_MATCH_SET">
701                     <context link="match_set" field="owner"/>
702                                 </update>
703                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
704                     <context link="match_set" field="owner"/>
705                                 </delete>
706                         </actions>
707                 </permacrud>
708         </class>
709
710         <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">
711                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
712                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
713                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
714                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
715                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
716                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
717                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
718                 </fields>
719                 <links>
720                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
721                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
722                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
723                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
724                 </links>
725         </class>
726
727     <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">
728         <fields oils_persist:primary="name">
729             <field reporter:label="Name" name="name" reporter:datatype="text"/>
730             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
731             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
732             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
733         </fields>
734         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
735             <actions>
736                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
737                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
738                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
739                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
740             </actions>
741         </permacrud>
742     </class>
743
744     <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">
745         <fields oils_persist:primary="id">
746             <field reporter:label="ID" name="id" reporter:datatype="id"/>
747             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
748             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
749             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
750             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
751         </fields>
752         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
753             <actions>
754                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
755                 <retrieve/>
756                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
757                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
758             </actions>
759         </permacrud>
760     </class>
761
762         <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">
763                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
764                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
765                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
766                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
767                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
768                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
769                 </fields>
770                 <links>
771                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
772                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
773                 </links>
774         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
775             <actions>
776                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
777                 <retrieve/>
778                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
779                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
780             </actions>
781         </permacrud>
782         </class>
783
784         <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">
785                 <fields oils_persist:primary="name">
786                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
787                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true"/>
788                         <field reporter:label="Description" name="description" reporter:datatype="text" />
789                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
790                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
791                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
792                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
793                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
794                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
795                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
796                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
797                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
798                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
799                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
800                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
801                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
802                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
803                 </fields>
804                 <links>
805                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
806                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
807                 </links>
808         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
809             <actions>
810                 <create permission="ADMIN_SVF" global_required="true"/>
811                 <retrieve/>
812                 <update permission="ADMIN_SVF" global_required="true"/>
813                 <delete permission="ADMIN_SVF" global_required="true"/>
814             </actions>
815         </permacrud>
816         </class>
817
818         <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">
819                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
820                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
821                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
822                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
823             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
824                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
825                 </fields>
826                 <links/>
827         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
828             <actions>
829                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
830                 <retrieve/>
831                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
832                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
833             </actions>
834         </permacrud>
835         </class>
836
837         <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">
838                 <fields oils_persist:primary="coded_value">
839                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
840                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
841                 </fields>
842                 <links>
843                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
844                 </links>
845         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
846             <actions>
847                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
848                 <retrieve/>
849                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
850                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
851             </actions>
852         </permacrud>
853         </class>
854
855         <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">
856                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
857                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
858                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
859                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
860                 </fields>
861                 <links>
862                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
863                 </links>
864         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
865             <actions>
866                 <retrieve/>
867             </actions>
868         </permacrud>
869         </class>
870
871
872         <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">
873                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
874                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
875                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
876                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
877                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
878                 </fields>
879                 <links>
880                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
881                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
882                 </links>
883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
884             <actions>
885                 <retrieve/>
886             </actions>
887         </permacrud>
888         </class>
889
890
891         <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">
892                 <fields oils_persist:primary="source">
893                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
894                         <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 -->
895                 </fields>
896                 <links>
897                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
898                 </links>
899         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
900             <actions>
901                 <retrieve/>
902             </actions>
903         </permacrud>
904         </class>
905
906         <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">
907                 <fields>
908                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
909                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
910                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
911                 </fields>
912                 <links>
913                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
914                 </links>
915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
916             <actions>
917                 <retrieve/>
918             </actions>
919         </permacrud>
920         </class>
921
922         <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">
923                 <fields oils_persist:primary="id">
924                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
925                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
926                 </fields>
927                 <links>
928                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
929                 </links>
930         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
931             <actions>
932                 <retrieve/>
933             </actions>
934         </permacrud>
935         </class>
936
937         <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">
938                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
939                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
940                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
941                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
942                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
943                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
944                 </fields>
945                 <links>
946                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
947                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
948                 </links>
949         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
950             <actions>
951                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
952                 <retrieve/>
953                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
954                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
955             </actions>
956         </permacrud>
957         </class>
958
959         <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">
960                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
961                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
962                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
963                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
964                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
965                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
966                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
967                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
968             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
969             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
970                 </fields>
971                 <links>
972                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
973                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
974                 </links>
975         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
976             <actions>
977                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
978                 <retrieve/>
979                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
980                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
981             </actions>
982         </permacrud>
983         </class>
984
985         <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">
986                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
987                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
988                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
989                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
990                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
991                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
992                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
993                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
994                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
995                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
996                 </fields>
997                 <links>
998                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
999                 </links>
1000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1001             <actions>
1002                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1003                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1004                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1005                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1006             </actions>
1007         </permacrud>
1008         </class>
1009
1010     <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">
1011         <fields oils_persist:primary="name">
1012             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1013             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1014             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1015             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1016             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1017             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1018             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1019             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1020             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1021             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1022         </fields>
1023         <links>
1024             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1025             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1026         </links>
1027         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1028             <actions>
1029                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1030                 <retrieve/>
1031                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1032                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1033             </actions>
1034         </permacrud>
1035     </class>
1036
1037     <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">
1038         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1039             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1040             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1041             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1042             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1043             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1044             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1045             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1046         </fields>
1047         <links>
1048             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1049         </links>
1050         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1051             <actions>
1052                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1053                 <retrieve/>
1054                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1055                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1056             </actions>
1057         </permacrud>
1058     </class>
1059
1060     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1061                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1062                         oils_persist:tablename="config.z3950_index_field_map" 
1063                         reporter:label="Z39.50 Index Field Map">
1064         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1065             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1066             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1067             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1068             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1069             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1070             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1071         </fields>
1072         <links>
1073             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1074             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1075             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1076         </links>
1077         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1078             <actions>
1079                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1080                 <retrieve/>
1081                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1082                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1083             </actions>
1084         </permacrud>
1085     </class>
1086
1087
1088         <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">
1089                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1090                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1091                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1092                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1093                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1094                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1095                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1096                 </fields>
1097                 <links>
1098             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1099             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1100                 </links>
1101                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1102                         <actions>
1103                                 <retrieve/>
1104                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1105                         </actions>
1106                 </permacrud>
1107         </class>
1108
1109         <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">
1110                 <fields oils_persist:primary="key">
1111                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1112                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1113                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1114                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1115                 </fields>
1116                 <links/>
1117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1118                         <actions>
1119                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1120                                 <retrieve/>
1121                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1122                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1123                         </actions>
1124                 </permacrud>
1125         </class>
1126
1127         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1128                 <fields oils_persist:primary="module">
1129                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1130                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1131                 </fields>
1132                 <links/>
1133         </class>
1134
1135         <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">
1136                 <fields oils_persist:primary="module">
1137                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1138                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1139                 </fields>
1140                 <links/>
1141                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1142                         <actions>
1143                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1144                                 <retrieve/>
1145                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1146                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1147                         </actions>
1148                 </permacrud>
1149         </class>
1150
1151         <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">
1152                 <fields oils_persist:primary="module">
1153                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1154                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1155                 </fields>
1156                 <links/>
1157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1158                         <actions>
1159                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1160                                 <retrieve/>
1161                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1162                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1163                         </actions>
1164                 </permacrud>
1165         </class>
1166
1167         <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">
1168                 <fields oils_persist:primary="module">
1169                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1170                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1171                 </fields>
1172                 <links/>
1173                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1174                         <actions>
1175                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1176                                 <retrieve/>
1177                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1178                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1179                         </actions>
1180                 </permacrud>
1181         </class>
1182
1183         <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">
1184                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1185                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1186                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1187                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1188                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1189                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1190                 </fields>
1191                 <links>
1192                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1193                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1194                 </links>
1195                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1196                         <actions>
1197                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1198                     <context link="event_def" field="owner"/>
1199                 </create>
1200                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1201                     <context link="event_def" field="owner"/>
1202                 </retrieve>
1203                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1204                     <context link="event_def" field="owner"/>
1205                 </update>
1206                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1207                     <context link="event_def" field="owner"/>
1208                 </delete>
1209                         </actions>
1210                 </permacrud>
1211         </class>
1212
1213         <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">
1214                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1215                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1216                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1217                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1218                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1219                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1220                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1221                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1222                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1223                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1224                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1225                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1226                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1227                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1228                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1229                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1230                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1231                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1232                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1233                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1234                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1235                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1236                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1237                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1238                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1239                 </fields>
1240                 <links>
1241                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1242                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1243                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1244                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1245                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1246                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1247                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1248                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1249                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1250                 </links>
1251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1252                         <actions>
1253                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1254                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1255                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1256                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1257                         </actions>
1258                 </permacrud>
1259         </class>
1260
1261         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1262                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1263                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1264                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1265                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1266                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1267                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1268                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1269                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1270                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1271                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1272                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1273                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1274                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1275                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1276                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1277                 </fields>
1278                 <links>
1279                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1280                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1281                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1282                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1283                 </links>
1284         </class>
1285
1286         <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">
1287                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1288                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1289                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1290                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1291                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1292                 </fields>
1293                 <links>
1294                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1295                 </links>
1296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1297                         <actions>
1298                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1299                     <context link="event_def" field="owner"/>
1300                 </create>
1301                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1302                     <context link="event_def" field="owner"/>
1303                 </retrieve>
1304                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1305                     <context link="event_def" field="owner"/>
1306                 </update>
1307                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1308                     <context link="event_def" field="owner"/>
1309                 </delete>
1310                         </actions>
1311                 </permacrud>
1312         </class>
1313
1314         <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">
1315                 <oils_persist:source_definition><![CDATA[
1316                 SELECT  atevdef.hook,
1317                         atevdef.name,
1318                         atevdef.reactor,
1319                         atev.id,
1320                         atev.event_def,
1321                         atev.add_time,
1322                         atev.run_time,
1323                         atev.start_time,
1324                         atev.update_time,
1325                         atev.complete_time,
1326                         atev.update_process,
1327                         atev.state,
1328                         atev.user_data,
1329                         atev.template_output,
1330                         atev.error_output,
1331                         atev.async_output,
1332                         targ_circ.id AS target_circ,
1333                         targ_ahr.id AS target_hold,
1334                         COALESCE(
1335                                 targ_circ.circ_lib,
1336                                 targ_ahr.pickup_lib
1337                         ) AS perm_lib
1338                 FROM action_trigger.event atev
1339                 JOIN action_trigger.event_definition atevdef ON
1340                         (atevdef.id = atev.event_def)
1341                 JOIN action_trigger.hook ath ON
1342                         (ath.key = atevdef.hook)
1343                 LEFT JOIN action.circulation targ_circ ON
1344                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1345                 LEFT JOIN action.hold_request targ_ahr ON
1346                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1347                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1348                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1349                                 'circ.staff.max_visible_event_age',
1350                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1351                         ) UNION
1352                         SELECT '1000 YEARS'::INTERVAL AS value
1353                 ) ous)
1354                 ]]></oils_persist:source_definition>
1355                 <fields oils_persist:primary="id">
1356                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1357                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1358                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1359                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1360                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1361                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1362                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1363                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1364                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1365                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1366                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1367                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1368                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1369                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1370                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1371                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1372                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1373                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1374                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1375                 </fields>
1376                 <links>
1377                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1378                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1379                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1380                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1381                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1382                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1383                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1384                 </links>
1385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1386                         <actions>
1387                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1388                         </actions>
1389                 </permacrud>
1390         </class>
1391
1392         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1393                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1394                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1395                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1396                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1397                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1398                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1399                 </fields>
1400                 <links>
1401                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1402                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1403                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1404                 </links>
1405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1406                         <actions>
1407                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1408                         </actions>
1409                 </permacrud>
1410         </class>
1411
1412         <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">
1413                 <fields oils_persist:primary="code">
1414                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1415                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1416                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1417                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1418                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1419                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1420                 </fields>
1421                 <links/>
1422         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1423             <actions>
1424                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1425                 <retrieve/>
1426                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1427                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1428             </actions>
1429         </permacrud>
1430         </class>
1431
1432         <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">
1433                 <fields oils_persist:primary="code">
1434                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1435                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1436                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1437                 </fields>
1438                 <links/>
1439         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1440             <actions>
1441                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1442                 <retrieve/>
1443                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1444                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1445             </actions>
1446         </permacrud>
1447         </class>
1448
1449         <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">
1450                 <fields oils_persist:primary="code">
1451                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1452                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1453                 </fields>
1454                 <links/>
1455         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1456             <actions>
1457                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1458                 <retrieve/>
1459                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1460                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1461             </actions>
1462         </permacrud>
1463         </class>
1464
1465         <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">
1466                 <fields oils_persist:primary="code">
1467                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1468                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1469                 </fields>
1470                 <links/>
1471         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1472             <actions>
1473                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1474                 <retrieve/>
1475                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1476                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1477             </actions>
1478         </permacrud>
1479         </class>
1480
1481         <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">
1482                 <fields oils_persist:primary="code">
1483                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1484                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1485                 </fields>
1486                 <links/>
1487         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1488             <actions>
1489                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1490                 <retrieve/>
1491                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1492                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1493             </actions>
1494         </permacrud>
1495         </class>
1496
1497         <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">
1498                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1499                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1500                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1501                 </fields>
1502                 <links/>
1503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1504             <actions>
1505                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1506                 <retrieve/>
1507                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1508                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1509             </actions>
1510         </permacrud>
1511         </class>
1512
1513         <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">
1514                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1515                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1516                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1517                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1518                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1519                 </fields>
1520         <links>
1521             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1522             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1523             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1524         </links>
1525         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1526             <actions>
1527                 <create permission="UPDATE_COPY">
1528                     <context link="target_copy" field="circ_lib"/>
1529                 </create>
1530                 <retrieve/>
1531                 <update permission="UPDATE_COPY">
1532                     <context link="target_copy" field="circ_lib"/>
1533                 </update>
1534                 <delete permission="UPDATE_COPY">
1535                     <context link="target_copy" field="circ_lib"/>
1536                 </delete>
1537             </actions>
1538         </permacrud>
1539         </class>
1540
1541         <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">
1542                 <fields oils_persist:primary="code">
1543                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1544                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1545                 </fields>
1546                 <links/>
1547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1548             <actions>
1549                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1550                 <retrieve/>
1551                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1552                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1553             </actions>
1554         </permacrud>
1555         </class>
1556
1557         <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">
1558                 <fields oils_persist:primary="code">
1559                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1560                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1561                 </fields>
1562                 <links/>
1563         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1564             <actions>
1565                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1566                 <retrieve/>
1567                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1568                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1569             </actions>
1570         </permacrud>
1571         </class>
1572
1573         <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">
1574                 <fields oils_persist:primary="code">
1575                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1576                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1577                 </fields>
1578                 <links/>
1579         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1580             <actions>
1581                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1582                 <retrieve/>
1583                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1584                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1585             </actions>
1586         </permacrud>
1587         </class>
1588
1589     <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">
1590         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1591             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1592             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1593             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1594             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1595             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1596             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1597             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1598             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1599             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1600             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1601             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1602             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1603             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1604             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1605             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1606             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1607             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1608         </fields>
1609         <links/>
1610         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1611             <actions>
1612                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1613                 <retrieve/>
1614                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1615                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1616             </actions>
1617         </permacrud>
1618     </class>
1619
1620     <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">
1621         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1622             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1623             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1624             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1625             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1626             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1627             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1628             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1629             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1630             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1631             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1632             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1633             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1634             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1635             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1636             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1637             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1638             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1639             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1640             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1641         </fields>
1642         <links/>
1643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1644             <actions>
1645                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1646                 <retrieve/>
1647                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1648                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1649             </actions>
1650         </permacrud>
1651     </class>
1652
1653     <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">
1654         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1655             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1656             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1657             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1658             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1659             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1660         </fields>
1661         <links>
1662             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1663             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1664             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1665         </links>
1666         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1667             <actions>
1668                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1669                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1670                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1671                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1672             </actions>
1673         </permacrud>
1674     </class>
1675
1676         <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">
1677                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1678                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1679                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1680                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1681                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1682                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1683                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1684                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1685                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1686                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1687                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1688                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1689                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1690                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1691                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1692                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1693                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1694             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1695                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1696                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1697                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1698                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1699                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1700                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1701                 </fields>
1702                 <links>
1703                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1704                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1705                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1706                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1707                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1708                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1709                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1710                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1711                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1712                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1713                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1714                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1715                         <link field="age_hold_protect_rule" reltype="might_have" key="id" map="" class="crahp"/>
1716             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1717                 </links>
1718         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1719             <actions>
1720                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1721                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1722                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1723                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1724             </actions>
1725         </permacrud>
1726         </class>
1727
1728         <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">
1729                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1730                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1731                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1732                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1733                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1734                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1735                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1736                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1737                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1738                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1739                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1740                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1741                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1742                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1743                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1744                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1745             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1746                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1747                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1748             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1749                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1750                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1751                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1752                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1753             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1754             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1755             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1756                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1757                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1758                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1759                 </fields>
1760                 <links>
1761                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1762                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1763                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1764                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1765                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1766                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1767                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1768                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1769                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1770                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1771                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1772                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1773                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1774                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1775             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1776                 </links>
1777         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1778             <actions>
1779                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1780                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1781                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1782                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1783             </actions>
1784         </permacrud>
1785         </class>
1786
1787     <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">
1788         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1789             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1790             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1791             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1792         </fields>
1793         <links/>
1794         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1795             <actions>
1796                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1797                 <retrieve/>
1798                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1799                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1800             </actions>
1801         </permacrud>
1802     </class>
1803
1804     <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">
1805         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1806             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1807             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1808             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1809             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1810             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1811             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1812             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1813         </fields>
1814         <links>
1815             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1816         </links>
1817         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1818             <actions>
1819                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1820                 <retrieve/>
1821                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1822                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1823             </actions>
1824         </permacrud>
1825     </class>
1826
1827     <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">
1828         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
1829             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1830             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
1831             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1832             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
1833             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1834         </fields>
1835         <links>
1836             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
1837             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1838         </links>
1839         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1840             <actions>
1841                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1842                     <context link="matchpoint" field="org_unit"/>
1843                 </create>
1844                 <retrieve/>
1845                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1846                     <context link="matchpoint" field="org_unit"/>
1847                 </update>
1848                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1849                     <context link="matchpoint" field="org_unit"/>
1850                 </delete>
1851             </actions>
1852         </permacrud>
1853     </class>
1854
1855     <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">
1856         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
1857             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1858             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1859             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
1860         </fields>
1861         <links>
1862             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1863             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
1864         </links>
1865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1866             <actions>
1867                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1868                     <context link="limit_set" field="owning_lib"/>
1869                 </create>
1870                 <retrieve/>
1871                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1872                     <context link="limit_set" field="owning_lib"/>
1873                 </update>
1874                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1875                     <context link="limit_set" field="owning_lib"/>
1876                 </delete>
1877             </actions>
1878         </permacrud>
1879     </class>
1880     <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">
1881         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
1882             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1883             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1884             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
1885         </fields>
1886         <links>
1887             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1888             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
1889         </links>
1890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1891             <actions>
1892                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1893                     <context link="limit_set" field="owning_lib"/>
1894                 </create>
1895                 <retrieve/>
1896                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1897                     <context link="limit_set" field="owning_lib"/>
1898                 </update>
1899                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1900                     <context link="limit_set" field="owning_lib"/>
1901                 </delete>
1902             </actions>
1903         </permacrud>
1904     </class>
1905
1906     <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">
1907         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
1908             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1909             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1910             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
1911             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
1912         </fields>
1913         <links>
1914             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1915             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
1916         </links>
1917         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1918             <actions>
1919                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1920                     <context link="limit_set" field="owning_lib"/>
1921                 </create>
1922                 <retrieve/>
1923                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1924                     <context link="limit_set" field="owning_lib"/>
1925                 </update>
1926                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1927                     <context link="limit_set" field="owning_lib"/>
1928                 </delete>
1929             </actions>
1930         </permacrud>
1931     </class>
1932
1933         <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">
1934                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
1935                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1936                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1937                 </fields>
1938                 <links/>
1939         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1940             <actions>
1941                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
1942                 <retrieve/>
1943                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
1944                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
1945             </actions>
1946         </permacrud>
1947         </class>
1948
1949         <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">
1950                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
1951                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
1952                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
1953                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
1954                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
1955                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
1956                 </fields>
1957                 <links>
1958                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
1959                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
1960                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
1961                 </links>
1962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1963             <actions>
1964                 <create permission="ADMIN_SURVEY">
1965                     <context link="survey" field="owner"/>
1966                 </create>
1967                 <retrieve/>
1968                 <update permission="ADMIN_SURVEY">
1969                     <context link="survey" field="owner"/>
1970                 </update>
1971                 <delete permission="ADMIN_SURVEY">
1972                     <context link="survey" field="owner"/>
1973                 </delete>
1974             </actions>
1975         </permacrud>
1976         </class>
1977         <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">
1978                 <fields oils_persist:primary="id" oils_persist:sequence="">
1979                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
1980                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
1981                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
1982                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
1983                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
1984                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
1985                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
1986                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
1987                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
1988                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
1989                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
1990                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
1991                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
1992                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
1993                 </fields>
1994                 <links>
1995                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1996                 </links>
1997                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1998                         <actions>
1999                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2000                                         <context link="usr" field="home_ou" />
2001                                 </retrieve>
2002                         </actions>
2003                 </permacrud>
2004         </class>
2005         <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">
2006                 <fields oils_persist:primary="id" oils_persist:sequence="">
2007                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2008                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2009                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2010                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2011                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2012                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2013                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2014                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2015                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2016                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2017                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2018                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2019                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2020                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2021                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2022                 </fields>
2023                 <links>
2024                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2025                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2026                 </links>
2027         </class>
2028         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2029                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2030                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2031                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2032                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2033                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2034                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2035                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2036                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2037                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2038                 </fields>
2039                 <links>
2040                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2041                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2042                 </links>
2043                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2044                         <actions> <!-- created magically, so no create action -->
2045                                 <retrieve permission="VIEW_USER" context_field="sending_lib" owning_user="usr"/>
2046                                 <update permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2047                                 <delete permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2048                         </actions>
2049                 </permacrud>
2050         </class>
2051         <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">
2052                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2053                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2054                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2055                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2056                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2057                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2058                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2059                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2060                 </fields>
2061                 <links>
2062                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2063                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2064                 </links>
2065         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2066             <actions>
2067                 <create permission="UPDATE_USER" context_field="owner">
2068                     <context link="usr" field="home_ou"/>
2069                 </create>
2070                                 <!-- note: public notes are still accessible via API -->
2071                 <retrieve permission="UPDATE_USER">
2072                     <context link="usr" field="home_ou"/>
2073                                 </retrieve>
2074                 <update permission="UPDATE_USER">
2075                     <context link="usr" field="home_ou"/>
2076                                 </update>
2077                 <delete permission="UPDATE_USER">
2078                     <context link="usr" field="home_ou"/>
2079                                 </delete>
2080             </actions>
2081         </permacrud>
2082         </class>
2083         <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">
2084                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2085                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2086                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2087                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2088                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2089                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2090                 </fields>
2091                 <links>
2092                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2093                 </links>
2094         </class>
2095         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2096                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2097                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2098                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2099                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2100                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2101                 </fields>
2102                 <links>
2103                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2104                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2105                 </links>
2106         </class>
2107         <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">
2108                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2109                         <field name="field" reporter:datatype="link"/>
2110                         <field name="id" reporter:datatype="id" />
2111                         <field name="source" reporter:datatype="link"/>
2112                         <field name="value" reporter:datatype="text"/>
2113                 </fields>
2114                 <links>
2115                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2116                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2117                 </links>
2118         </class>
2119         <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">
2120                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2121                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2122                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2123                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2124                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2125                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2126                 </fields>
2127                 <links>
2128                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2129                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2130                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2131                 </links>
2132         </class>
2133         <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">
2134                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2135                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2136                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2137                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2138                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2139                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2140                 </fields>
2141                 <links>
2142                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2143                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2144                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2145                 </links>
2146         </class>
2147         <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">
2148                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2149                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2150                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2151                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2152                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2153                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2154                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2155                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2156                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2157                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2158                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2159                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2160                 </fields>
2161                 <links>
2162                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2163                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2164                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2165                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2166                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2167                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2168                 </links>
2169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2170             <actions>
2171                 <create permission="TRANSIT_COPY" context_field="owner">
2172                     <context link="target_copy" field="circ_lib"/>
2173                 </create>
2174                 <retrieve/>
2175                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2176                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2177             </actions>
2178         </permacrud>
2179         </class>
2180         <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">
2181                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2182                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2183                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2184                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2185                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2186                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2187                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2188                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2189                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2190                 </fields>
2191                 <links>
2192                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2193                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2194                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2195                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2196                 </links>
2197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2198             <actions>
2199                 <create permission="ADMIN_SURVEY">
2200                     <context link="survey" field="owner"/>
2201                 </create>
2202                 <retrieve/>
2203                 <update permission="ADMIN_SURVEY">
2204                     <context link="survey" field="owner"/>
2205                 </update>
2206                 <delete permission="ADMIN_SURVEY">
2207                     <context link="survey" field="owner"/>
2208                 </delete>
2209             </actions>
2210         </permacrud>
2211         </class>
2212         <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">
2213                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2214                         <field name="bucket" />
2215                         <field name="id" reporter:datatype="id" />
2216                         <field name="target_copy" reporter:datatype="link"/>
2217                         <field name="create_time" reporter:datatype="timestamp" />
2218                         <field name="pos" reporter:datatype="int" />
2219                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2220                 </fields>
2221                 <links>
2222                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2223                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2224             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2225                 </links>
2226         </class>
2227         <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">
2228                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2229                         <field name="id" reporter:datatype="id" />
2230                         <field name="item" reporter:datatype="link"/>
2231                         <field name="note" reporter:datatype="text" />
2232                 </fields>
2233                 <links>
2234                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2235                 </links>
2236         </class>
2237
2238         <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">
2239                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2240                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2241                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2242                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2243                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2244                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2245                 </fields>
2246                 <links>
2247                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2248                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2249                 </links>
2250                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2251                         <actions>
2252                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2253                                 <retrieve/>
2254                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2255                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2256                         </actions>
2257                 </permacrud>
2258         </class>
2259
2260         <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">
2261                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2262                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2263                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2264                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2265                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2266                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2267                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2268                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2269                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2270                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2271                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2272                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2273                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2274                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2275                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2276                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2277                 </fields>
2278                 <links>
2279                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2280                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2281                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2282                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2283                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2284                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2285                 </links>
2286                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2287                         <actions>
2288                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2289                                 <retrieve/>
2290                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2291                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2292                         </actions>
2293                 </permacrud>
2294         </class>
2295
2296         <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">
2297                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2298                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2299                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2300                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2301                 </fields>
2302                 <links>
2303                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2304                 </links>
2305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2306                         <actions>
2307                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2308                                 <retrieve/>
2309                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2310                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2311                         </actions>
2312                 </permacrud>
2313         </class>
2314
2315         <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">
2316                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2317                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2318                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2319                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2320                 </fields>
2321                 <links>
2322                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2323                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2324                 </links>
2325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2326                         <actions>
2327                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2328                                 <retrieve/>
2329                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2330                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2331                         </actions>
2332                 </permacrud>
2333         </class>
2334
2335         <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">
2336                 <fields oils_persist:primary="code">
2337                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2338                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2339                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2340                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2341                 </fields>
2342                 <links>
2343                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2344                 </links>
2345                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2346                         <actions>
2347                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2348                                 <retrieve/>
2349                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2350                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2351                         </actions>
2352                 </permacrud>
2353         </class>
2354
2355         <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">
2356                 <fields oils_persist:primary="code">
2357                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2358                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2359                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2360                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2361                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2362                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2363                 </fields>
2364                 <links>
2365                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2366                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2367                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2368                 </links>
2369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2370                         <actions>
2371                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2372                                 <retrieve/>
2373                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2374                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2375                         </actions>
2376                 </permacrud>
2377         </class>
2378
2379     <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">
2380         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2381             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2382             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2383             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2384         </fields>
2385         <links>
2386             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2387             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2388         </links>
2389         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2390             <actions>
2391                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2392                 <retrieve/>
2393                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2394                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2395             </actions>
2396         </permacrud>
2397     </class>
2398
2399         <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">
2400                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2401                         <field name="active" reporter:datatype="bool"/>
2402                         <field name="create_date" reporter:datatype="timestamp"/>
2403                         <field name="creator" />
2404                         <field name="deleted" reporter:datatype="bool"/>
2405                         <field name="edit_date" reporter:datatype="timestamp"/>
2406                         <field name="editor" />
2407                         <field name="id" reporter:datatype="id" />
2408                         <field name="last_xact_id" />
2409                         <field name="marc" />
2410                         <field name="source" />
2411                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2412                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2413                         <field name="heading" />
2414                         <field name="simple_heading" />
2415                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2416                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2417                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2418                 </fields>
2419                 <links>
2420                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2421                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2422                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2423                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2424                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2425                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2426                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2427                 </links>
2428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2429                         <actions>
2430                                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2431                                 <retrieve/>
2432                                 <update permission="UPDATE_MARC" global_required="true"/>
2433                                 <delete permission="UPDATE_MARC" global_required="true"/>
2434                         </actions>
2435                 </permacrud>
2436         </class>
2437         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2438                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2439                         <field name="char_encoding" />
2440                         <field name="id" />
2441                         <field name="record" />
2442                         <field name="record_status" />
2443                         <field name="thesaurus" />
2444                 </fields>
2445                 <links>
2446                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2447                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2448                 </links>
2449         </class>
2450         <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">
2451                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2452                         <field name="id" reporter:datatype="id" />
2453                         <field name="bib" reporter:datatype="link" />
2454                         <field name="authority" reporter:datatype="link" />
2455                 </fields>
2456                 <links>
2457                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2458                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2459                 </links>
2460         </class>
2461         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2462                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2463                         <field name="id" reporter:datatype="id" />
2464                         <field name="record" reporter:datatype="link" />
2465                         <field name="atag" reporter:datatype="link" />
2466                         <field name="value" reporter:datatype="text" />
2467                 </fields>
2468                 <links>
2469                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2470                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2471                 </links>
2472         </class>
2473         <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">
2474                 <fields oils_persist:primary="code" oils_persist:sequence="">
2475                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2476                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2477                 </fields>
2478                 <links/>
2479         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2480             <actions>
2481                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2482                 <retrieve/>
2483                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2484                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2485             </actions>
2486         </permacrud>
2487         </class>
2488         <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">
2489                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2490                         <field name="accepting_usr" />
2491                         <field name="amount" reporter:datatype="money" />
2492                         <field name="amount_collected" reporter:datatype="money" />
2493                         <field name="approval_code" reporter:datatype="text"/>
2494                         <field name="cash_drawer" reporter:datatype="link"/>
2495                         <field name="cc_first_name" reporter:datatype="text"/>
2496                         <field name="cc_last_name" reporter:datatype="text"/>
2497                         <field name="cc_number" reporter:datatype="text"/>
2498                         <field name="cc_order_number" reporter:datatype="text"/>
2499                         <field name="cc_type" reporter:datatype="text"/>
2500                         <field name="cc_processor" reporter:datatype="text"/>
2501                         <field name="expire_month" reporter:datatype="int" />
2502                         <field name="expire_year" reporter:datatype="int" />
2503                         <field name="id" reporter:datatype="id" />
2504                         <field name="note" reporter:datatype="text"/>
2505                         <field name="payment_ts" reporter:datatype="timestamp"/>
2506                         <field name="xact" reporter:datatype="link"/>
2507                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2508                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2509                 </fields>
2510                 <links>
2511                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2512                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2513                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2514                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2515                 </links>
2516         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2517             <actions>
2518                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2519                     <context link="xact" jump="usr" field="home_ou"/>
2520                 </retrieve>
2521                         </actions>
2522                 </permacrud>
2523         </class>
2524         <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">
2525                 <fields oils_persist:primary="name">
2526                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2527                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2528                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2529                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2530                 </fields>
2531                 <links/>
2532         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2533             <actions>
2534                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2535                 <retrieve/>
2536                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2537                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2538             </actions>
2539         </permacrud>
2540         </class>
2541
2542         <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">
2543                 <fields oils_persist:primary="alias">
2544                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2545                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2546                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2547                 </fields>
2548                 <links>
2549                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2550                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2551                 </links>
2552         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2553             <actions>
2554                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2555                 <retrieve/>
2556                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2557                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2558             </actions>
2559         </permacrud>
2560         </class>
2561
2562         <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">
2563                 <fields oils_persist:primary="name">
2564                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2565                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2566                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2567                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2568                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2569                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2570                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2571                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2572                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2573                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2574                 </fields>
2575                 <links>
2576                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2577                 </links>
2578         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2579             <actions>
2580                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2581                 <retrieve/>
2582                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2583                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2584             </actions>
2585         </permacrud>
2586         </class>
2587
2588         <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">
2589                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2590                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2591                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2592                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2593                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2594                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2595                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2596                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2597                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2598                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2599                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2600                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2601                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2602                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2603                 </fields>
2604                 <links>
2605                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2606                 </links>
2607         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2608             <actions>
2609                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2610                 <retrieve/>
2611                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2612                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2613             </actions>
2614         </permacrud>
2615         </class>
2616         <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">
2617                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2618                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2619                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2620                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2621                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2622                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2623                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2624                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2625                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2626                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2627                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2628                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2629                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2630                 </fields>
2631                 <links>
2632                 </links>
2633                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2634                         <actions>
2635                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2636                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2637                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2638                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2639                         </actions>
2640                 </permacrud>
2641         </class>
2642         <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">
2643                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2644                         <field name="id" reporter:datatype="id" />
2645                         <field name="name" reporter:datatype="text"/>
2646                         <field name="xpath" reporter:datatype="text"/>
2647                         <field name="format" reporter:datatype="link"/>
2648                         <field name="first_word" reporter:datatype="bool" />
2649                 </fields>
2650                 <links/>
2651         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2652             <actions>
2653                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2654                 <retrieve/>
2655                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2656                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2657             </actions>
2658         </permacrud>
2659         </class>
2660         <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">
2661                 <fields oils_persist:primary="code" oils_persist:sequence="">
2662                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2663                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2664                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2665                 </fields>
2666                 <links/>
2667         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2668             <actions>
2669                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2670                 <retrieve/>
2671                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2672                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2673             </actions>
2674         </permacrud>
2675         </class>
2676         <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">
2677                 <fields oils_persist:primary="code" oils_persist:sequence="">
2678                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2679                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2680                 </fields>
2681                 <links/>
2682         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2683             <actions>
2684                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2685                 <retrieve/>
2686                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2687                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2688             </actions>
2689         </permacrud>
2690         </class>
2691     <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">
2692         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2693             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2694             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2695             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2696             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2697         </fields>
2698         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2699             <actions>
2700                 <retrieve/>
2701             </actions>
2702         </permacrud>
2703     </class>
2704         <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">
2705                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2706                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2707                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2708                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2709                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2710                 </fields>
2711                 <links>
2712                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2713                 </links>
2714         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2715             <actions>
2716                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2717                 <retrieve/>
2718                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2719                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2720             </actions>
2721         </permacrud>
2722         </class>
2723         <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">
2724                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2725                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2726                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2727                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2728                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2729                 </fields>
2730                 <links>
2731                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2732                 </links>
2733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2734             <actions>
2735                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2736                 <retrieve/>
2737                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2738                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2739             </actions>
2740         </permacrud>
2741         </class>
2742         <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">
2743                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2744                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2745                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2746                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2747                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2748                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2749                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2750                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2751                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2752                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2753                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2754                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2755                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2756                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2757                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2758                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2759                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2760                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2761                 </fields>
2762                 <links>
2763                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2764                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2765                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2766                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2767                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2768                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2769                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2770                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2771                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2772                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2773                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2774                 </links>
2775         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2776             <actions>
2777                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2778                 <retrieve/>
2779                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2780                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2781             </actions>
2782         </permacrud>
2783         </class>
2784         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2785                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2786                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2787                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2788                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2789                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2790                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2791                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2792                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2793                 </fields>
2794                 <links>
2795                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2796                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
2797         </links>
2798         </class>
2799         <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">
2800                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
2801                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2802                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
2803                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
2804                 </fields>
2805                 <links>
2806                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
2807                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
2808                 </links>
2809         </class>
2810         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
2811                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
2812                         <field name="id" reporter:datatype="id" />
2813                         <field name="value" oils_persist:i18n="true" />
2814                 </fields>
2815                 <links/>
2816         </class>
2817         <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">
2818                 <fields oils_persist:primary="usr" oils_persist:sequence="">
2819                         <field name="balance_owed" reporter:datatype="money" />
2820                         <field name="total_owed" reporter:datatype="money" />
2821                         <field name="total_paid" reporter:datatype="money" />
2822                         <field name="usr" reporter:datatype="link"/>
2823                 </fields>
2824                 <links>
2825                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2826         </links>
2827         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2828             <actions>
2829                 <retrieve permission="VIEW_USER">
2830                     <context link="usr" field="home_ou"/>
2831                 </retrieve>
2832             </actions>
2833         </permacrud>
2834         </class>
2835         <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">
2836                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
2837                         <field name="collector" />
2838                         <field name="enter_time" reporter:datatype="timestamp"/>
2839                         <field name="id" reporter:datatype="id" />
2840                         <field name="location" reporter:datatype="link"/>
2841                         <field name="usr" reporter:datatype="link"/>
2842                 </fields>
2843                 <links>
2844                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2845                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
2846                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
2847                 </links>
2848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2849             <actions>
2850                 <create permission="money.collections_tracker.create" context_field="location"/>
2851                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
2852                 <delete permission="money.collections_tracker.create" context_field="location"/>
2853             </actions>
2854         </permacrud>
2855         </class>
2856         <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">
2857                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
2858                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2859                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2860                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
2861                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2862                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
2863                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
2864                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
2865                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2866                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
2867                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
2868                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
2869                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
2870                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
2871                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
2872                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
2873                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
2874                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2875                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
2876                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
2877                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
2878                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2879                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2880                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2881                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2882                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2883                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2884                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2885                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2886                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
2887                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
2888                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
2889                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
2890                 </fields>
2891                 <links>
2892                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2893                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2894                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2895                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
2896                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
2897                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
2898                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
2899                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
2900                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
2901                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
2902                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
2903                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
2904                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
2905                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
2906                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
2907                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
2908                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
2909                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
2910                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
2911                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
2912                 </links>
2913         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2914             <actions>
2915                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2916                 <retrieve/>
2917                 <update permission="UPDATE_MARC" global_required="true"/>
2918                 <!-- WARNING: Deleting records via PCRUD does NOT check that any prerequisite conditions have been handled first. It is your responsibility to check for those conditions before deleting bib records. -->
2919                 <delete permission="DELETE_RECORD" global_required="true"/>
2920             </actions>
2921         </permacrud>
2922         </class>
2923         <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">
2924                 <fields oils_persist:primary="id">
2925                         <field name="dow_0_close" />
2926                         <field name="dow_0_open" />
2927                         <field name="dow_1_close" />
2928                         <field name="dow_1_open" />
2929                         <field name="dow_2_close" />
2930                         <field name="dow_2_open" />
2931                         <field name="dow_3_close" />
2932                         <field name="dow_3_open" />
2933                         <field name="dow_4_close" />
2934                         <field name="dow_4_open" />
2935                         <field name="dow_5_close" />
2936                         <field name="dow_5_open" />
2937                         <field name="dow_6_close" />
2938                         <field name="dow_6_open" />
2939                         <field name="id" reporter:datatype="id" />
2940                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
2941                 </fields>
2942                 <links>
2943                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
2944                 </links>
2945         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2946             <actions>
2947                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
2948                 <retrieve/>
2949                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
2950                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
2951             </actions>
2952         </permacrud>
2953         </class>
2954         <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">
2955                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
2956                         <field name="id" reporter:datatype="id" />
2957                         <field name="record" reporter:datatype="link"/>
2958                         <field name="label" reporter:datatype="text"/>
2959                         <field name="label_sortkey" reporter:datatype="text"/>
2960                 </fields>
2961                 <links>
2962                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2963                 </links>
2964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2965             <actions>
2966                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
2967                 <retrieve/>
2968                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
2969                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
2970             </actions>
2971         </permacrud>
2972         </class>
2973         <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">
2974                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
2975                         <field name="id" reporter:datatype="id" />
2976                         <field name="target_copy" reporter:datatype="link" />
2977                         <field name="part" reporter:datatype="link"/>
2978                 </fields>
2979                 <links>
2980                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2981                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
2982                 </links>
2983         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2984             <actions>
2985                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
2986                 <retrieve/>
2987                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
2988                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
2989             </actions>
2990         </permacrud>
2991         </class>
2992         <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">
2993                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
2994                         <field name="close_end" reporter:datatype="timestamp" />
2995                         <field name="close_start" reporter:datatype="timestamp" />
2996                         <field name="id" reporter:datatype="id" />
2997                         <field name="org_unit" reporter:datatype="org_unit"/>
2998                         <field name="reason" reporter:datatype="text"/>
2999                 </fields>
3000                 <links>
3001                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3002                 </links>
3003         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3004             <actions>
3005                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3006                 <retrieve/>
3007                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3008                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3009             </actions>
3010         </permacrud>
3011         </class>
3012         <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">
3013                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3014                         <field name="extended" reporter:datatype="interval"/>
3015                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3016                         <field name="max_renewals" reporter:datatype="int" />
3017                         <field name="name" reporter:datatype="text"/>
3018                         <field name="normal" reporter:datatype="interval"/>
3019                         <field name="shrt" reporter:datatype="interval"/>
3020                 </fields>
3021                 <links>
3022                 </links>
3023         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3024             <actions>
3025                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3026                 <retrieve/>
3027                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3028                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3029             </actions>
3030         </permacrud>
3031         </class>
3032
3033         <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">
3034                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3035                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3036                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3037             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3038                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3039             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3040                 </fields>
3041                 <links>
3042             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3043                 </links>
3044                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3045             <actions>
3046                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3047                 <retrieve/>
3048                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3049                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3050             </actions>
3051                 </permacrud>
3052         </class>
3053
3054         <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">
3055                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3056                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3057                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3058                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3059             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3060                 </fields>
3061                 <links>
3062                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3063                 </links>
3064                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3065             <actions>
3066                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3067                 <retrieve/>
3068                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3069                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3070             </actions>
3071                 </permacrud>
3072         </class>
3073
3074         <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">
3075                 <fields oils_persist:primary="id" oils_persist:sequence="">
3076                         <field name="balance_owed" reporter:datatype="money"/>
3077                         <field name="id" reporter:datatype="id" />
3078                         <field name="last_billing_note" reporter:datatype="text"/>
3079                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3080                         <field name="last_billing_type" reporter:datatype="text"/>
3081                         <field name="last_payment_note" reporter:datatype="text"/>
3082                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3083                         <field name="last_payment_type" reporter:datatype="text"/>
3084                         <field name="total_owed" reporter:datatype="money"/>
3085                         <field name="total_paid" reporter:datatype="money"/>
3086                         <field name="usr" reporter:datatype="link"/>
3087                         <field name="xact_finish" reporter:datatype="timestamp" />
3088                         <field name="xact_start" reporter:datatype="timestamp" />
3089                         <field name="xact_type" reporter:datatype="text"/>
3090                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3091                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3092                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3093                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3094                         <field name="billing_location" reporter:datatype="link"/>
3095                 </fields>
3096                 <links>
3097                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3098                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3099                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3100                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3101                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3102                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3103                 </links>
3104                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3105                         <actions>
3106                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3107                                         <context link="usr" field="home_ou" />
3108                                 </retrieve>
3109                         </actions>
3110                 </permacrud>
3111         </class>
3112         <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">
3113                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3114                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3115                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3116                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3117                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3118                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3119                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3120                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3121                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3122                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3123                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3124                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3125                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3126                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3127                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3128                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3129                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3130                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3131                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3132                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3133                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3134                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3135                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3136                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3137                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3138                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3139                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3140                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3141                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3142                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3143                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3144                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3145                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3146                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3147                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3148                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3149                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3150                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3151                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3152                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3153                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3154                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3155                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3156                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3157                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3158                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3159                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3160                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3161                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3162                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3163                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3164                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3165                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3166                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3167                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3168                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3169                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3170                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3171                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3172                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3173                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3174                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3175                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3176                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3177                 </fields>
3178                 <links>
3179                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3180                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3181                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3182                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3183                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3184                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3185                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3186                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3187                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3188                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3189                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3190                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3191                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3192                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3193                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3194                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3195                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3196                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3197                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3198                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3199                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3200                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3201                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3202                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3203                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3204                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3205                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3206                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3207                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3208                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3209                 </links>
3210                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3211                         <actions>
3212                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3213                         </actions>
3214                 </permacrud>
3215         </class>
3216         <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">
3217                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3218                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3219                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3220                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3221                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3222                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3223                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3224                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3225                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3226         </fields>
3227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3228                         <actions>
3229                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3230                                 <retrieve/>
3231                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3232                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3233                         </actions>
3234                 </permacrud>
3235         </class>
3236         <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">
3237                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3238                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3239                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3240                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3241                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3242         </fields>
3243         <links>
3244                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3245                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3246                 </links>
3247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3248                         <actions>
3249                                 <retrieve permission="RUN_REPORTS">
3250                                         <context link="usr" field="home_ou" />
3251                                 </retrieve>
3252                         </actions>
3253                 </permacrud>
3254         </class>
3255         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3256                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3257                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3258                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3259                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3260                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3261                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3262                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3263         </fields>
3264         <links>
3265                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3266                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3267                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3268                 </links>
3269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3270                         <actions>
3271                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3272                                         <context link="usr" field="home_ou" />
3273                                         <context link="ws" field="owning_lib" />
3274                                 </retrieve>
3275                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3276                                         <context link="usr" field="home_ou" />
3277                                         <context link="ws" field="owning_lib" />
3278                                 </create>
3279                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3280                                         <context link="usr" field="home_ou" />
3281                                         <context link="ws" field="owning_lib" />
3282                                 </update>
3283                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3284                                         <context link="usr" field="home_ou" />
3285                                         <context link="ws" field="owning_lib" />
3286                                 </delete>
3287                         </actions>
3288                 </permacrud>
3289         </class>
3290         <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">
3291                 <fields oils_persist:primary="name">
3292                         <field name="name" reporter:datatype="text"/>
3293                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3294                 </fields>
3295                 <links/>
3296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3297                         <actions>
3298                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3299                                 <retrieve/>
3300                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3301                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3302                         </actions>
3303                 </permacrud>
3304         </class>
3305         <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">
3306                 <fields oils_persist:primary="name">
3307                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3308                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3309                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3310                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3311                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3312                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3313                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3314                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3315                 </fields>
3316                 <links>
3317                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3318                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3319                 </links>
3320                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3321                         <actions>
3322                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3323                                 <retrieve/>
3324                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3325                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3326                         </actions>
3327                 </permacrud>
3328         </class>
3329         <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">
3330                 <fields oils_persist:primary="name">
3331                         <field name="name" reporter:datatype="text"/>
3332                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3333                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3334                         <field name="datatype" reporter:datatype="text"/>
3335                         <field name="view_perm" reporter:datatype="link"/>
3336                         <field name="update_perm" reporter:datatype="link"/>
3337                         <field name="fm_class" reporter:datatype="text"/>
3338                         <field name="grp" reporter:datatype="link"/>
3339                 </fields>
3340                 <links>
3341                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3342                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3343                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3344                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3345                 </links>
3346                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3347                         <actions>
3348                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3349                                 <retrieve/>
3350                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3351                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3352                         </actions>
3353                 </permacrud>
3354         </class>
3355         <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">
3356                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3357                         <field name="id" />
3358                         <field name="name"  reporter:datatype="text"/>
3359                         <field name="org_unit" reporter:datatype="org_unit"/>
3360                         <field name="value"  reporter:datatype="text"/>
3361                 </fields>
3362                 <links>
3363                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3364                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3365                 </links>
3366         </class>
3367         <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">
3368                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3369                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3370                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3371                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3372                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3373                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3374                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3375                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3376                 </fields>
3377                 <links>
3378                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3379                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3380                 </links>
3381         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3382             <actions>
3383                 <create permission="CREATE_COPY_NOTE">
3384                     <context link="owning_copy" field="circ_lib"/>
3385                 </create>
3386                 <retrieve permission="VIEW_COPY_NOTES">
3387                     <context link="owning_copy" field="circ_lib"/>
3388                 </retrieve>
3389                 <update permission="UPDATE_COPY_NOTE">
3390                     <context link="owning_copy" field="circ_lib"/>
3391                 </update>
3392                 <delete permission="DELETE_COPY_NOTE">
3393                     <context link="owning_copy" field="circ_lib"/>
3394                 </delete>
3395             </actions>
3396         </permacrud>
3397         </class>
3398         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3399                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3400                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3401                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3402                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3403                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3404                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3405                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3406                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3407                 </fields>
3408                 <links>
3409                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3410                 </links>
3411         </class>
3412         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3413                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3414                         <field name="fingerprint"  reporter:datatype="text"/>
3415                         <field name="id" reporter:datatype="id" />
3416                         <field name="master_record" reporter:datatype="link"/>
3417                         <field name="mods"  reporter:datatype="text"/>
3418                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3419                 </fields>
3420                 <links>
3421                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3422                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3423                 </links>
3424         </class>
3425         <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">
3426                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3427                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3428                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3429                 </fields>
3430                 <links/>
3431         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3432             <actions>
3433                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3434                 <retrieve/>
3435                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3436                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3437             </actions>
3438         </permacrud>
3439         </class>
3440         <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">
3441                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3442                         <field name="code"  reporter:datatype="text"/>
3443                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3444                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3445                 </fields>
3446                 <links/>
3447         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3448             <actions>
3449                 <create permission="CREATE_PERM" global_required="true"/>
3450                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3451                 <update permission="UPDATE_PERM" global_required="true"/>
3452                 <delete permission="DELETE_PERM" global_required="true"/>
3453             </actions>
3454         </permacrud>
3455         </class>
3456         <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">
3457                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3458                         <field name="id" reporter:datatype="id" />
3459                         <field name="metarecord" reporter:datatype="link"/>
3460                         <field name="source" reporter:datatype="link"/>
3461                 </fields>
3462                 <links>
3463                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3464                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3465                 </links>
3466         </class>
3467         <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">
3468                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3469                         <field name="id" reporter:datatype="id" />
3470                         <field name="field" reporter:datatype="link"/>
3471                         <field name="source" reporter:datatype="link"/>
3472                         <field name="value"  reporter:datatype="text"/>
3473                 </fields>
3474                 <links>
3475                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3476                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3477                 </links>
3478         </class>
3479         <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">
3480                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3481                         <field name="id" reporter:datatype="id" />
3482                         <field name="value" reporter:datatype="text"/>
3483                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3484                 </fields>
3485                 <links>
3486                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3487                 </links>
3488         </class>
3489         <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">
3490                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3491                         <field name="id" reporter:datatype="id" />
3492                         <field name="entry" reporter:datatype="link"/>
3493                         <field name="def" reporter:datatype="link"/>
3494                         <field name="source" reporter:datatype="link"/>
3495                 </fields>
3496                 <links>
3497                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3498                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3499                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3500                 </links>
3501         </class>
3502         <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">
3503                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3504                         <field name="id" reporter:datatype="id" />
3505                         <field name="entry" reporter:datatype="link"/>
3506                         <field name="simple_heading" reporter:datatype="link"/>
3507                 </fields>
3508                 <links>
3509                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3510                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3511                 </links>
3512         </class>
3513         <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">
3514                 <oils_persist:source_definition>
3515                         SELECT * FROM metabib.author_field_entry
3516                                                 UNION ALL
3517                         SELECT * FROM metabib.keyword_field_entry
3518                                                 UNION ALL
3519                         SELECT * FROM metabib.identifier_field_entry
3520                                                 UNION ALL
3521                         SELECT * FROM metabib.title_field_entry
3522                                                 UNION ALL
3523                         SELECT * FROM metabib.subject_field_entry
3524                                                 UNION ALL
3525                         SELECT * FROM metabib.series_field_entry
3526                 </oils_persist:source_definition>
3527                 <fields>
3528                         <field name="field" reporter:datatype="link"/>
3529                         <field name="id" reporter:datatype="id" />
3530                         <field name="source" reporter:datatype="link"/>
3531                         <field name="value"  reporter:datatype="text"/>
3532                 </fields>
3533                 <links>
3534                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3535                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3536                 </links>
3537         </class>
3538         <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">
3539                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3540                         <field name="field" reporter:datatype="link"/>
3541                         <field name="id" reporter:datatype="id" />
3542                         <field name="source" reporter:datatype="link"/>
3543                         <field name="value"  reporter:datatype="text"/>
3544                 </fields>
3545                 <links>
3546                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3547                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3548                 </links>
3549         </class>
3550         <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">
3551                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3552                         <field name="accepting_usr" reporter:datatype="link"/>
3553                         <field name="amount" reporter:datatype="money" />
3554                         <field name="amount_collected" reporter:datatype="money" />
3555                         <field name="cash_drawer" reporter:datatype="link"/>
3556                         <field name="id" reporter:datatype="id" />
3557                         <field name="note"  reporter:datatype="text"/>
3558                         <field name="payment_ts" reporter:datatype="timestamp"/>
3559                         <field name="xact" reporter:datatype="link"/>
3560                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3561                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3562                 </fields>
3563                 <links>
3564                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3565                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3566                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3567                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3568                 </links>
3569         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3570             <actions>
3571                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3572                     <context link="xact" jump="usr" field="home_ou"/>
3573                 </retrieve>
3574                         </actions>
3575                 </permacrud>
3576         </class>
3577         <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">
3578                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3579                         <field name="accepting_usr" reporter:datatype="link"/>
3580                         <field name="amount" reporter:datatype="money" />
3581                         <field name="amount_collected" reporter:datatype="money" />
3582                         <field name="id" reporter:datatype="id" />
3583                         <field name="note"  reporter:datatype="text"/>
3584                         <field name="payment_ts" reporter:datatype="timestamp"/>
3585                         <field name="xact" reporter:datatype="link"/>
3586                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3587                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3588                 </fields>
3589                 <links>
3590                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3591                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3592                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3593                 </links>
3594         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3595             <actions>
3596                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3597                     <context link="xact" jump="usr" field="home_ou"/>
3598                 </retrieve>
3599                         </actions>
3600                 </permacrud>
3601         </class>
3602         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3603                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3604                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3605                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3606                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3607                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3608                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3609                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3610                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3611                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3612                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3613                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3614                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3615                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3616                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3617                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3618                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3619                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3620                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3621                 </fields>
3622                 <links>
3623                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3624                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3625                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3626                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3627                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3628                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3629                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3630                 </links>
3631         </class>
3632
3633         <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">
3634                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3635                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3636                         <field name="name"  reporter:datatype="text"/>
3637                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3638                         <field name="block_list" reporter:datatype="text"/>
3639                         <field name="staff_alert" reporter:datatype="bool"/>
3640                         <field name="org_depth" reporter:datatype="int"/>
3641                 </fields>
3642                 <links/>
3643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3644             <actions>
3645                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3646                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3647                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3648                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3649             </actions>
3650         </permacrud>
3651         </class>
3652         <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">
3653                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3654                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3655                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3656                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3657                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3658                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3659                 </fields>
3660                 <links>
3661                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3662                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3663                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3664         </links>
3665         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3666             <actions>
3667                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3668                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3669                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3670                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3671             </actions>
3672         </permacrud>
3673         </class>
3674         <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">
3675                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3676                         <field name="holdable" reporter:datatype="bool"/>
3677                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3678                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3679                         <field name="opac_visible" reporter:datatype="bool"/>
3680             <field name="copy_active" reporter:datatype="bool"/>
3681             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3682                 </fields>
3683                 <links/>
3684         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3685             <actions>
3686                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3687                 <retrieve/>
3688                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3689                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3690             </actions>
3691         </permacrud>
3692         </class>
3693         <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">
3694                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3695                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3696                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3697                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3698                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3699                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3700                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3701                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3702                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3703                 </fields>
3704                 <links>
3705                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3706                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3707                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3708                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3709                 </links>
3710                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3711                         <actions>
3712                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3713                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3714                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3715                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3716                         </actions>
3717                 </permacrud>
3718         </class>
3719         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3720                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3721                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3722                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3723                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3724                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3725                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3726                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3727                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3728                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3729                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3730                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3731                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3732                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3733                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3734                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3735                 </fields>
3736                 <links>
3737                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3738                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3739                 </links>
3740         </class>
3741         <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">
3742                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3743                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3744                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3745                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3746                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3747                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3748                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3749                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3750                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3751                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3752                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3753                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3754                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3755                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3756                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3757                 </fields>
3758                 <links>
3759                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3760                 </links>
3761                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3762                         <actions>
3763                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3764                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3765                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3766                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3767                         </actions>
3768                 </permacrud>
3769         </class>
3770
3771
3772         <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">
3773                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
3774                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3775                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
3776                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3777                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
3778                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
3779                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
3780                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
3781                 </fields>
3782                 <links>
3783                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
3784                 </links>
3785         </class>
3786
3787         <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">
3788                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
3789                         <field name="call_number" />
3790                         <field name="create_date" reporter:datatype="timestamp"/>
3791                         <field name="creator" reporter:datatype="link"/>
3792                         <field name="id" reporter:datatype="id" />
3793                         <field name="pub" reporter:datatype="bool"/>
3794                         <field name="title"  reporter:datatype="text"/>
3795                         <field name="value"  reporter:datatype="text"/>
3796                 </fields>
3797                 <links>
3798                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3799                 </links>
3800         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3801             <actions>
3802                 <create permission="CREATE_VOLUME_NOTE">
3803                     <context link="call_number" field="owning_lib"/>
3804                 </create>
3805                 <retrieve permission="VIEW_VOLUME_NOTES">
3806                     <context link="call_number" field="owning_lib"/>
3807                 </retrieve>
3808                 <update permission="UPDATE_VOLUME_NOTE">
3809                     <context link="call_number" field="owning_lib"/>
3810                 </update>
3811                 <delete permission="DELETE_VOLUME_NOTE">
3812                     <context link="call_number" field="owning_lib"/>
3813                 </delete>
3814             </actions>
3815         </permacrud>
3816         </class>
3817         <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">
3818                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
3819                         <field name="create_date" reporter:datatype="timestamp"/>
3820                         <field name="creator" reporter:datatype="link"/>
3821                         <field name="edit_date" reporter:datatype="timestamp"/>
3822                         <field name="editor" reporter:datatype="link"/>
3823                         <field name="id" reporter:datatype="id" />
3824                         <field name="record" reporter:datatype="link"/>
3825                         <field name="value" reporter:datatype="text"/>
3826                 </fields>
3827                 <links>
3828                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3829                 </links>
3830         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3831             <actions>
3832                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3833                 <retrieve/>
3834                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3835                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3836             </actions>
3837         </permacrud>
3838         </class>
3839         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
3840         <oils_persist:source_definition>
3841 SELECT  usr,
3842         SUM(
3843             CASE
3844                 WHEN (
3845                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3846                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3847                 ) THEN 1
3848                 ELSE 0
3849             END
3850         ) AS out,
3851
3852         SUM(
3853             CASE
3854                 WHEN (
3855                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3856                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3857                 ) THEN 1
3858                 ELSE 0
3859             END
3860         ) AS overdue,
3861
3862         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
3863         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
3864         SUM( CASE WHEN stop_fines = 'LONGOVERDUE' THEN 1 ELSE 0 END) AS long_overdue
3865   FROM  action.circulation
3866   WHERE checkin_time IS NULL
3867   GROUP BY 1
3868         </oils_persist:source_definition>
3869         <fields oils_persist:primary="usr">
3870             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3871             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3872             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3873             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3874             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3875             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3876         </fields>
3877         <links>
3878             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3879         </links>
3880         </class>
3881         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
3882         <oils_persist:source_definition>
3883 SELECT  usr,
3884         STRING_AGG(
3885             CASE
3886                 WHEN (
3887                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3888                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3889                 ) THEN id::TEXT
3890                 ELSE '0'
3891             END
3892         ,',') AS out,
3893
3894         STRING_AGG(
3895             CASE
3896                 WHEN (
3897                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3898                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3899                 ) THEN id::TEXT
3900                 ELSE '0'
3901             END
3902         ,',') AS overdue,
3903
3904         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
3905         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
3906         STRING_AGG( CASE WHEN stop_fines = 'LONGOVERDUE' THEN id::TEXT ELSE '0' END,',') AS long_overdue
3907   FROM  action.circulation
3908   WHERE checkin_time IS NULL
3909   GROUP BY 1
3910         </oils_persist:source_definition>
3911         <fields oils_persist:primary="usr">
3912             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3913             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3914             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3915             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3916             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3917             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3918         </fields>
3919         <links>
3920             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3921         </links>
3922         </class>
3923         <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">
3924                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3925                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3926                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3927                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3928                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3929                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3930                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3931                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3932                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3933                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3934                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3935                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3936                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3937                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3938                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3939                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3940                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3941                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3942                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3943                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3944                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3945                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3946                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3947                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
3948                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3949                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
3950                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3951                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
3952                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
3953                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
3954                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
3955                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3956                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3957                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3958                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3959                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3960                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3961                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
3962                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
3963                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3964                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3965                 </fields>
3966                 <links>
3967                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
3968                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
3969                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
3970                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3971                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
3972                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3973                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3974                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3975                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3976                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
3977                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
3978                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
3979                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
3980                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3981                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3982                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
3983                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
3984                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
3985                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
3986                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
3987                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
3988                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
3989                 </links>
3990                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3991                         <actions>
3992                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
3993                         </actions>
3994                 </permacrud>
3995         </class>
3996         <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">
3997                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3998                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3999                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4000                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4001                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4002                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4003                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4004                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4005                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4006                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4007                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4008                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4009                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4010                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4011                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4012                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4013                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4014                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4015                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4016                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4017                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4018                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4019                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4020                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4021                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4022                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4023                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4024                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4025                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4026                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4027                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4028                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4029                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4030                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4031                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4032                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4033                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4034                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4035                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4036                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4037                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4038                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4039                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4040                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4041                 </fields>
4042                 <links>
4043                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4044                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4045                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4046                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4047                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4048                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4049                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4050                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4051                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4052                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4053                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4054                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4055                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4056                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4057                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4058                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4059                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4060                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4061                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4062                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4063                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4064                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4065                 </links>
4066         </class>
4067         <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">
4068                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4069                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4070                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4071                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4072                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4073                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4074                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4075                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4076                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4077                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4078                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4079                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4080                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4081                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4082                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4083                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4084                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4085                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4086                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4087                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4088                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4089                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4090                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4091                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4092                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4093                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4094                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4095                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4096                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4097                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4098                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4099                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4100                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4101                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4102                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4103                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4104                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4105                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4106                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4107                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4108                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4109                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4110                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4111                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4112                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4113                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4114                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4115                 </fields>
4116                 <links>
4117                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4118                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4119                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4120                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4121                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4122                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4123                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4124                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4125                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4126                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4127                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4128                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4129                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4130                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4131                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4132                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4133                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4134                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4135                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4136                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4137                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4138                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4139                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4140                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4141                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4142                 </links>
4143         </class>
4144
4145         <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">
4146                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4147                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4148                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4149                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4150                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4151                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4152                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4153                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4154                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4155                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4156                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4157                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4158                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4159                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4160                 </fields>
4161                 <links>
4162                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4163                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4164                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4165                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4166                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4167                 </links>
4168                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4169                         <actions>
4170                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4171                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4172                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4173                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4174                         </actions>
4175                 </permacrud>
4176         </class>
4177
4178         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4179                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4180                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4181                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4182                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4183                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4184                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4185                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4186                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4187                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4188                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4189                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4190                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4191                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4192                 </fields>
4193                 <links>
4194                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4195                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4196                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4197                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4198                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4199                 </links>
4200                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4201                         <actions>
4202                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4203                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4204                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4205                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4206                         </actions>
4207                 </permacrud>
4208         </class>
4209         
4210         <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">
4211                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4212                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4213                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4214                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4215                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4216                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4217                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4218                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4219                 </fields>
4220                 <links>
4221                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4222                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4223                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4224                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4225                 </links>
4226                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4227                         <actions>
4228                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4229                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4230                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4231                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4232                         </actions>
4233                 </permacrud>
4234         </class>
4235         
4236         <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">
4237                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4238                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4239                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4240                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4241                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4242                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4243                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4244                 </fields>
4245                 <links>
4246                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4247                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4248                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4249                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4250                 </links>
4251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4252                         <actions>
4253                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4254                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4255                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4256                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4257                         </actions>
4258                 </permacrud>
4259         </class>
4260         
4261         <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">
4262                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4263                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4264                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4265                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4266                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4267                 </fields>
4268                 <links>
4269                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4270                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4271                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4272                 </links>
4273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4274                         <actions>
4275                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4276                     <context link="resource" field="owner" />
4277                 </create>
4278                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4279                     <context link="resource" field="owner" />
4280                 </retrieve>
4281                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4282                     <context link="resource" field="owner" />
4283                 </update>
4284                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4285                     <context link="resource" field="owner" />
4286                 </delete>
4287                         </actions>
4288                 </permacrud>
4289         </class>
4290         
4291         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4292                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4293                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4294                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4295                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4296                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4297                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4298                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4299                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4300                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4301                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4302                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4303                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4304                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4305                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4306                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4307                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4308                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4309                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4310                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4311                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4312                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4313                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4314                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4315                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4316                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4317                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4318                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4319                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4320                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4321                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4322                 </fields>
4323                 <links>
4324                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4325                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4326                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4327                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4328                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4329                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4330                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4331                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4332                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4333                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4334                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4335                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4336                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4337                 </links>
4338                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4339                         <actions>
4340                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4341                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4342                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4343                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4344                         </actions>
4345                 </permacrud>
4346         </class>
4347         
4348         <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">
4349                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4350                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4351                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4352                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4353                 </fields>
4354                 <links>
4355                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4356                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4357                 </links>
4358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4359                         <actions>
4360                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4361                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4362                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4363                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4364                         </actions>
4365                 </permacrud>
4366         </class>
4367
4368         <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">
4369                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4370                         <field name="bucket" reporter:datatype="link"/>
4371                         <field name="id" reporter:datatype="id" />
4372                         <field name="target_call_number" reporter:datatype="link" />
4373                         <field name="create_time" reporter:datatype="timestamp" />
4374                         <field name="pos" reporter:datatype="int" />
4375                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4376                 </fields>
4377                 <links>
4378                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4379                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4380             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4381                 </links>
4382         </class>
4383         <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">
4384                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4385                         <field name="id" reporter:datatype="id" />
4386                         <field name="item" reporter:datatype="link"/>
4387                         <field name="note" reporter:datatype="text" />
4388                 </fields>
4389                 <links>
4390                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4391                 </links>
4392         </class>
4393         <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">
4394                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4395                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4396                         <field name="btype" reporter:datatype="text"/>
4397                         <field name="id" reporter:datatype="id" />
4398                         <field name="name" reporter:datatype="text"/>
4399                         <field name="description" reporter:datatype="text"/>
4400                         <field name="owner" reporter:datatype="link"/>
4401                         <field name="pub" reporter:datatype="bool"/>
4402                         <field name="create_time" reporter:datatype="timestamp" />
4403                 </fields>
4404                 <links>
4405                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4406                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4407                 </links>
4408         </class>
4409         <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">
4410                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4411                         <field name="id" reporter:datatype="id" />
4412                         <field name="bucket" reporter:datatype="link"/>
4413                         <field name="note" reporter:datatype="text" />
4414                 </fields>
4415                 <links>
4416                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4417                 </links>
4418         </class>
4419         <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">
4420                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4421                         <field name="hold" reporter:datatype="link"/>
4422                         <field name="id" reporter:datatype="id" />
4423                         <field name="target_copy" reporter:datatype="link"/>
4424                         <field name="proximity" reporter:datatype="number"/>
4425                 </fields>
4426                 <links>
4427                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4428                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4429                 </links>
4430         </class>
4431         <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">
4432                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4433                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4434                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4435                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4436                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4437                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4438                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4439                 </fields>
4440                 <links>
4441                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4442                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4443                 </links>
4444         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4445             <actions>
4446                 <create permission="CREATE_HOLD_NOTIFICATION">
4447                                         <context link="hold" jump="usr" field="home_ou" />
4448                                 </create>
4449                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4450                                         <context link="hold" jump="usr" field="home_ou" />
4451                                 </retrieve>
4452                 <update permission="CREATE_HOLD_NOTIFICATION">
4453                                         <context link="hold" jump="usr" field="home_ou" />
4454                                 </update>
4455                 <delete permission="CREATE_HOLD_NOTIFICATION">
4456                                         <context link="hold" jump="usr" field="home_ou" />
4457                                 </delete>
4458             </actions>
4459         </permacrud>
4460         </class>
4461         <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">
4462                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4463                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4464                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4465                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4466                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4467                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4468                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4469                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4470                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4471                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4472                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4473                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4474                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4475                 </fields>
4476                 <links>
4477                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4478                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4479                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4480                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4481                 </links>
4482         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4483             <actions>
4484                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4485                 <retrieve/>
4486                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4487                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4488             </actions>
4489         </permacrud>
4490         </class>
4491         <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">
4492                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4493                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4494                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4495                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4496                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4497             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4498             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4499             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4500                 </fields>
4501                 <links>
4502                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4503                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4504                 </links>
4505         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4506             <actions>
4507                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4508                 <retrieve/>
4509                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4510                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4511             </actions>
4512         </permacrud>
4513         </class>
4514         <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">
4515                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4516                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4517             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4518             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4519                 </fields>
4520                 <links>
4521                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4522                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4523                 </links>
4524         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4525             <actions>
4526                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4527                                         <context link="lgroup" field="owner" />
4528                 </create>
4529                 <retrieve/>
4530                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4531                                         <context link="lgroup" field="owner" />
4532                 </update>
4533                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4534                                         <context link="lgroup" field="owner" />
4535                 </delete>
4536             </actions>
4537         </permacrud>
4538         </class>
4539
4540     <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">
4541         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4542             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4543             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4544             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4545             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4546         </fields>
4547         <links>
4548             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4549             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4550         </links>
4551         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4552             <actions>
4553                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4554                 <retrieve/>
4555                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4556                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4557             </actions>
4558         </permacrud>
4559     </class>
4560
4561         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4562                 <fields>
4563                         <field name="sre_id" oils_persist:virtual="true" />
4564                         <field name="location" oils_persist:virtual="true" />
4565                         <field name="owning_lib" oils_persist:virtual="true" />
4566                         <field name="basic_holdings" oils_persist:virtual="true" />
4567                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4568                         <field name="supplement_holdings" oils_persist:virtual="true" />
4569                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4570                         <field name="index_holdings" oils_persist:virtual="true" />
4571                         <field name="index_holdings_add" oils_persist:virtual="true" />
4572                         <field name="online" oils_persist:virtual="true" />
4573                         <field name="missing" oils_persist:virtual="true" />
4574                         <field name="incomplete" oils_persist:virtual="true" />
4575                 </fields>
4576         </class>
4577
4578         <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">
4579                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4580                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4581                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4582                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4583                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4584                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4585                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4586                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4587                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4588                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4589                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4590                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4591                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4592                 </fields>
4593                 <links>
4594                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4595                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4596                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4597                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4598                 </links>
4599                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4600                         <actions>
4601                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4602                                 <retrieve/>
4603                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4604                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4605                         </actions>
4606                 </permacrud>
4607         </class>
4608
4609         <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">
4610                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4611                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4612                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4613                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4614                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4615                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4616                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4617                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4618                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4619                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4620                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4621                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4622                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4623                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4624                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4625                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4626                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4627                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4628                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4629                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4630                 </fields>
4631                 <links>
4632                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4633                 </links>
4634                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4635                         <actions>
4636                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4637                                         <context link="subscription" field="owning_lib" />
4638                                 </create>
4639                                 <retrieve />
4640                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4641                                         <context link="subscription" field="owning_lib" />
4642                                 </update>
4643                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4644                                         <context link="subscription" field="owning_lib" />
4645                                 </delete>
4646                         </actions>
4647                 </permacrud>
4648         </class>
4649
4650         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4651                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4652                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4653                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4654                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4655                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4656                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4657                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4658                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4659                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4660                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4661                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4662                 </fields>
4663                 <links>
4664                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4665                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4666                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4667                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4668                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4669                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4670                 </links>
4671                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4672                         <actions>
4673                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4674                                 <retrieve />
4675                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4676                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4677                         </actions>
4678                 </permacrud>
4679         </class>
4680
4681         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4682                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4683                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4684                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4685                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4686                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4687                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4688                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4689                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4690                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4691                 </fields>
4692                 <links>
4693                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4694                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4695                 </links>
4696         </class>
4697
4698         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4699                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4700                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4701                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4702                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4703                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4704                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4705                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4706                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4707                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4708                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4709                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4710                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4711                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4712                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
4713                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
4714                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4715                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4716                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4717                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4718                 </fields>
4719                 <links>
4720                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
4721                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4722                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
4723                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
4724                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
4725                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
4726                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
4727                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
4728                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
4729                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
4730                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
4731                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
4732                 </links>
4733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4734                         <actions>
4735                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4736                                 <retrieve />
4737                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4738                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4739                         </actions>
4740                 </permacrud>
4741         </class>
4742
4743         <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">
4744                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_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="Creator" name="creator" reporter:datatype="link"/>
4748                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4749                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4750                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4751                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4752                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4753                 </fields>
4754                 <links>
4755                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4756                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4757                 </links>
4758                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4759                         <actions>
4760                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4761                                         <context link="distribution" field="holding_lib" />
4762                                 </create>
4763                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
4764                                         <context link="distribution" field="holding_lib" />
4765                                 </retrieve>
4766                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4767                                         <context link="distribution" field="holding_lib" />
4768                                 </update>
4769                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4770                                         <context link="distribution" field="holding_lib" />
4771                                 </delete>
4772                         </actions>
4773                 </permacrud>
4774         </class>
4775
4776         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
4777                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
4778                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4779                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4780                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
4781                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4782                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
4783                 </fields>
4784                 <links>
4785                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4786                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
4787                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
4788                 </links>
4789                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4790                         <actions>
4791                                 <create permission="ADMIN_SERIAL_STREAM">
4792                                         <context link="distribution" field="holding_lib" />
4793                                 </create>
4794                                 <retrieve />
4795                                 <update permission="ADMIN_SERIAL_STREAM">
4796                                         <context link="distribution" field="holding_lib" />
4797                                 </update>
4798                                 <delete permission="ADMIN_SERIAL_STREAM">
4799                                         <context link="distribution" field="holding_lib" />
4800                                 </delete>
4801                         </actions>
4802                 </permacrud>
4803         </class>
4804
4805         <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">
4806                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
4807                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4808                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4809                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4810                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
4811                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
4812                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
4813                 </fields>
4814                 <links>
4815                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4816                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
4817                 </links>
4818                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4819                         <actions>
4820                                 <create permission="ADMIN_SERIAL_STREAM">
4821                                         <context link="stream" jump="distribution" field="holding_lib" />
4822                                 </create>
4823                                 <retrieve permission="RECEIVE_SERIAL">
4824                                         <context link="stream" jump="distribution" field="holding_lib" />
4825                                 </retrieve>
4826                                 <update permission="ADMIN_SERIAL_STREAM">
4827                                         <context link="stream" jump="distribution" field="holding_lib" />
4828                                 </update>
4829                                 <delete permission="ADMIN_SERIAL_STREAM">
4830                                         <context link="stream" jump="distribution" field="holding_lib" />
4831                                 </delete>
4832                         </actions>
4833                 </permacrud>
4834         </class>
4835
4836         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
4837                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
4838                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4839                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4840                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4841                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4842                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4843                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4844                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
4845                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4846                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
4847                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
4848                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
4849                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
4850                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4851                 </fields>
4852                 <links>
4853                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4854                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4855                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4856                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
4857                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
4858                 </links>
4859                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4860                         <actions>
4861                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
4862                                         <context link="subscription" field="owning_lib" />
4863                                 </create>
4864                                 <retrieve/>
4865                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
4866                                         <context link="subscription" field="owning_lib" />
4867                                 </update>
4868                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
4869                                         <context link="subscription" field="owning_lib" />
4870                                 </delete>
4871                         </actions>
4872                 </permacrud>
4873         </class>
4874
4875         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
4876                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
4877                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4878                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
4879                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
4880                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4881                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
4882                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
4883                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4884                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
4885                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
4886                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
4887                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4888                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
4889                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
4890                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4891                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
4892                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4893                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
4894                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
4895                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
4896                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
4897                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
4898                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
4899                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
4900                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
4901                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
4902                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
4903                         <field reporter:label="Price" name="price" reporter:datatype="money" />
4904                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
4905                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
4906                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
4907                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
4908                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
4909                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
4910                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
4911                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
4912                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
4913                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4914                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4915                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4916                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
4917                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
4918                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4919                 </fields>
4920                 <links>
4921                         <link field="age_protect" reltype="might_have" key="id" map="" class="crahp"/>
4922                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4923                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4924                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4925                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4926                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
4927                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4928                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
4929                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
4930                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
4931                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
4932                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
4933                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
4934                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
4935                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
4936                 </links>
4937                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4938                         <actions>
4939                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4940                                 <retrieve/>
4941                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4942                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4943                         </actions>
4944                 </permacrud>
4945         </class>
4946
4947         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
4948                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
4949                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4950                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4951                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4952                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4953                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4954                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
4955                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4956                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
4957                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
4958                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
4959                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
4960                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
4961                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4962                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
4963                 </fields>
4964                 <links>
4965                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4966                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4967                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4968                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4969                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
4970                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
4971                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
4972                 </links>
4973                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4974                         <actions>
4975                                 <create permission="ADMIN_SERIAL_ITEM">
4976                                         <context link="stream" jump="distribution" field="holding_lib" />
4977                                 </create>
4978                                 <retrieve permission="ADMIN_SERIAL_ITEM">
4979                                         <context link="stream" jump="distribution" field="holding_lib" />
4980                                 </retrieve>
4981                                 <update permission="ADMIN_SERIAL_ITEM">
4982                                         <context link="stream" jump="distribution" field="holding_lib" />
4983                                 </update>
4984                                 <delete permission="ADMIN_SERIAL_ITEM">
4985                                         <context link="stream" jump="distribution" field="holding_lib" />
4986                                 </delete>
4987                         </actions>
4988                 </permacrud>
4989         </class>
4990
4991         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
4992                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
4993                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4994                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
4995                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4996                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4997                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4998                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4999                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5000                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5001                 </fields>
5002                 <links>
5003                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5004                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5005                 </links>
5006                 <!-- Not available via PCRUD at this time -->
5007         </class>
5008         <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">
5009                 <fields>
5010                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5011                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5012                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5013                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5014                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5015                 </fields>
5016                 <links>
5017                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5018                 </links>
5019         </class>
5020         <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">
5021                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5022                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5023                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5024                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5025                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5026                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5027                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5028                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5029                 </fields>
5030                 <links>
5031                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5032                 </links>
5033         </class>
5034         <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">
5035                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5036                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5037                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5038                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5039                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5040                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5041                 </fields>
5042                 <links>
5043                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5044                 </links>
5045                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5046                         <actions>
5047                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5048                                         <context link="distribution" field="holding_lib" />
5049                                 </create>
5050                                 <retrieve/>
5051                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5052                                         <context link="distribution" field="holding_lib" />
5053                                 </update>
5054                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5055                                         <context link="distribution" field="holding_lib" />
5056                                 </delete>
5057                         </actions>
5058                 </permacrud>
5059         </class>
5060
5061         <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">
5062                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5063                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5064                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5065                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5066                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5067                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5068                 </fields>
5069                 <links>
5070                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5071                 </links>
5072                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5073                         <actions>
5074                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5075                                         <context link="distribution" field="holding_lib" />
5076                                 </create>
5077                                 <retrieve/>
5078                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5079                                         <context link="distribution" field="holding_lib" />
5080                                 </update>
5081                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5082                                         <context link="distribution" field="holding_lib" />
5083                                 </delete>
5084                         </actions>
5085                 </permacrud>
5086         </class>
5087
5088         <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">
5089                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5090                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5091                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5092                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5093                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5094                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5095                 </fields>
5096                 <links>
5097                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5098                 </links>
5099                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5100                         <actions>
5101                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5102                                         <context link="distribution" field="holding_lib" />
5103                                 </create>
5104                                 <retrieve/>
5105                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5106                                         <context link="distribution" field="holding_lib" />
5107                                 </update>
5108                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5109                                         <context link="distribution" field="holding_lib" />
5110                                 </delete>
5111                         </actions>
5112                 </permacrud>
5113         </class>
5114
5115         <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">
5116                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5117                         <field name="id" reporter:datatype="id" />
5118                         <field name="owning_copy" reporter:datatype="link"/>
5119                         <field name="stat_cat" reporter:datatype="link"/>
5120                         <field name="stat_cat_entry" reporter:datatype="link"/>
5121                 </fields>
5122                 <links>
5123                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5124                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5125                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5126                 </links>
5127         </class>
5128         <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">
5129                 <fields oils_persist:primary="code">
5130                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5131                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5132                 </fields>
5133                 <links/>
5134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5135             <actions>
5136                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5137                 <retrieve/>
5138                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5139                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5140             </actions>
5141         </permacrud>
5142         </class>
5143         <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">
5144                 <fields oils_persist:primary="code">
5145                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5146                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5147                 </fields>
5148                 <links/>
5149         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5150             <actions>
5151                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5152                 <retrieve/>
5153                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5154                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5155             </actions>
5156         </permacrud>
5157         </class>
5158         <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">
5159                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5160                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5161                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5162                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5163                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5164                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5165                 </fields>
5166                 <links>
5167             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5168         </links>
5169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5170             <actions>
5171                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5172                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5173                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5174                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5175             </actions>
5176         </permacrud>
5177         </class>
5178         <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">
5179                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5180                         <field name="id" reporter:datatype="id" />
5181                         <field name="name" reporter:datatype="text"/>
5182                 </fields>
5183                 <links/>
5184         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5185             <actions>
5186                 <create permission="CREATE_LASSO" global_required="true"/>
5187                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5188                 <update permission="UPDATE_LASSO" global_required="true"/>
5189                 <delete permission="DELETE_LASSO" global_required="true"/>
5190             </actions>
5191         </permacrud>
5192         </class>
5193         <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">
5194                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5195                         <field name="id" reporter:datatype="id" />
5196                         <field name="lasso" reporter:datatype="link"/>
5197                         <field name="org_unit" reporter:datatype="org_unit"/>
5198                 </fields>
5199                 <links>
5200                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5201                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5202                 </links>
5203         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5204             <actions>
5205                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5206                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5207                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5208                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5209             </actions>
5210         </permacrud>
5211         </class>
5212         <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">
5213                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5214                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5215                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5216                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5217                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5218                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5219                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5220                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5221                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5222                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5223                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5224                 </fields>
5225                 <links>
5226                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5227                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5228                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5229                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5230                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5231                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5232                 </links>
5233         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5234             <actions>
5235                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5236                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5237                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5238                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5239             </actions>
5240         </permacrud>
5241         </class>
5242         <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">
5243                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5244                         <field name="id" reporter:datatype="id" />
5245                         <field name="from_org" reporter:datatype="org_unit"/>
5246                         <field name="to_org" reporter:datatype="org_unit"/>
5247                         <field name="prox" reporter:datatype="int" />
5248                 </fields>
5249                 <links>
5250                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5251                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5252                 </links>
5253         </class>
5254         <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">
5255                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5256                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5257                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5258                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5259                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5260                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5261                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5262                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5263                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5264                 </fields>
5265                 <links/>
5266         </class>
5267         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5268                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5269                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5270                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5271                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5272                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5273                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5274                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5275                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5276                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5277                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5278                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5279                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5280                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5281                 </fields>
5282                 <links>
5283                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5284                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5285                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5286                 </links>
5287         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5288             <actions>
5289                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5290                 <retrieve/>
5291                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5292                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5293             </actions>
5294         </permacrud>
5295         </class>
5296         <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">
5297                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5298                         <field name="address_type"  reporter:datatype="text"/>
5299                         <field name="city"  reporter:datatype="text"/>
5300                         <field name="country"  reporter:datatype="text"/>
5301                         <field name="county"  reporter:datatype="text"/>
5302                         <field name="id" reporter:datatype="id" />
5303                         <field name="org_unit" reporter:datatype="org_unit"/>
5304                         <field name="post_code"  reporter:datatype="text"/>
5305                         <field name="state"  reporter:datatype="text"/>
5306                         <field name="street1"  reporter:datatype="text"/>
5307                         <field name="street2"  reporter:datatype="text"/>
5308                         <field name="valid" reporter:datatype="bool"/>
5309                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5310                 </fields>
5311                 <links>
5312                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5313                 </links>
5314         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5315             <actions>
5316                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5317                 <retrieve/>
5318                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5319                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5320             </actions>
5321         </permacrud>
5322         </class>
5323         <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">
5324                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5325                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5326                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5327                         <field name="query_text" reporter:datatype="text"/>
5328                 </fields>
5329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5330             <actions>
5331                 <retrieve/>
5332             </actions>
5333         </permacrud>
5334         </class>
5335
5336         <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">
5337                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5338                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5339                         <field name="owner" reporter:datatype="org_unit"/>
5340                         <field name="code" reporter:datatype="text"/>
5341                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5342                         <field name="create_date" reporter:datatype="timestamp"/>
5343                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5344                 </fields>
5345                 <links>
5346                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5347                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5348                 </links>
5349         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5350             <actions>
5351                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5352                 <retrieve/>
5353                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5354                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5355             </actions>
5356         </permacrud>
5357         </class>
5358         <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">
5359                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5360                         <field name="id" reporter:datatype="id"/>
5361                         <field name="grp" reporter:datatype="link"/>
5362                         <field name="pos" reporter:datatype="int"/>
5363                         <field name="query" reporter:datatype="link"/>
5364                 </fields>
5365                 <links>
5366                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5367                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5368                 </links>
5369         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5370             <actions>
5371                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5372                     <context link="grp" field="owner"/>
5373                 </create>
5374                 <retrieve/>
5375                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5376                     <context link="grp" field="owner"/>
5377                 </update>
5378                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5379                     <context link="grp" field="owner"/>
5380                 </delete>
5381             </actions>
5382         </permacrud>
5383         </class>
5384
5385         <!-- A note: Please update alhr and ahopl when updating ahr -->
5386         <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">
5387                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5388                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5389                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5390                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5391                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5392                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5393                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5394                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5395                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5396                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5397                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5398                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5399                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5400                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5401                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5402                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5403                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5404                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5405                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5406                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5407                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5408                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5409                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5410                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5411                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5412                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5413                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5414                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5415                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5416                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5417                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5418                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5419                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5420                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5421                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5422                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5423                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5424                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5425                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5426                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5427                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5428                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5429                 </fields>
5430                 <links>
5431                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5432                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5433                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5434                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5435                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5436                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5437                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5438                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5439                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5440                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5441                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5442                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5443                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5444                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5445                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5446                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5447                 </links>
5448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5449                         <actions>
5450                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5451                         </actions>
5452                 </permacrud>
5453         </class>
5454         <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">
5455                 <oils_persist:source_definition><![CDATA[
5456                 SELECT
5457                         ahr.*,
5458                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5459                                 copy_location_order_position,
5460                         CASE WHEN au.alias IS NOT NULL THEN
5461                                 au.alias
5462                         ELSE
5463                                 au.first_given_name
5464                         END AS usr_alias_or_first_given_name,
5465                         au.first_given_name AS usr_first_given_name,
5466                         au.second_given_name AS usr_second_given_name,
5467                         au.family_name AS usr_family_name,
5468                         au.prefix AS usr_prefix,
5469                         au.suffix AS usr_suffix,
5470                         au.alias AS usr_alias,
5471                         CASE WHEN au.alias IS NOT NULL THEN
5472                                 au.alias
5473                         ELSE
5474                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5475                                         COALESCE(au.family_name, ''),
5476                                         COALESCE(au.suffix, ''),
5477                                         ', ',
5478                                         COALESCE(au.prefix, ''),
5479                                         COALESCE(au.first_given_name, ''),
5480                                         COALESCE(au.second_given_name, '')
5481                                 ], ' '), E'\\s+,', ',')
5482                         END AS usr_alias_or_display_name,
5483                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5484                                 COALESCE(au.family_name, ''),
5485                                 COALESCE(au.suffix, ''),
5486                                 ', ',
5487                                 COALESCE(au.prefix, ''),
5488                                 COALESCE(au.first_given_name, ''),
5489                                 COALESCE(au.second_given_name, '')
5490                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5491                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5492                                 AS call_number_label,
5493                         siss.label AS issuance_label,
5494                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5495                         ahcm_1.copy_count AS potential_copies
5496                 FROM action.hold_request ahr
5497                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5498                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5499                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5500                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5501                 JOIN actor.usr au ON (au.id = ahr.usr)
5502                 JOIN (
5503                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5504                         FROM asset.copy_location
5505                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5506                 LEFT JOIN actor.usr_standing_penalty ausp 
5507                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5508                 LEFT JOIN config.standing_penalty csp
5509                         ON (
5510                                 csp.id = ausp.standing_penalty AND 
5511                                 csp.block_list LIKE '%CAPTURE%' AND (
5512                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5513                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5514                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5515                                         )
5516                                 )
5517                         )
5518                 JOIN (
5519                         SELECT COUNT(target_copy) AS copy_count, hold
5520                         FROM action.hold_copy_map
5521                         GROUP BY 2
5522                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5523                 LEFT JOIN serial.issuance siss
5524                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5525                 LEFT JOIN asset.copy_location_order acplo
5526                         ON (acp.location = acplo.location AND
5527                                 acp.circ_lib = acplo.org)
5528                 WHERE
5529                         ahr.capture_time IS NULL AND
5530                         ahr.cancel_time IS NULL AND
5531                         csp.id IS NULL AND
5532                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5533                         acp.status IN (0,7)
5534                 ]]></oils_persist:source_definition>
5535                 <fields oils_persist:primary="id">
5536                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5537                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5538                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5539                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5540                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5541                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5542                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5543                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5544                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5545                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5546                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5547                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5548                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5549                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5550                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5551                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5552                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5553                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5554                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5555                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5556                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5557                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5558                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5559                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5560                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5561                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5562                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5563                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5564                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5565                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5566                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5567                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5568                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5569                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5570                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5571                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5572                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5573                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5574                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5575                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5576                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5577                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5578                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5579                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5580                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5581                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5582                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5583                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5584                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5585                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5586                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5587                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5588                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5589                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5590                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5591                 </fields>
5592                 <links>
5593                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5594                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5595                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5596                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5597                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5598                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5599                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5600                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5601                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5602                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5603                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5604                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5605                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5606                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5607                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5608                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5609                 </links>
5610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5611                         <actions>
5612                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5613                         </actions>
5614                 </permacrud>
5615         </class>
5616         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5617                 <oils_persist:source_definition>
5618                         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)
5619                 </oils_persist:source_definition>
5620                 <fields oils_persist:primary="id">
5621                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5622                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5623                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5624                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5625                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5626                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5627                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5628                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5629                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5630                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5631                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5632                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5633                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5634                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5635                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5636                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5637                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5638                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5639                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5640                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5641                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5642                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5643                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5644                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5645                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5646                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5647                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5648                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5649                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5650                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5651                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5652                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5653                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5654                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5655                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5656                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5657                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5658                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5659                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5660                 </fields>
5661                 <links>
5662                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5663                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5664                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5665                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5666                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5667                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5668                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5669                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5670                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5671                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5672                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5673                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5674                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5675                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5676                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5677                 </links>
5678         </class>
5679
5680         <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">
5681                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5682                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5683                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5684                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5685                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5686                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5687                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5688                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5689                 </fields>
5690                 <links>
5691                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5692                 </links>
5693                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5694                         <actions>
5695                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5696                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5697                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5698                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5699                         </actions>
5700                 </permacrud>
5701         </class>
5702         <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">
5703                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5704                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5705                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5706                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5707                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5708                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5709                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5710                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5711                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5712                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5713                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5714                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5715                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5716                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5717                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5718                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5719                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5720                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5721                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5722                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5723                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5724                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5725                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5726                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5727                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5728                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5729                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5730                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5731                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5732                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5733                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5734                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5735                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5736                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5737                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5738                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5739                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5740                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5741                 </fields>
5742                 <links>
5743                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5744                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5745                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5746                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5747                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5748                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5749                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5750                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5751                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5752                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5753                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5754                 </links>
5755                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5756                         <actions>
5757                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5758                         </actions>
5759                 </permacrud>
5760         </class>
5761         <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">
5762                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5763                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5764                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5765                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5766                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5767                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5768                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5769                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5770                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5771                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5772                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5773                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5774                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5775                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5776                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5777                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5778                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5779                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5780                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5781                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5782                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5783                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5784                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5785                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5786                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5787                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5788                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5789                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5790                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5791                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5792                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5793                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5794                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5795                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5796                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5797                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5798                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5799                 </fields>
5800                 <links>
5801                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5802                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5803                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5804                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5805                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5806                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5807                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5808                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5809                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5810                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5811                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5812                 </links>
5813                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5814                         <actions>
5815                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5816                         </actions>
5817                 </permacrud>
5818         </class>
5819
5820         <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">
5821                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
5822                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
5823                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
5824                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
5825                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
5826                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
5827                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
5828                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5829                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
5830                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
5831                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
5832                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
5833                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
5834                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5835                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
5836                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
5837                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
5838                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5839                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
5840                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
5841                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
5842                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
5843                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
5844                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
5845                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
5846                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
5847                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
5848                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5849                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5850                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5851                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
5852                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
5853                 </fields>
5854                 <links>
5855                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
5856                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
5857                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
5858                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
5859                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
5860                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
5861                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
5862                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
5863                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
5864                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
5865                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
5866                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
5867                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
5868                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
5869                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
5870                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
5871                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
5872                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
5873                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
5874                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
5875                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
5876                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
5877                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
5878                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
5879                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
5880                 </links>
5881         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5882             <actions>
5883                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
5884                 <retrieve />
5885                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
5886                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
5887             </actions>
5888         </permacrud>
5889         </class>
5890         <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">
5891                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
5892                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5893                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
5894                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
5895                 </fields>
5896                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5897                         <actions>
5898                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5899                                 <retrieve/>
5900                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5901                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5902                         </actions>
5903                 </permacrud>
5904         </class>
5905         <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">
5906                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
5907                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5908                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
5909                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
5910                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
5911                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
5912                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
5913                 </fields>
5914                 <links>
5915                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
5916                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5917                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
5918                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
5919                 </links>
5920                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5921                         <actions>
5922                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5923                                 <retrieve/>
5924                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5925                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5926                         </actions>
5927                 </permacrud>
5928         </class>
5929         <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">
5930                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
5931                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5932                         <field name="btype" reporter:datatype="text"/>
5933                         <field name="id" reporter:datatype="id" />
5934                         <field name="name"  reporter:datatype="text"/>
5935                         <field name="description" reporter:datatype="text"/>
5936                         <field name="owner" reporter:datatype="link"/>
5937                         <field name="pub" reporter:datatype="bool"/>
5938                         <field name="create_time" reporter:datatype="timestamp" />
5939                 </fields>
5940                 <links>
5941                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5942                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
5943                 </links>
5944         </class>
5945         <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">
5946                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
5947                         <field name="id" reporter:datatype="id" />
5948                         <field name="bucket" reporter:datatype="link"/>
5949                         <field name="note" reporter:datatype="text" />
5950                 </fields>
5951                 <links>
5952                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5953                 </links>
5954         </class>
5955         <class id="asc" controller="open-ils.cstore" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
5956                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
5957                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5958                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5959                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5960                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5961                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5962                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5963                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5964                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5965                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5966                 </fields>
5967                 <links>
5968                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5969                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
5970                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
5971                 </links>
5972         </class>
5973         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
5974                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
5975                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
5976                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5977                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
5978                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5979                 </fields>
5980                 <links>
5981                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5982                 </links>
5983                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5984                         <actions>
5985                                 <retrieve permission="VIEW_USER">
5986                                         <context link="usr" field="home_ou" />
5987                                 </retrieve>
5988                         </actions>
5989                 </permacrud>
5990         </class>
5991     <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">
5992         <fields oils_persist:primary="field">
5993             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
5994             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
5995             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
5996         </fields>
5997         <links/>
5998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5999             <actions>
6000                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6001                 <retrieve />
6002                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6003                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6004             </actions>
6005         </permacrud>
6006     </class>
6007         <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">
6008                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6009                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6010                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6011                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6012                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6013                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6014                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6015                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6016                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6017                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6018                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6019                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6020                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6021                 </fields>
6022                 <links>
6023                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6024                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6025                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6026                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6027                 </links>
6028         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6029             <actions>
6030                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6031                 <retrieve />
6032                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6033                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6034             </actions>
6035         </permacrud>
6036         </class>
6037         <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">
6038                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6039                         <field name="field" reporter:datatype="link"/>
6040                         <field name="id" reporter:datatype="id" />
6041                         <field name="source" reporter:datatype="link"/>
6042                         <field name="value"  reporter:datatype="text"/>
6043                 </fields>
6044                 <links>
6045                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6046                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6047                 </links>
6048         </class>
6049         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6050                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6051                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6052                         <field name="btype" reporter:datatype="text"/>
6053                         <field name="id" reporter:datatype="id" />
6054                         <field name="name"  reporter:datatype="text"/>
6055                         <field name="description" reporter:datatype="text"/>
6056                         <field name="owner" reporter:datatype="link"/>
6057                         <field name="pub" reporter:datatype="bool"/>
6058                         <field name="create_time" reporter:datatype="timestamp" />
6059                 </fields>
6060                 <links>
6061                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6062                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6063                 </links>
6064         </class>
6065         <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">
6066                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6067                         <field name="id" reporter:datatype="id" />
6068                         <field name="bucket" reporter:datatype="link"/>
6069                         <field name="note" reporter:datatype="text" />
6070                 </fields>
6071                 <links>
6072                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6073                 </links>
6074         </class>
6075         <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">
6076                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6077                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6078                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6079                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6080                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6081                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6082                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6083                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6084                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6085                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6086                 </fields>
6087                 <links>
6088                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6089                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6090                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6091                 </links>
6092         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6093             <actions>
6094                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6095                     <context link="xact" jump="usr" field="home_ou"/>
6096                 </retrieve>
6097                         </actions>
6098                 </permacrud>
6099         </class>
6100         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6101                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6102                         <field name="id" reporter:datatype="id" />
6103                         <field name="ind1" />
6104                         <field name="ind2" />
6105                         <field name="record" />
6106                         <field name="subfield" />
6107                         <field name="tag" />
6108                         <field name="value" />
6109                 </fields>
6110                 <links>
6111                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6112                 </links>
6113         </class>
6114         <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">
6115                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6116                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6117                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6118                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6119                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6120                 </fields>
6121                 <links>
6122                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6123                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6124                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6125                 </links>
6126         </class>
6127         <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">
6128                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6129                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6130                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6131                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6132                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6133                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6134                 </fields>
6135                 <links>
6136                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6137                 </links>
6138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6139             <actions>
6140                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6141                 <retrieve/>
6142                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6143                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6144             </actions>
6145         </permacrud>
6146
6147         </class>
6148         <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">
6149                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6150                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6151                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6152                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6153                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6154                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6155                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6156                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6157                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6158                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6159                 </fields>
6160                 <links>
6161                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6162                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6163                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6164                 </links>
6165         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6166             <actions>
6167                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6168                 <retrieve/>
6169                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6170                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6171             </actions>
6172         </permacrud>
6173         </class>
6174         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6175                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6176                         <field name="create_date" reporter:datatype="timestamp"/>
6177                         <field name="creator" reporter:datatype="link"/>
6178                         <field name="edit_date" reporter:datatype="timestamp"/>
6179                         <field name="editor" reporter:datatype="link"/>
6180                         <field name="id" reporter:datatype="id" />
6181                         <field name="pub" reporter:datatype="bool"/>
6182                         <field name="record" reporter:datatype="link"/>
6183                         <field name="value"  reporter:datatype="text"/>
6184                 </fields>
6185                 <links>
6186                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6187                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6188                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6189                 </links>
6190         </class>
6191         <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">
6192                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6193                         <field name="balance_owed" reporter:datatype="money" />
6194                         <field name="total_owed" reporter:datatype="money" />
6195                         <field name="total_paid" reporter:datatype="money" />
6196                         <field name="usr" reporter:datatype="link"/>
6197                 </fields>
6198                 <links>
6199                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6200                 </links>
6201         </class>
6202         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6203                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6204                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6205                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6206                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6207                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6208                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6209                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6210                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6211                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6212                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6213                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6214                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6215                 </fields>
6216                 <links>
6217                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6218                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6219                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6220                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6221                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6222                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6223                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6224                 </links>
6225         </class>
6226         <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">
6227                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6228                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6229                         <field name="quality" reporter:datatype="int" />
6230                         <field name="source" reporter:datatype="text"/>
6231                         <field name="transcendant" reporter:datatype="bool"/>
6232                         <field name="can_have_copies" reporter:datatype="bool"/>
6233                 </fields>
6234                 <links/>
6235         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6236             <actions>
6237                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6238                 <retrieve/>
6239                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6240                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6241             </actions>
6242         </permacrud>
6243         </class>
6244         <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">
6245                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6246                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6247                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6248                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6249                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6250                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6251                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6252                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6253                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6254                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6255                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6256                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6257                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6258                 </fields>
6259                 <links>
6260                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6261                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6262                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6263                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6264                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6265                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6266                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6267                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6268                 </links>
6269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6270                         <actions>
6271                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6272                                         <context link="usr" field="home_ou" />
6273                                 </retrieve>
6274                         </actions>
6275                 </permacrud>
6276         </class>
6277         <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">
6278                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6279                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6280                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6281                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6282                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6283                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6284                 </fields>
6285                 <links>
6286                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6287                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6288                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6289                 </links>
6290         </class>
6291         <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">
6292                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6293                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6294                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6295                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6296                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6297                 </fields>
6298                 <links>
6299                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6300                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6301                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6302                 </links>
6303         </class>
6304         <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">
6305                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6306                         <field name="bucket" reporter:datatype="link"/>
6307                         <field name="id" reporter:datatype="id" />
6308                         <field name="target_user" reporter:datatype="link"/>
6309                         <field name="create_time" reporter:datatype="timestamp" />
6310                         <field name="pos" reporter:datatype="int" />
6311                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6312                 </fields>
6313                 <links>
6314                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6315                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6316             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6317                 </links>
6318         </class>
6319         <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">
6320                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6321                         <field name="id" reporter:datatype="id" />
6322                         <field name="item" reporter:datatype="link"/>
6323                         <field name="note" reporter:datatype="text" />
6324                 </fields>
6325                 <links>
6326                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6327                 </links>
6328         </class>
6329         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6330                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6331                         <field name="balance_owed" reporter:datatype="money" />
6332                         <field name="total_owed" reporter:datatype="money" />
6333                         <field name="total_paid" reporter:datatype="money" />
6334                         <field name="usr" reporter:datatype="link"/>
6335                 </fields>
6336                 <links>
6337                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6338                 </links>
6339         </class>
6340         <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">
6341                 <fields oils_persist:primary="code" oils_persist:sequence="">
6342                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6343                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6344                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6345                 </fields>
6346                 <links/>
6347         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6348             <actions>
6349                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6350                 <retrieve/>
6351                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6352                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6353             </actions>
6354         </permacrud>
6355         </class>
6356         <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">
6357                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6358                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6359                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6360                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6361                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6362                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6363                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6364                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6365                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6366                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6367                 </fields>
6368                 <links>
6369                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6370                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6371                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6372                 </links>
6373         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6374             <actions>
6375                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6376                     <context link="xact" jump="usr" field="home_ou"/>
6377                 </retrieve>
6378                         </actions>
6379                 </permacrud>
6380         </class>
6381         <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">
6382                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6383                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6384                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6385                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6386                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6387                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6388                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6389                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6390                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6391                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6392                 </fields>
6393                 <links>
6394                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6395                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6396                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6397                 </links>
6398         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6399             <actions>
6400                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6401                     <context link="xact" jump="usr" field="home_ou"/>
6402                 </retrieve>
6403                         </actions>
6404                 </permacrud>
6405         </class>
6406         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6407                 <fields oils_persist:primary="id" oils_persist:sequence="">
6408                         <field name="checkin_lib" reporter:datatype="link"/>
6409                         <field name="checkin_staff" reporter:datatype="link"/>
6410                         <field name="checkin_time" reporter:datatype="timestamp"/>
6411                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6412                         <field name="circ_staff" reporter:datatype="link"/>
6413                         <field name="desk_renewal" reporter:datatype="bool"/>
6414                         <field name="due_date" reporter:datatype="timestamp"/>
6415                         <field name="duration" reporter:datatype="interval"/>
6416                         <field name="duration_rule" reporter:datatype="link"/>
6417                         <field name="fine_interval" reporter:datatype="interval"/>
6418                         <field name="id" reporter:datatype="id" />
6419                         <field name="max_fine" reporter:datatype="money" />
6420                         <field name="max_fine_rule" reporter:datatype="link"/>
6421                         <field name="opac_renewal" reporter:datatype="bool"/>
6422                         <field name="phone_renewal" reporter:datatype="bool"/>
6423                         <field name="recurring_fine" reporter:datatype="money" />
6424                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6425                         <field name="renewal_remaining" reporter:datatype="int" />
6426             <field name="grace_period" reporter:datatype="interval" />
6427                         <field name="stop_fines" reporter:datatype="text"/>
6428                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6429                         <field name="target_copy" reporter:datatype="link"/>
6430                         <field name="usr" reporter:datatype="link"/>
6431                         <field name="xact_finish" reporter:datatype="timestamp" />
6432                         <field name="xact_start" reporter:datatype="timestamp" />
6433                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6434                 </fields>
6435                 <links>
6436                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6437                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6438                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6439                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6440                 </links>
6441         </class>
6442         <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">
6443                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6444                         <field name="field" reporter:datatype="link"/>
6445                         <field name="id" reporter:datatype="id" />
6446                         <field name="source" reporter:datatype="link"/>
6447                         <field name="value" reporter:datatype="text"/>
6448                 </fields>
6449                 <links>
6450                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6451                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6452                 </links>
6453         </class>
6454         <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">
6455                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6456                         <field name="high" reporter:datatype="money" />
6457                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6458                         <field name="low" reporter:datatype="money" />
6459                         <field name="name" reporter:datatype="text"/>
6460                         <field name="normal" reporter:datatype="money" />
6461                         <field name="recurrence_interval" reporter:datatype="interval"/>
6462             <field name="grace_period" reporter:datatype="interval" />
6463                 </fields>
6464                 <links/>
6465         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6466             <actions>
6467                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6468                 <retrieve/>
6469                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6470                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6471             </actions>
6472         </permacrud>
6473         </class>
6474         <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">
6475                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6476                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6477                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6478                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6479                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6480                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6481                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6482                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6483                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6484                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6485                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6486                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6487                 </fields>
6488                 <links>
6489                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6490                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6491                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6492                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6493                 </links>
6494         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6495             <actions>
6496                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6497                     <context link="xact" jump="usr" field="home_ou"/>
6498                 </retrieve>
6499                         </actions>
6500                 </permacrud>
6501         </class>
6502         <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">
6503                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6504                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6505                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6506                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6507                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6508                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6509                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6510                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6511                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6512                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6513                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6514                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6515                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6516                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6517                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6518                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6519                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6520                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6521                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6522                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6523                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6524                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6525                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6526                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6527                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6528                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6529                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6530                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6531                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6532                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6533                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6534                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6535                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6536                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6537                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6538                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6539                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6540                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6541                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6542                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6543                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6544                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6545                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6546                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6547                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6548                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6549                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6550                 </fields>
6551                 <links>
6552                         <link field="age_protect" reltype="might_have" key="id" map="" class="crahp"/>
6553                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6554                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6555                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6556                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6557                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6558                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6559                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6560                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6561                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6562                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6563                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6564                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
6565                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
6566                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6567                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6568                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6569                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6570                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6571                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6572                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6573                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6574                 </links>
6575         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6576             <actions>
6577                 <create permission="CREATE_COPY">
6578                     <context link="call_number" field="owning_lib"/>
6579                 </create>
6580                 <retrieve/>
6581                 <update permission="UPDATE_COPY">
6582                     <context link="call_number" field="owning_lib"/>
6583                 </update>
6584                 <delete permission="DELETE_COPY">
6585                     <context link="call_number" field="owning_lib"/>
6586                 </delete>
6587             </actions>
6588         </permacrud>
6589         </class>
6590
6591         <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">
6592                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6593                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6594                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6595                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6596                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6597                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6598                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6599                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6600                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6601                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6602                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6603                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6604                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6605                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6606                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6607                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6608                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6609                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6610                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6611                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6612                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6613                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6614                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6615                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6616                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6617                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6618                 </fields>
6619                 <links>
6620                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6621                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6622                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6623                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6624                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6625                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6626                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6627                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6628                 </links>
6629                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6630                         <actions>
6631                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6632                                 <retrieve />
6633                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6634                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6635                         </actions>
6636                 </permacrud>
6637         </class>
6638
6639         <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">
6640                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6641                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6642                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6643                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6644                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6645                 </fields>
6646                 <links/>
6647         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6648             <actions>
6649                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6650                 <retrieve/>
6651                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6652                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6653             </actions>
6654         </permacrud>
6655         </class>
6656         <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">
6657                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6658                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6659                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6660                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6661                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6662                 </fields>
6663                 <links/>
6664         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6665             <actions>
6666                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6667                 <retrieve/>
6668                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6669                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6670             </actions>
6671         </permacrud>
6672         </class>
6673         <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">
6674                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6675                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6676                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6677                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6678                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6679                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6680                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6681                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6682                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6683                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6684                 </fields>
6685                 <links>
6686                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6687                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6688                 </links>
6689         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6690             <actions>
6691                 <create permission="CREATE_PERM" global_required="true"/>
6692                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6693                 <update permission="UPDATE_PERM" global_required="true"/>
6694                 <delete permission="DELETE_PERM" global_required="true"/>
6695             </actions>
6696         </permacrud>
6697         </class>
6698         <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">
6699                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6700                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6701                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
6702                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
6703                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
6704                 </fields>
6705                 <links>
6706                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
6707                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
6708                 </links>
6709         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6710             <actions>
6711                 <create permission="ADMIN_SURVEY">
6712                     <context link="question" jump="survey" field="owner"/>
6713                 </create>
6714                 <retrieve/>
6715                 <update permission="ADMIN_SURVEY">
6716                     <context link="question" jump="survey" field="owner"/>
6717                 </update>
6718                 <delete permission="ADMIN_SURVEY">
6719                     <context link="question" jump="survey" field="owner"/>
6720                 </delete>
6721             </actions>
6722         </permacrud>
6723         </class>
6724         <class id="ancc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
6725                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
6726                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6727                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
6728                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
6729                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
6730                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
6731                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
6732                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
6733                 </fields>
6734                 <links>
6735                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
6736                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
6737                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
6738                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6739                 </links>
6740                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6741                         <actions>
6742                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
6743                         </actions>
6744                 </permacrud>
6745         </class>
6746         <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">
6747                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6748                         <field name="balance_owed" reporter:datatype="money" />
6749                         <field name="total_owed" reporter:datatype="money" />
6750                         <field name="total_paid" reporter:datatype="money" />
6751                         <field name="usr" reporter:datatype="link"/>
6752                 </fields>
6753                 <links>
6754                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6755                 </links>
6756         </class>
6757         <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">
6758                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
6759                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
6760                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
6761                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
6762                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
6763                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
6764                 </fields>
6765                 <links>
6766                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6767                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6768                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6769                 </links>
6770         </class>
6771         <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">
6772                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
6773                         <field name="field" reporter:datatype="link"/>
6774                         <field name="id" reporter:datatype="id" />
6775                         <field name="source" reporter:datatype="link"/>
6776                         <field name="value" reporter:datatype="text"/>
6777                 </fields>
6778                 <links>
6779                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6780                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6781                 </links>
6782         </class>
6783         <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">
6784                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
6785                         <field name="field" reporter:datatype="link"/>
6786                         <field name="id" reporter:datatype="id" />
6787                         <field name="source" reporter:datatype="link"/>
6788                         <field name="value" reporter:datatype="text"/>
6789                 </fields>
6790                 <links>
6791                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6792                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6793                 </links>
6794         </class>
6795         <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">
6796                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
6797                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6798                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
6799                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
6800                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
6801                 </fields>
6802                 <links>
6803                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
6804                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6805                 </links>
6806         </class>
6807         <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">
6808                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
6809                         <field name="depth" reporter:datatype="int" />
6810                         <field name="grantable" reporter:datatype="bool"/>
6811                         <field name="grp" reporter:datatype="link"/>
6812                         <field name="id" reporter:datatype="id" />
6813                         <field name="perm" reporter:datatype="link"/>
6814                 </fields>
6815                 <links>
6816                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
6817                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6818                 </links>
6819         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6820             <actions>
6821                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
6822                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
6823                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
6824                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
6825             </actions>
6826         </permacrud>
6827         </class>
6828         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
6829                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
6830                         <field name="items" oils_persist:virtual="true" />
6831                         <field name="btype" reporter:datatype="text"/>
6832                         <field name="id" reporter:datatype="id" />
6833                         <field name="name" reporter:datatype="text"/>
6834                         <field name="description" reporter:datatype="text"/>
6835                         <field name="owner" reporter:datatype="link"/>
6836                         <field name="pub" reporter:datatype="bool"/>
6837                         <field name="create_time" reporter:datatype="timestamp" />
6838                 </fields>
6839                 <links>
6840                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6841                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
6842                 </links>
6843         </class>
6844         <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">
6845                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
6846                         <field name="id" reporter:datatype="id" />
6847                         <field name="bucket" reporter:datatype="link"/>
6848                         <field name="note" reporter:datatype="text" />
6849                 </fields>
6850                 <links>
6851                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
6852                 </links>
6853         </class>
6854         <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">
6855                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
6856                         <field name="id" reporter:datatype="int" />
6857                         <field name="usr" reporter:datatype="link"/>
6858                         <field name="work_ou" reporter:datatype="link"/>
6859                 </fields>
6860                 <links>
6861                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6862                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
6863                 </links>
6864         </class>
6865         <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">
6866                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
6867                         <field name="depth" reporter:datatype="int"/>
6868                         <field name="grantable" reporter:datatype="bool"/>
6869                         <field name="id" reporter:datatype="id" />
6870                         <field name="perm" reporter:datatype="link"/>
6871                         <field name="usr" reporter:datatype="link"/>
6872                 </fields>
6873                 <links>
6874                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6875                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6876                 </links>
6877         </class>
6878         <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">
6879                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
6880                         <field name="object_id" reporter:datatype="text"/>
6881                         <field name="grantable" reporter:datatype="bool"/>
6882                         <field name="id" reporter:datatype="id" />
6883                         <field name="perm" reporter:datatype="link"/>
6884                         <field name="usr" reporter:datatype="link"/>
6885                         <field name="object_type" reporter:datatype="text"/>
6886                 </fields>
6887                 <links>
6888                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6889                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6890                 </links>
6891         </class>
6892         <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">
6893                 <fields oils_persist:primary="id" oils_persist:sequence="">
6894                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6895                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6896                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6897                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6898                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6899                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6900                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6901                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6902                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6903                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6904                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6905                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6906                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6907                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6908                 </fields>
6909                 <links>
6910                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6911                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6912                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6913                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6914                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6915                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6916                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6917                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6918                 </links>
6919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6920             <actions>
6921                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6922                     <context link="xact" jump="usr" field="home_ou"/>
6923                 </retrieve>
6924                         </actions>
6925                 </permacrud>
6926         </class>
6927         <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">
6928                 <fields oils_persist:primary="id" oils_persist:sequence="">
6929                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6930                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6931                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6932                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6933                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6934                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6935                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6936                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6937                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6938                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6939                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6940                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6941                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6942                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6943                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6944                 </fields>
6945                 <links>
6946                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6947                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6948                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6949                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6950                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6951                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6952                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6953                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6954                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6955                 </links>
6956         </class>
6957         <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">
6958                 <fields oils_persist:primary="id" oils_persist:sequence="">
6959                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6960                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6961                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6962                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6963                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6964                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6965                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6966                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6967                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6968                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6969                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6970                 </fields>
6971                 <links>
6972                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6973                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6974                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6975                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6976                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6977                 </links>
6978         </class>
6979         <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">
6980                 <fields oils_persist:primary="id" oils_persist:sequence="">
6981                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6982                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6983                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6984                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6985                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6986                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6987                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6988                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
6989                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6990                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6991                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6992                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6993                 </fields>
6994                 <links>
6995                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6996                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6997                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6998                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6999                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7000                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7001                 </links>
7002         </class>
7003         <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">
7004                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
7005                         <field name="bucket" reporter:datatype="link"/>
7006                         <field name="id" reporter:datatype="id" />
7007                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
7008                         <field name="create_time" reporter:datatype="timestamp" />
7009                         <field name="pos" reporter:datatype="int" />
7010                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7011                 </fields>
7012                 <links>
7013                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
7014                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
7015             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
7016                 </links>
7017         </class>
7018         <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">
7019                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
7020                         <field name="id" reporter:datatype="id" />
7021                         <field name="item" reporter:datatype="link"/>
7022                         <field name="note" reporter:datatype="text" />
7023                 </fields>
7024                 <links>
7025                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
7026                 </links>
7027         </class>
7028         <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">
7029                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
7030                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
7031                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7032                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7033                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7034                 </fields>
7035                 <links>
7036                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7037                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7038                 </links>
7039         </class>
7040     <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">
7041         <fields oils_persist:primary="field">
7042             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7043             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7044             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7045         </fields>
7046         <links/>
7047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7048             <actions>
7049                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7050                 <retrieve />
7051                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7052                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7053             </actions>
7054         </permacrud>
7055     </class>
7056         <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">
7057                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7058                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7059                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7060                 </fields>
7061                 <links/>
7062         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7063             <actions>
7064                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7065                 <retrieve/>
7066                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7067                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7068             </actions>
7069         </permacrud>
7070         </class>
7071
7072
7073         <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">
7074                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7075                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7076                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7077                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7078                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7079                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7080                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7081                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7082                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7083                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7084                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7085                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7086                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7087                 </fields>
7088                 <links>
7089                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7090                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7091                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7092                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7093                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7094                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7095                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7096                 </links>
7097         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7098             <actions>
7099                 <create permission="TRANSIT_COPY">
7100                     <context link="target_copy" field="owner"/>
7101                 </create>
7102                 <retrieve/>
7103                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7104                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7105             </actions>
7106         </permacrud>
7107         </class>
7108         <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">
7109                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7110                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7111                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7112                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7113                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7114                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7115                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7116                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7117                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7118                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7119                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7120                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7121                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7122                 </fields>
7123                 <links>
7124                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7125                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7126                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7127                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7128                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7129                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7130                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7131                 </links>
7132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7133             <actions>
7134                 <create permission="TRANSIT_COPY" context_field="owner">
7135                     <context link="target_copy" field="circ_lib"/>
7136                 </create>
7137                 <retrieve/>
7138                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7139                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7140             </actions>
7141         </permacrud>
7142         </class>
7143         <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">
7144                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7145                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7146                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7147                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7148                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7149                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7150                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7151                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7152                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7153                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7154                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7155                 </fields>
7156                 <links>
7157                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7158                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7159                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7160                 </links>
7161         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7162             <actions>
7163                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7164                     <context link="xact" jump="usr" field="home_ou"/>
7165                 </retrieve>
7166                         </actions>
7167                 </permacrud>
7168         </class>
7169         <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">
7170                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7171                         <field name="grp" />
7172                         <field name="id" reporter:datatype="id" />
7173                         <field name="usr" />
7174                 </fields>
7175                 <links>
7176                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7177                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7178                 </links>
7179         </class>
7180         <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">
7181                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7182                         <field name="id" reporter:datatype="id" />
7183                         <field name="fq_field" reporter:datatype="text"/>
7184                         <field name="identity_value" reporter:datatype="text"/>
7185                         <field name="translation" reporter:datatype="text"/>
7186                         <field name="string" reporter:datatype="text"/>
7187                 </fields>
7188                 <links>
7189                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7190                 </links>
7191         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7192             <actions>
7193                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7194                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7195                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7196                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7197             </actions>
7198         </permacrud>
7199         </class>
7200         <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">
7201                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7202                         <field name="id" reporter:datatype="id" />
7203                         <field name="fm_class" reporter:datatype="text"/>
7204                         <field name="field" reporter:datatype="text"/>
7205                         <field name="owner" reporter:datatype="org_unit"/>
7206                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7207                 </fields>
7208                 <links>
7209                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7210                 </links>
7211         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7212             <actions>
7213                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7214                 <retrieve/>
7215                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7216                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7217             </actions>
7218         </permacrud>
7219         </class>
7220         <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">
7221                 <fields oils_persist:primary="code">
7222                         <field name="code" reporter:datatype="id" />
7223                         <field name="marc_code" reporter:datatype="text"/>
7224                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7225                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7226                 </fields>
7227                 <links/>
7228         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7229             <actions>
7230                 <create permission="CREATE_LOCALE" global_required="true"/>
7231                 <retrieve/>
7232                 <update permission="UPDATE_LOCALE" global_required="true"/>
7233                 <delete permission="DELETE_LOCALE" global_required="true"/>
7234             </actions>
7235         </permacrud>
7236         </class>
7237         <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">
7238                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7239                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7240                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7241                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7242             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7243                 </fields>
7244                 <links>
7245                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7246                 </links>
7247         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7248             <actions>
7249                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7250                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7251                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7252                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7253             </actions>
7254         </permacrud>
7255         </class>
7256
7257         <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">
7258                 <fields oils_persist:primary="id">
7259                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7260                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7261                 </fields>
7262                 <links/>
7263         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7264             <actions>
7265                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7266                 <retrieve/>
7267                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7268                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7269             </actions>
7270         </permacrud>
7271         </class>
7272
7273         <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">
7274                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7275                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7276                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7277                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7278                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7279                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7280                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7281                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7282                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7283                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7284                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7285                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7286                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7287                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7288                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7289                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7290                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7291                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7292                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7293                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7294                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7295                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7296                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7297                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7298                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7299                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7300                 </fields>
7301                 <links>
7302                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7303                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7304                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7305                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7306                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7307                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7308                 </links>
7309         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7310             <actions>
7311                 <create permission="user_request.create">
7312                     <context link="usr" field="home_ou"/>
7313                                 </create>
7314                 <retrieve permission="user_request.view">
7315                     <context link="usr" field="home_ou"/>
7316                                 </retrieve>
7317                 <update permission="user_request.update">
7318                     <context link="usr" field="home_ou"/>
7319                                 </update>
7320                 <delete permission="user_request.delete">
7321                     <context link="usr" field="home_ou"/>
7322                                 </delete>
7323             </actions>
7324         </permacrud>
7325         </class>
7326
7327         <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">
7328                 <fields oils_persist:primary="code">
7329                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7330                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7331                 </fields>
7332                 <links/>
7333         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7334             <actions>
7335                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7336                 <retrieve/>
7337                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7338                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7339             </actions>
7340         </permacrud>
7341         </class>
7342
7343         <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">
7344                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7345                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7346                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7347                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7348                         <field reporter:label="Ratio" name="ratio" />
7349                 </fields>
7350                 <links>
7351                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7352                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7353                 </links>
7354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7355                         <actions>
7356                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7357                                 <retrieve/>
7358                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7359                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7360                         </actions>
7361                 </permacrud>
7362         </class>
7363
7364         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7365                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7366                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7367                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7368                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7369                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7370                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7371                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7372                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7373                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7374                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7375                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7376                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7377                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7378                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7379                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7380                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7381                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7382                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7383                 </fields>
7384                 <links>
7385                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7386                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7387             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7388             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7389             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7390                 </links>
7391         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7392             <actions>
7393                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7394                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7395                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7396                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7397             </actions>
7398         </permacrud>
7399         </class>
7400
7401         <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">
7402                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7403                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7404                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7405                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7406                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7407                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7408                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7409                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7410                 </fields>
7411                 <links>
7412                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7413                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7414                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7415                 </links>
7416         </class>
7417
7418         <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">
7419                 <fields oils_persist:primary="code">
7420                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7421                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7422                 </fields>
7423                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7424             <actions>
7425                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7426                 <retrieve/>
7427                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7428                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7429             </actions>
7430                 </permacrud>
7431         </class>
7432
7433         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7434                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7435                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7436                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7437                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7438                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7439                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7440                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7441                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7442                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7443                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7444                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7445                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7446                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7447                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7448                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7449                 </fields>
7450                 <links>
7451                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7452                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7453                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7454                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7455                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7456                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7457                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7458                 </links>
7459         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7460             <actions>
7461                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7462                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7463                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7464                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7465             </actions>
7466         </permacrud>
7467         </class>
7468
7469         <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">
7470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7471                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7472                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7473                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7474                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7475                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7476                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7477                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7478                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7479                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7480                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7481                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7482                 </fields>
7483                 <links>
7484                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7485                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7486                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7487                 </links>
7488         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7489             <actions>
7490                 <create   permission="ADMIN_INVOICE">
7491                                         <context link="invoice" field="receiver"/>
7492                                 </create>
7493                 <retrieve permission="ADMIN_INVOICE">
7494                                         <context link="invoice" field="receiver"/>
7495                                 </retrieve>
7496                 <update   permission="ADMIN_INVOICE">
7497                                         <context link="invoice" field="receiver"/>
7498                                 </update>
7499                                 <delete   permission="ADMIN_INVOICE">
7500                                         <context link="invoice" field="receiver"/>
7501                                 </delete>
7502             </actions>
7503         </permacrud>
7504         </class>
7505
7506         <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">
7507                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7508                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7509                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7510                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7511                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7512                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7513                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7514                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7515                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7516                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7517                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7518                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7519                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7520                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7521                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7522                 </fields>
7523                 <links>
7524                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7525                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7526                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7527                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7528                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7529                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7530                 </links>
7531         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7532             <actions>
7533                 <create   permission="ADMIN_INVOICE">
7534                                         <context link="invoice" field="receiver"/>
7535                                 </create>
7536                 <retrieve permission="ADMIN_INVOICE">
7537                                         <context link="invoice" field="receiver"/>
7538                                 </retrieve>
7539                 <update   permission="ADMIN_INVOICE">
7540                                         <context link="invoice" field="receiver"/>
7541                                 </update>
7542                                 <delete   permission="ADMIN_INVOICE">
7543                                         <context link="invoice" field="receiver"/>
7544                                 </delete>
7545             </actions>
7546         </permacrud>
7547         </class>
7548
7549         <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">
7550                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7551                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7552                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7553                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7554                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7555                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7556                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7557                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7558                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7559                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7560                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7561                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7562                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7563                 </fields>
7564                 <links>
7565                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7566                 </links>
7567         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7568             <actions>
7569                 <create permission="ADMIN_PROVIDER">
7570                     <context link="provider" field="owner"/>
7571                 </create>
7572                 <retrieve permission="ADMIN_PROVIDER">
7573                     <context link="provider" field="owner"/>
7574                 </retrieve>
7575                 <update permission="ADMIN_PROVIDER">
7576                     <context link="provider" field="owner"/>
7577                 </update>
7578                 <delete permission="ADMIN_PROVIDER">
7579                     <context link="provider" field="owner"/>
7580                 </delete>
7581             </actions>
7582         </permacrud>
7583         </class>
7584
7585         <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">
7586                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7587                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7588                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7589                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7590                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7591                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7592                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7593         </fields>
7594                 <links>
7595                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7596                 </links>
7597         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7598             <actions>
7599                 <create permission="ADMIN_PROVIDER">
7600                     <context link="provider" field="owner"/>
7601                 </create>
7602                 <retrieve permission="ADMIN_PROVIDER">
7603                     <context link="provider" field="owner"/>
7604                 </retrieve>
7605                 <update permission="ADMIN_PROVIDER">
7606                     <context link="provider" field="owner"/>
7607                 </update>
7608                 <delete permission="ADMIN_PROVIDER">
7609                     <context link="provider" field="owner"/>
7610                 </delete>
7611             </actions>
7612         </permacrud>
7613     </class>
7614         <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">
7615                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7616                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7617                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7618                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7619                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7620                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7621                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7622                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7623                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7624                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7625                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7626                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7627                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7628                 </fields>
7629                 <links>
7630                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7631                 </links>
7632         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7633             <actions>
7634                 <create permission="ADMIN_PROVIDER">
7635                     <context link="contact" jump='provider' field="owner"/>
7636                 </create>
7637                 <retrieve permission="ADMIN_PROVIDER">
7638                     <context link="contact" jump='provider' field="owner"/>
7639                 </retrieve>
7640                 <update permission="ADMIN_PROVIDER">
7641                     <context link="contact" jump='provider' field="owner"/>
7642                 </update>
7643                 <delete permission="ADMIN_PROVIDER">
7644                     <context link="contact" jump='provider' field="owner"/>
7645                 </delete>
7646             </actions>
7647         </permacrud>
7648         </class>
7649
7650         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7651                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7652                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7653                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7654                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7655                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7656                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7657                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7658                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7659                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7660                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7661                 </fields>
7662                 <links>
7663                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7664                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7665                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7666                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7667                 </links>
7668         </class>
7669
7670         <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">
7671                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7672                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7673                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7674                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7675                 </fields>
7676                 <links>
7677             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7678                 </links>
7679                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7680                         <actions>
7681                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7682                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7683                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7684                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7685                         </actions>
7686                 </permacrud>
7687         </class>
7688
7689         <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">
7690                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
7691                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
7692                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
7693                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
7694                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
7695                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
7696                 </fields>
7697                 <links>
7698                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7699                 </links>
7700                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7701                         <actions>
7702                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7703                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7704                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7705                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7706                         </actions>
7707                 </permacrud>
7708         </class>
7709
7710         <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">
7711                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
7712                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7713                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7714                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7715                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7716                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7717                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7718                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7719                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
7720                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7721                 </fields>
7722                 <links>
7723                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7724                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7725             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
7726             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
7727                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
7728                 </links>
7729         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7730             <actions>
7731                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7732                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
7733                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7734                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7735             </actions>
7736         </permacrud>
7737         </class>
7738
7739         <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">
7740                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
7741                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
7742                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
7743                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7744                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7745                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
7746                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
7747                 </fields>
7748                 <links>
7749                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7750                 </links>
7751                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7752                         <actions>
7753                                 <create permission="ADMIN_FUNDING_SOURCE">
7754                     <context link="funding_source" field="owner"/>
7755                 </create>
7756                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
7757                     <context link="funding_source" field="owner"/>
7758                 </retrieve>
7759                                 <update permission="ADMIN_FUNDING_SOURCE">
7760                     <context link="funding_source" field="owner"/>
7761                 </update>
7762                                 <delete permission="ADMIN_FUNDING_SOURCE">
7763                     <context link="funding_source" field="owner"/>
7764                 </delete>
7765                         </actions>
7766                 </permacrud>
7767         </class>
7768
7769         <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">
7770                 <fields oils_persist:primary="id">
7771                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
7772                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
7773                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
7774                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
7775                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
7776                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7777                 </fields>
7778                 <links>
7779                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7780                 </links>
7781         </class>
7782
7783         <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">
7784                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
7785                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
7786                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7787                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
7788                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
7789                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7790                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
7791                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
7792                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7793                 </fields>
7794                 <links>
7795                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7796                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7797                 </links>
7798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7799                         <actions>
7800                                 <create permission="ADMIN_ACQ_FUND">
7801                     <context link="fund" field="org"/>
7802                 </create>
7803                                 <retrieve permission="ADMIN_ACQ_FUND">
7804                     <context link="fund" field="org"/>
7805                 </retrieve>
7806                                 <update permission="ADMIN_ACQ_FUND">
7807                     <context link="fund" field="org"/>
7808                 </update>
7809                                 <delete permission="ADMIN_ACQ_FUND">
7810                     <context link="fund" field="org"/>
7811                 </delete>
7812                         </actions>
7813                 </permacrud>
7814         </class>
7815
7816         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
7817                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
7818                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7819                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
7820                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7821                         <field reporter:label="Year" name="year" reporter:datatype="int" />
7822                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
7823                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7824                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
7825                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
7826                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7827                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
7828                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
7829                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7830                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7831                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
7832                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7833                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
7834                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
7835                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
7836                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
7837                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7838                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7839                 </fields>
7840                 <links>
7841                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7842                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7843             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
7844             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
7845             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
7846             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
7847             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
7848             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
7849             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
7850             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
7851             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
7852                 </links>
7853         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
7854             <actions>
7855                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
7856                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
7857                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
7858                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
7859             </actions>
7860         </permacrud>
7861         </class>
7862
7863         <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">
7864                 <fields oils_persist:primary="fund">
7865                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7866                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7867                 </fields>
7868                 <links>
7869                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7870                 </links>
7871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7872             <actions>
7873                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7874                                         <context link="fund" field="org" />
7875                 </retrieve>
7876             </actions>
7877         </permacrud>
7878         </class>
7879
7880         <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">
7881                 <fields oils_persist:primary="fund">
7882                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7883                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
7884                 </fields>
7885                 <links>
7886                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7887                 </links>
7888         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7889             <actions>
7890                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7891                                         <context link="fund" field="org" />
7892                 </retrieve>
7893             </actions>
7894         </permacrud>
7895         </class>
7896
7897         <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">
7898                 <fields oils_persist:primary="fund">
7899                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7900                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
7901                 </fields>
7902                 <links>
7903                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7904                 </links>
7905         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7906             <actions>
7907                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7908                                         <context link="fund" field="org" />
7909                 </retrieve>
7910             </actions>
7911         </permacrud>
7912         </class>
7913
7914         <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">
7915                 <fields oils_persist:primary="fund">
7916                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7917                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7918                 </fields>
7919                 <links>
7920                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7921                 </links>
7922         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7923             <actions>
7924                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7925                                         <context link="fund" field="org" />
7926                 </retrieve>
7927             </actions>
7928         </permacrud>
7929         </class>
7930
7931         <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">
7932                 <fields oils_persist:primary="fund">
7933                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7934                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
7935                 </fields>
7936                 <links>
7937                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7938                 </links>
7939         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7940             <actions>
7941                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7942                                         <context link="fund" field="org" />
7943                 </retrieve>
7944             </actions>
7945         </permacrud>
7946         </class>
7947
7948    <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">
7949         <fields oils_persist:primary="fund">
7950             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7951             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7952         </fields>
7953         <links>
7954             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7955         </links>
7956     </class>
7957
7958    <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">
7959         <fields oils_persist:primary="fund">
7960             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7961             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
7962         </fields>
7963         <links>
7964             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7965         </links>
7966     </class>
7967
7968    <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">
7969         <fields oils_persist:primary="fund">
7970             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7971             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7972         </fields>
7973         <links>
7974             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7975         </links>
7976     </class>
7977
7978    <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">
7979         <fields oils_persist:primary="fund">
7980             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7981             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
7982         </fields>
7983         <links>
7984             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7985         </links>
7986     </class>
7987
7988    <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">
7989         <fields oils_persist:primary="fund">
7990             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7991             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
7992         </fields>
7993         <links>
7994             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7995         </links>
7996     </class>
7997
7998         <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">
7999                 <fields oils_persist:primary="funding_source">
8000                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8001                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
8002                 </fields>
8003                 <links>
8004                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8005                 </links>
8006         </class>
8007
8008         <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">
8009                 <fields oils_persist:primary="funding_source">
8010                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8011                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
8012                 </fields>
8013                 <links>
8014                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8015                 </links>
8016         </class>
8017
8018         <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">
8019                 <fields oils_persist:primary="funding_source">
8020                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8021                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
8022                 </fields>
8023                 <links>
8024                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8025                 </links>
8026         </class>
8027
8028         <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">
8029                 <fields oils_persist:primary="fund">
8030                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8031                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
8032                 </fields>
8033                 <links>
8034                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8035                 </links>
8036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8037             <actions>
8038                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8039                                         <context link="fund" field="org" />
8040                 </retrieve>
8041             </actions>
8042         </permacrud>
8043     </class>
8044     <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">
8045         <oils_persist:source_definition><![CDATA[
8046             SELECT
8047                 acqf.*,
8048                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8049                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8050                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8051                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8052             FROM
8053                 acq.fund acqf
8054                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8055                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8056                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8057                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8058         ]]></oils_persist:source_definition>
8059         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8060             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8061             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8062             <field reporter:label="Name" name="name" reporter:datatype="text" />
8063             <field reporter:label="Year" name="year" reporter:datatype="int" />
8064             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8065             <field reporter:label="Code" name="code" reporter:datatype="text" />
8066             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8067             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8068             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8069             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8070             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8071
8072             <!-- non fund-native fields -->
8073             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8074             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8075             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8076             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8077         </fields>
8078         <links>
8079             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8080             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8081             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8082         </links>
8083         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8084             <actions>
8085                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8086             </actions>
8087         </permacrud>
8088         </class>
8089         <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">
8090                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8091                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8092                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8093                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8094                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8095                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8096                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8097                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8098                 </fields>
8099                 <links>
8100                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8101                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8102                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8103                 </links>
8104                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8105                         <actions>
8106                                 <create permission="ADMIN_ACQ_FUND">
8107                     <context link="fund" field="org"/>
8108                 </create>
8109                                 <retrieve permission="ADMIN_ACQ_FUND">
8110                     <context link="fund" field="org"/>
8111                 </retrieve>
8112                                 <update permission="ADMIN_ACQ_FUND">
8113                     <context link="fund" field="org"/>
8114                 </update>
8115                                 <delete permission="ADMIN_ACQ_FUND">
8116                     <context link="fund" field="org"/>
8117                 </delete>
8118                         </actions>
8119                 </permacrud>
8120         </class>
8121
8122     <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">
8123         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8124             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8125             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8126             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8127             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8128             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8129             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8130             <field reporter:label="Note" name="note" reporter:datatype="text" />
8131             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8132         </fields>
8133         <links>
8134             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8135             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8136             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8137         </links>
8138                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8139                         <actions>
8140                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8141                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8142                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8143                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8144                         </actions>
8145                 </permacrud>
8146     </class>
8147
8148         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8149                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8150                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8151                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8152                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8153                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8154                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8155                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8156                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8157                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8158                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8159                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8160                 </fields>
8161                 <links>
8162                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8163                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8164                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8165                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8166                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8167                 </links>
8168                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8169                         <actions>
8170                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8171                         </actions>
8172                 </permacrud>
8173         </class>
8174
8175         <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">
8176                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8177                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8178                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8179                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8180                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8181                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8182                 </fields>
8183                 <links>
8184                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8185                 </links>
8186                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8187                         <actions>
8188                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8189                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8190                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8191                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8192                         </actions>
8193                 </permacrud>
8194         </class>
8195
8196         <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">
8197                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8198                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8199                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8200                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8201                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8202                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8203                         <field reporter:label="State" name="state" reporter:datatype="text" />
8204                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8205                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8206                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8207                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8208                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8209                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8210                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8211                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8212                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8213                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8214                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8215                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8216                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8217                 </fields>
8218                 <links>
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="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8223                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8224                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8225                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8226                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8227                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8228                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8229                 </links>
8230                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8231                         <actions>
8232                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8233                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8234                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8235                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8236                         </actions>
8237                 </permacrud>
8238         </class>
8239
8240         <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">
8241                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8242                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8243                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8244                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8245                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8246                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8247                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8248                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8249                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8250                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8251                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8252                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8253                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8254                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8255                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8256                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8257                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8258                 </fields>
8259                 <links>
8260                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8261                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8262                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8263                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8264                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8265                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8266                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8267                 </links>
8268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8269             <actions>
8270                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8271             </actions>
8272                 </permacrud>
8273         </class>
8274
8275         <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">
8276                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8277                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8278                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8279                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8280                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8281                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8282                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8283                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8284                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8285                 </fields>
8286                 <links>
8287                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8288                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8289                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8290                 </links>
8291                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8292             <actions>
8293                 <create permission="CREATE_PURCHASE_ORDER">
8294                     <context link="purchase_order" field="ordering_agency"/>
8295                 </create>
8296                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8297                     <context link="purchase_order" field="ordering_agency"/>
8298                 </retrieve>
8299                 <update permission="CREATE_PURCHASE_ORDER">
8300                     <context link="purchase_order" field="ordering_agency"/>
8301                 </update>
8302                 <delete permission="CREATE_PURCHASE_ORDER">
8303                     <context link="purchase_order" field="ordering_agency"/>
8304                 </delete>
8305             </actions>
8306                 </permacrud>
8307         </class>
8308
8309         <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">
8310                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8311                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8312                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8313                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8314                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8315                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8316                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8317                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8318                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8319                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8320                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8321                 </fields>
8322                 <links>
8323                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8324                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8325                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8326                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8327                 </links>
8328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8329             <actions>
8330                 <create permission="CREATE_PURCHASE_ORDER">
8331                     <context link="purchase_order" field="ordering_agency"/>
8332                 </create>
8333                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8334                     <context link="purchase_order" field="ordering_agency"/>
8335                 </retrieve>
8336                 <update permission="CREATE_PURCHASE_ORDER">
8337                     <context link="purchase_order" field="ordering_agency"/>
8338                 </update>
8339                 <delete permission="CREATE_PURCHASE_ORDER">
8340                     <context link="purchase_order" field="ordering_agency"/>
8341                 </delete>
8342             </actions>
8343                 </permacrud>
8344         </class>
8345
8346         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8347                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8348                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8349                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8350                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8351                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8352                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8353                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8354                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8355                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8356                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8357                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8358                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8359                         <field reporter:label="State" name="state" reporter:datatype="text" />
8360                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8361                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8362                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8363                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8364                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8365                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8366                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8367                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8368                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8369                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8370                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8371                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8372                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8373                 </fields>
8374                 <links>
8375                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8376                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8377                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8378                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8379                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8380                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8381                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8382                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8383                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8384                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8385                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8386                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8387                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8388                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8389                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8390                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8391                 </links>
8392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8393                         <actions>
8394                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8395                                         <context link="purchase_order" field="ordering_agency"/>
8396                                         <context link="picklist" field="org_unit"/>
8397                                 </retrieve>
8398                         </actions>
8399                 </permacrud>
8400         </class>
8401
8402         <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">
8403                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8404                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8405                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8406                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8407                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8408                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8409                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8410                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8411                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8412                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8413                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8414                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8415                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8416                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8417                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8418                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8419                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8420                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8421                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8422                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8423                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8424                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8425                 </fields>
8426                 <links>
8427                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8428                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8429                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8430                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8431                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8432                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8433                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8434                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8435                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8436                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8437                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8438                 </links>
8439                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8440                         <actions>
8441                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8442                                         <context link="purchase_order" field="ordering_agency"/>
8443                                         <context link="picklist" field="org_unit"/>
8444                                 </retrieve>
8445                         </actions>
8446                 </permacrud>
8447         </class>
8448
8449         <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">
8450                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8451                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8452                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8453                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8454                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8455                 </fields>
8456                 <links>
8457                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8458                 </links>
8459                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8460                         <actions>
8461                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8462                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8463                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8464                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8465                         </actions>
8466                 </permacrud>
8467         </class>
8468
8469         <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">
8470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8471                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8472                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8473                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8474                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8475                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8476                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8477                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8478                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8479                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8480                 </fields>
8481                 <links>
8482                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8483                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8484                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8485                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8486                 </links>
8487         </class>
8488
8489         <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">
8490                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8491                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8492                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8493                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8494                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8495                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8496                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8497                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8498                 </fields>
8499                 <links>
8500                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8501                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8502                 </links>
8503         </class>
8504
8505         <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">
8506                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8507                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8508                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8509                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8510                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8511                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8512                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8513                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8514                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8515                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8516                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8517                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8518                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8519                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8520                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8521                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8522                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8523                 </fields>
8524                 <links>
8525                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8526                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8527                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8528                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8529                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8530                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8531                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8532                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8533                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8534                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8535                 </links>
8536         </class>
8537
8538         <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">
8539                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8540                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8541                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8542                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8543                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8544                 </fields>
8545                 <links/>
8546                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8547                         <actions>
8548                                 <retrieve />
8549                         </actions>
8550                 </permacrud>
8551         </class>
8552
8553         <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">
8554                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8555                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8556                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8557                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8558                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8559                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8560             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8561                 </fields>
8562                 <links/>
8563         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8564             <actions>
8565                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8566                 <retrieve />
8567                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8568                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8569             </actions>
8570         </permacrud>
8571         </class>
8572
8573         <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">
8574                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8575                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8576                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8577                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8578                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8579                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8580                 </fields>
8581                 <links/>
8582         </class>
8583         <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">
8584                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8585                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8586                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8587                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8588                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8589                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8590                 </fields>
8591                 <links>
8592                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8593                 </links>
8594         </class>
8595
8596         <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">
8597             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8598                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8599                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8600                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8601                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8602                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8603                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8604         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8605
8606             </fields>
8607             <links>
8608                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8609             </links>
8610             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8611                 <actions>
8612                     <create permission="ADMIN_PROVIDER">
8613                         <context link="provider" field="owner"/>
8614                     </create>
8615                     <retrieve permission="ADMIN_PROVIDER">
8616                         <context link="provider" field="owner"/>
8617                     </retrieve>
8618                     <update permission="ADMIN_PROVIDER">
8619                         <context link="provider" field="owner"/>
8620                     </update>
8621                     <delete permission="ADMIN_PROVIDER">
8622                         <context link="provider" field="owner"/>
8623                     </delete>
8624                 </actions>
8625             </permacrud>
8626         </class>
8627         
8628         <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">
8629             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8630                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8631                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8632                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8633                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8634             </fields>
8635             <links>
8636                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8637             </links>
8638             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8639                 <actions>
8640                     <create permission="ADMIN_PROVIDER">
8641                         <context link="provider" field="owner"/>
8642                     </create>
8643                     <retrieve permission="ADMIN_PROVIDER">
8644                         <context link="provider" field="owner"/>
8645                     </retrieve>
8646                     <update permission="ADMIN_PROVIDER">
8647                         <context link="provider" field="owner"/>
8648                     </update>
8649                     <delete permission="ADMIN_PROVIDER">
8650                         <context link="provider" field="owner"/>
8651                     </delete>
8652                 </actions>
8653             </permacrud>
8654         </class>
8655         
8656         <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">
8657             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8658                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8659                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8660                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8661                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8662                 </fields>
8663                 <links/>
8664         </class>
8665
8666         <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">
8667                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8668                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8669                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8670                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8671                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8672                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8673                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8674                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8675                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8676                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8677                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8678                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8679                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8680                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8681                 </fields>
8682                 <links>
8683                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8684                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8685                 </links>
8686         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8687             <actions>
8688                 <create permission="ADMIN_PROVIDER">
8689                     <context link="provider" field="owner"/>
8690                 </create>
8691                 <retrieve permission="ADMIN_PROVIDER">
8692                     <context link="provider" field="owner"/>
8693                 </retrieve>
8694                 <update permission="ADMIN_PROVIDER">
8695                     <context link="provider" field="owner"/>
8696                 </update>
8697                 <delete permission="ADMIN_PROVIDER">
8698                     <context link="provider" field="owner"/>
8699                 </delete>
8700             </actions>
8701         </permacrud>
8702         </class>
8703
8704         <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">
8705                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
8706                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
8707                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
8708                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
8709                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
8710                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
8711                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
8712                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
8713                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
8714                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
8715                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
8716                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
8717                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
8718                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
8719                 </fields>
8720                 <links>
8721                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
8722                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8723                 </links>
8724         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8725             <actions>
8726                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8727                     <context link="account" jump="provider" field="owner"/>
8728                 </retrieve>
8729                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8730                     <context link="account" jump="provider" field="owner"/>
8731                 </update>
8732                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8733                     <context link="account" jump="provider" field="owner"/>
8734                 </delete>
8735             </actions>
8736         </permacrud>
8737         </class>
8738
8739
8740         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
8741                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
8742                         <field name="id" reporter:datatype="id" />
8743                         <field name="parent" reporter:datatype="link"/>
8744                         <field name="owner" reporter:datatype="link"/>
8745                         <field name="create_time" reporter:datatype="timestamp"/>
8746                         <field name="name" reporter:datatype="text"/>
8747                         <field name="shared" reporter:datatype="bool"/>
8748                         <field name="share_with" reporter:datatype="link"/>
8749                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8750                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
8751                 </fields>
8752                 <links>
8753                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8754                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
8755                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
8756                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8757                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
8758                 </links>
8759         </class>
8760         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
8761                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
8762                         <field name="id" reporter:datatype="id" />
8763                         <field name="parent" reporter:datatype="link"/>
8764                         <field name="owner" reporter:datatype="link"/>
8765                         <field name="create_time" reporter:datatype="timestamp"/>
8766                         <field name="name" reporter:datatype="text"/>
8767                         <field name="shared" reporter:datatype="bool"/>
8768                         <field name="share_with" reporter:datatype="link"/>
8769                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8770                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
8771                 </fields>
8772                 <links>
8773                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8774                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
8775                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
8776                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8777                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
8778                 </links>
8779         </class>
8780         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
8781                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
8782                         <field name="id" reporter:datatype="id" />
8783                         <field name="parent" reporter:datatype="link"/>
8784                         <field name="owner" reporter:datatype="link"/>
8785                         <field name="create_time" reporter:datatype="timestamp"/>
8786                         <field name="name" reporter:datatype="text"/>
8787                         <field name="shared" reporter:datatype="bool"/>
8788                         <field name="share_with" reporter:datatype="link"/>
8789                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8790                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8791                 </fields>
8792                 <links>
8793                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8794                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
8795                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
8796                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8797                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
8798                 </links>
8799         </class>
8800         <class id="rt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
8801                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
8802                         <field name="id" reporter:datatype="id" />
8803                         <field name="owner" reporter:datatype="link"/>
8804                         <field name="create_time" reporter:datatype="timestamp"/>
8805                         <field name="name" reporter:datatype="text"/>
8806                         <field name="data" reporter:datatype="text"/>
8807                         <field name="folder" reporter:datatype="link"/>
8808                         <field name="description" reporter:datatype="text"/>
8809                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8810                 </fields>
8811                 <links>
8812                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8813                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
8814                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
8815                 </links>
8816         </class>
8817         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
8818                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
8819                         <field name="id" reporter:datatype="id" />
8820                         <field name="owner" reporter:datatype="link"/>
8821                         <field name="create_time" reporter:datatype="timestamp"/>
8822                         <field name="template" reporter:datatype="link"/>
8823                         <field name="data" reporter:datatype="text"/>
8824                         <field name="folder" reporter:datatype="link"/>
8825                         <field name="recur" reporter:datatype="bool"/>
8826                         <field name="recurrence" reporter:datatype="interval"/>
8827                         <field name="name" reporter:datatype="text"/>
8828                         <field name="description" reporter:datatype="text"/>
8829                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
8830                 </fields>
8831                 <links>
8832                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8833                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
8834                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
8835                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
8836                 </links>
8837         </class>
8838         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
8839                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
8840                         <field name="id" reporter:datatype="id" />
8841                         <field name="runner" reporter:datatype="link"/>
8842                         <field name="start_time" reporter:datatype="timestamp"/>
8843                         <field name="complete_time" reporter:datatype="timestamp"/>
8844                         <field name="run_time" reporter:datatype="timestamp"/>
8845                         <field name="email" reporter:datatype="text"/>
8846                         <field name="excel_format" reporter:datatype="bool"/>
8847                         <field name="csv_format" reporter:datatype="bool"/>
8848                         <field name="html_format" reporter:datatype="bool"/>
8849                         <field name="error_code" reporter:datatype="int"/>
8850                         <field name="error_text" reporter:datatype="text"/>
8851                         <field name="report" reporter:datatype="link"/>
8852                         <field name="folder" reporter:datatype="link"/>
8853                         <field name="chart_pie" reporter:datatype="bool"/>
8854                         <field name="chart_bar" reporter:datatype="bool"/>
8855                         <field name="chart_line" reporter:datatype="bool"/>
8856                 </fields>
8857                 <links>
8858                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
8859                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
8860                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
8861                 </links>
8862         </class>
8863         <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">
8864                 <fields oils_persist:primary="id">
8865                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8866                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8867                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8868                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8869                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8870                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8871                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8872                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8873                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8874                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8875                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8876                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8877                 </fields>
8878                 <links>
8879                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8880                 </links>
8881                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8882                         <actions>
8883                                 <retrieve />
8884                         </actions>
8885                 </permacrud>
8886         </class>
8887         <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">
8888                 <fields oils_persist:primary="id">
8889                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8890                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8891                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8892                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8893                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8894                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8895                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8896                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8897                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8898                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8899                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8900                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8901                 </fields>
8902                 <links>
8903                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8904                 </links>
8905         </class>
8906         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
8907                 <fields oils_persist:primary="id">
8908                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8909                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
8910                         <field reporter:label="Fingerprint" name="fingerprint" />
8911                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8912                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8913                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8914                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8915                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
8916                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8917                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8918                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8919                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
8920                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
8921                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
8922                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8923                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8924                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
8925                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
8926                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
8927                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
8928                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
8929                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
8930                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8931                 </fields>
8932                 <links>
8933                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
8934                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8935                 </links>
8936         </class>
8937         <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">
8938                 <fields oils_persist:primary="id">
8939                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
8940                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
8941                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
8942                 </fields>
8943                 <links>
8944                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
8945                 </links>
8946         </class>
8947         <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">
8948                 <fields oils_persist:primary="id">
8949                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
8950                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
8951                 </fields>
8952                 <links>
8953                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
8954                 </links>
8955         </class>
8956         <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">
8957                 <fields oils_persist:primary="id">
8958                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
8959                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
8960                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
8961                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
8962                 </fields>
8963                 <links>
8964                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
8965                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
8966                 </links>
8967         </class>
8968         <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">
8969                 <fields oils_persist:primary="xact">
8970                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8971                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
8972                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
8973                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
8974                 </fields>
8975                 <links>
8976                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8977                 </links>
8978         </class>
8979         <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">
8980                 <fields oils_persist:primary="xact">
8981                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8982                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
8983                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
8984                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
8985                 </fields>
8986                 <links>
8987                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8988                 </links>
8989         </class>
8990         <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)">
8991                 <fields oils_persist:primary="id">
8992                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
8993                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
8994                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
8995                 </fields>
8996                 <links>
8997                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
8998                 </links>
8999         </class>
9000         <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">
9001                 <fields oils_persist:primary="id">
9002                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
9003                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
9004                 </fields>
9005                 <links>
9006                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9007                 </links>
9008         </class>
9009         <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">
9010                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
9011                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
9012                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
9013                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
9014                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
9015                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
9016                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
9017                 </fields>
9018                 <links>
9019                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9020                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
9021                 </links>
9022                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9023                         <actions>
9024                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9025                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9026                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9027                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9028                         </actions>
9029                 </permacrud>
9030         </class>
9031         <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">
9032                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
9033                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9034                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9035                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9036                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9037                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9038                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9039                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9040                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9041                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9042                 </fields>
9043                 <links>
9044                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9045                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9046                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9047                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9048                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9049                 </links>
9050                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9051                         <actions>
9052                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9053                                         <context link="formula" field="owner"/>
9054                                 </create>
9055                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9056                                         <context link="formula" field="owner"/>
9057                                 </retrieve>
9058                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9059                                         <context link="formula" field="owner"/>
9060                                 </update>
9061                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9062                                         <context link="formula" field="owner"/>
9063                                 </delete>
9064                         </actions>
9065                 </permacrud>
9066         </class>
9067
9068         <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">
9069                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9070                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9071                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9072                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9073                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9074                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9075                 </fields>
9076                 <links>
9077                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9078                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9079                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9080                 </links>
9081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9082                         <actions>
9083                                 <create permission="CREATE_PURCHASE_ORDER">
9084                                         <context link="formula" field="owner"/>
9085                 </create>
9086                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9087                                         <context link="formula" field="owner"/>
9088                 </retrieve>
9089                                 <update permission="CREATE_PURCHASE_ORDER">
9090                                         <context link="formula" field="owner"/>
9091                 </update>
9092                                 <delete permission="CREATE_PURCHASE_ORDER">
9093                                         <context link="formula" field="owner"/>
9094                 </delete>
9095                         </actions>
9096                 </permacrud>
9097         </class>
9098
9099         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9100                 <fields oils_persist:primary="id">
9101                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9102                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9103                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9104                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9105                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9106                 </fields>
9107                 <links>
9108                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9109                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9110                 </links>
9111         </class>
9112
9113         <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">
9114                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9115                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9116                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9117                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9118                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9119                 </fields>
9120                 <links>
9121                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9122                 </links>
9123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9124                         <actions>
9125                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9126                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9127                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9128                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9129                         </actions>
9130                 </permacrud>
9131         </class>
9132
9133         <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">
9134                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9135                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9136                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9137                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9138                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9139                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9140                 </fields>
9141                 <links>
9142                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9143                 </links>
9144                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9145                         <actions>
9146                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9147                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9148                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9149                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9150                         </actions>
9151                 </permacrud>
9152         </class>
9153
9154         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9155                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9156                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9157                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9158                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9159                 </fields>
9160                 <links>
9161                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9162                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9163                 </links>
9164         </class>
9165
9166         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9167                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9168                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9169                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9170                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9171                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9172                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9173                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9174                 </fields>
9175                 <links>
9176                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9177                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9178                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9179                 </links>
9180         </class>
9181
9182         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9183                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9184                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9185                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9186                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9187                 </fields>
9188                 <links>
9189                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9190                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9191                 </links>
9192         </class>
9193
9194         <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">
9195                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9196                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9197                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9198                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9199                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9200                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9201                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9202                 </fields>
9203                 <links>
9204                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9205                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9206                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9207                 </links>
9208         </class>
9209
9210         <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">
9211                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9212                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9213                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9214                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9215                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9216                 </fields>
9217                 <links>
9218                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9219                 </links>
9220                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9221             <actions>
9222                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9223                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9224                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9225                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9226             </actions>
9227                 </permacrud>
9228         </class>
9229
9230         <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">
9231                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9232                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9233                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9234                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9235                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9236                 </fields>
9237                 <links>
9238                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9239                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9240                 </links>
9241                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9242                         <actions>
9243                                 <create permission="ADMIN_CLAIM_POLICY">
9244                                         <context link="claim_policy" field="org_unit"/>
9245                 </create>
9246                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9247                                         <context link="claim_policy" field="org_unit"/>
9248                 </retrieve>
9249                                 <update permission="ADMIN_CLAIM_POLICY">
9250                                         <context link="claim_policy" field="org_unit"/>
9251                 </update>
9252                                 <delete permission="ADMIN_CLAIM_POLICY">
9253                                         <context link="claim_policy" field="org_unit"/>
9254                 </delete>
9255                         </actions>
9256                 </permacrud>
9257         </class>
9258
9259     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9260         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9261             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9262             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9263             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9264             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9265             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9266             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9267             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9268             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9269             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9270             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9271             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9272             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9273             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9274             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9275             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9276             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9277         </fields>
9278         <links>
9279             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9280         </links>
9281     </class>
9282
9283     <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">
9284         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_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="Barcode" name="barcode" reporter:datatype="text"/>
9289             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9290         </fields>
9291     </class>
9292
9293     <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">
9294         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9295             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9296             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9297             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9298             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9299             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9300             <field reporter:label="City" name="city" reporter:datatype="text"/>
9301             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9302             <field reporter:label="State" name="state" reporter:datatype="text"/>
9303             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9304             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9305             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9306         </fields>
9307     </class>
9308
9309     <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">
9310         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9311             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9312             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9313             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9314             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9315             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9316             <field reporter:label="City" name="city" reporter:datatype="text"/>
9317             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9318             <field reporter:label="State" name="state" reporter:datatype="text"/>
9319             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9320             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9321             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9322         </fields>
9323     </class>
9324
9325     <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">
9326         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9327             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9328             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9329             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9330             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9331             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9332             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9333         </fields>
9334     </class>
9335
9336         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9337                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9338                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9339                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9340                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9341                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9342                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9343                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9344                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9345                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9346                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9347                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9348                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9349                 </fields>
9350                 <links>
9351                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9352                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9353                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9354                 </links>
9355         </class>
9356
9357         <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">
9358                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9359                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9360                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9361                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9362                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9363                 </fields>
9364                 <links>
9365                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9366                 </links>
9367         </class>
9368
9369     <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">
9370         <fields>
9371             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9372             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9373             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9374         </fields>
9375                 <links>
9376                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9377                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9378                 </links>
9379     </class>
9380
9381     <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">
9382         <fields>
9383             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9384             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9385         </fields>
9386                 <links>
9387                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9388                 </links>
9389     </class>
9390
9391     <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">
9392         <fields>
9393             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9394             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9395             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9396         </fields>
9397                 <links>
9398                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9399                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9400                 </links>
9401     </class>
9402
9403     <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">
9404         <fields>
9405             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9406             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
9407         </fields>
9408                 <links>
9409                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9410                 </links>
9411     </class>
9412
9413     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9414                 <oils_persist:source_definition>
9415
9416             SELECT  DISTINCT l.*
9417               FROM  action.unfulfilled_hold_loops l
9418                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9419               WHERE l.count = m.max
9420
9421                 </oils_persist:source_definition>
9422         <fields>
9423             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9424             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9425             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9426         </fields>
9427                 <links>
9428                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9429                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9430                 </links>
9431     </class>
9432
9433         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9434                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9435                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9436                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9437                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9438                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9439                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9440                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9441                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9442                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9443                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9444                 </fields>
9445                 <links>
9446                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9447                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9448                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9449                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9450                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9451                 </links>
9452         </class>
9453
9454         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9455                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9456                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9457                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9458                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9459                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9460                 </fields>
9461                 <links>
9462                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9463                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9464                 </links>
9465         </class>
9466
9467         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9468                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9469                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9470                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9471                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9472                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9473                 </fields>
9474                 <links>
9475                 </links>
9476         </class>
9477
9478         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9479                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9480                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9481                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9482                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9483                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9484                 </fields>
9485                 <links>
9486                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9487                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9488                 </links>
9489         </class>
9490         
9491         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9492                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9493                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9494                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9495                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9496                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9497                 </fields>
9498                 <links>
9499                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9500                 </links>
9501         </class>
9502         
9503         <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">
9504                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9505                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9506                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9507                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9508                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9509                 </fields>
9510                 <links>
9511                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9512                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9513                 </links>
9514         </class>
9515
9516         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9517                 <fields oils_persist:primary="name">
9518                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9519                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9520                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9521                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9522                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9523                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9524                 </fields>
9525                 <links>
9526                 </links>
9527         </class>
9528
9529         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9530                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9531                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9532                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9533                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9534                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9535                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9536                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9537                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9538                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9539                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9540                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9541                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9542                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9543                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9544                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9545                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9546                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9547                 </fields>
9548                 <links>
9549                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9550                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9551                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9552                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9553                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9554                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9555                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9556                 </links>
9557         </class>
9558
9559         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9560                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9561                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9562                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9563                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9564                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9565                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9566                 </fields>
9567                 <links>
9568                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9569                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9570                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9571                 </links>
9572         </class>
9573
9574         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9575                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9576                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9577                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9578                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9579                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9580                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9581                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9582                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9583                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9584                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9585                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9586                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9587                 </fields>
9588                 <links>
9589                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9590                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9591                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9592                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9593                 </links>
9594         </class>
9595
9596         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9597                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9598                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9599                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9600                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9601                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9602                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9603                 </fields>
9604                 <links>
9605                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9606                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9607                 </links>
9608         </class>
9609
9610         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9611                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9612                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9613                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9614                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9615                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9616                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9617                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9618                 </fields>
9619                 <links>
9620                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9621                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9622                 </links>
9623         </class>
9624
9625         <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">
9626                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9627                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9628                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9629                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9630                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9631                 </fields>
9632                 <links>
9633                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9634                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9635                 </links>
9636         </class>
9637
9638         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9639                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9640                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9641                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9642                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9643                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9644                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9645                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9646                 </fields>
9647                 <links>
9648                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9649                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9650                 </links>
9651         </class>
9652
9653         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9654                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9655                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9656                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9657                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9658                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9659                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9660                 </fields>
9661                 <links>
9662                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9663                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9664                 </links>
9665         </class>
9666
9667         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
9668                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9669                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9670                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9671                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9672                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9673                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9674                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9675                 </fields>
9676                 <links>
9677                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9678                 </links>
9679         </class>
9680
9681         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
9682                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9683                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9684                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9685                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9686                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9687                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9688                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9689                 </fields>
9690                 <links>
9691                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9692                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9693                 </links>
9694         </class>
9695
9696         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
9697                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9698                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9699                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9700                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9701                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9702                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9703                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9704                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9705                 </fields>
9706                 <links>
9707                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9708                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9709                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9710                 </links>
9711         </class>
9712
9713         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
9714                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9715                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9716                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9717                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9718                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9719                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9720                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9721                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9722                 </fields>
9723                 <links>
9724                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9725                 </links>
9726         </class>
9727
9728         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
9729                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9730                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9731                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9732                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9733                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9734                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9735                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9736                 </fields>
9737                 <links>
9738                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9739                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9740                 </links>
9741         </class>
9742
9743         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
9744                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9745                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9746                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9747                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9748                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9749                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9750                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9751                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9752                 </fields>
9753                 <links>
9754                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9755                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9756                 </links>
9757         </class>
9758
9759         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
9760                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9761                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9762                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9763                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9764                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9765                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9766                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9767                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9768                 </fields>
9769                 <links>
9770                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9771                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9772                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9773                 </links>
9774         </class>
9775
9776         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
9777                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9778                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9779                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9780                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9781                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9782                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9783                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9784                 </fields>
9785                 <links>
9786                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9787                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9788                 </links>
9789         </class>
9790
9791         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
9792                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9793                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9794                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9795                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9796                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9797                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9798                 </fields>
9799                 <links>
9800                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9801                 </links>
9802         </class>
9803
9804         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
9805                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9806                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9807                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9808                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9809                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9810                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9811                 </fields>
9812                 <links>
9813                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9814                 </links>
9815         </class>
9816
9817         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
9818                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9819                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9820                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9821                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9822                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9823                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9824                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9825                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9826                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9827                 </fields>
9828                 <links>
9829                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9830                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9831                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9832                 </links>
9833         </class>
9834
9835         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
9836                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9837                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9838                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9839                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9840                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9841                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9842                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9843                 </fields>
9844                 <links>
9845                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9846                 </links>
9847         </class>
9848
9849         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
9850                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9851                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9852                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9853                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9854                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9855                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9856                 </fields>
9857                 <links>
9858                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9859                 </links>
9860         </class>
9861
9862         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
9863                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9864                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9865                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9866                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9867                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9868                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9869                 </fields>
9870                 <links>
9871                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9872                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9873                 </links>
9874         </class>
9875
9876         <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">
9877                 <fields oils_persist:primary="id">
9878                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
9879                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
9880                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
9881                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
9882                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
9883                 </fields>
9884                 <links>
9885                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
9886                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9887                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
9888                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
9889                 </links>
9890         </class>
9891
9892         <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">
9893                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
9894                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9895                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
9896                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
9897                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
9898                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9899                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9900                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
9901                 </fields>
9902                 <links/>
9903                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9904                         <actions>
9905                                 <retrieve/>
9906                         </actions>
9907                 </permacrud>
9908         </class>
9909
9910         <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">
9911                 <fields oils_persist:primary="ptype_key">
9912                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
9913                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9914                 </fields>
9915                 <links/>
9916                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9917                         <actions>
9918                                 <retrieve/>
9919                         </actions>
9920                 </permacrud>
9921         </class>
9922
9923         <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">
9924                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
9925                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9926                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
9927                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
9928                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9929                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9930                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9931                 </fields>
9932                 <links>
9933                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
9934                 </links>
9935                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9936                         <actions>
9937                                 <retrieve/>
9938                         </actions>
9939                 </permacrud>
9940         </class>
9941
9942         <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">
9943                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
9944                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9945                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
9946                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
9947                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9948                 </fields>
9949                 <links>
9950                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9951                 </links>
9952                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9953                         <actions>
9954                                 <retrieve/>
9955                         </actions>
9956                 </permacrud>
9957         </class>
9958
9959     <class
9960         id="uvs"
9961         controller="open-ils.cstore open-ils.pcrud"
9962         oils_obj:fieldmapper="url_verify::session"
9963         oils_persist:tablename="url_verify.session"
9964         reporter:label="URL Verification Session"
9965     >
9966         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
9967             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
9968             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9969                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
9970             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9971             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
9972             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9973             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
9974             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
9975             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
9976         </fields>
9977
9978         <links>
9979             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9980             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9981             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
9982             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
9983             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
9984         </links>
9985
9986         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9987             <actions>
9988                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
9989             </actions>
9990         </permacrud>
9991
9992     </class>
9993
9994     <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">
9995         <oils_persist:source_definition>
9996             SELECT
9997                 cbrebi.id AS id,  -- so we can have a pkey in our view
9998                 uvs.id AS session,
9999                 uvs.owning_lib,
10000                 cbrebi.target_biblio_record_entry
10001             FROM url_verify.session uvs
10002             JOIN container.biblio_record_entry_bucket cbreb
10003                 ON (uvs.container = cbreb.id)
10004             JOIN container.biblio_record_entry_bucket_item cbrebi
10005                 ON (cbrebi.bucket = cbreb.id)
10006         </oils_persist:source_definition>
10007         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
10008             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
10009             <field reporter:label="Session" name="session" reporter:datatype="link" />
10010             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10011             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
10012         </fields>
10013         <links>
10014             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
10015             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
10016             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
10017         </links>
10018         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10019             <actions>
10020                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
10021             </actions>
10022         </permacrud>
10023     </class>
10024
10025     <class
10026         id="uvus"
10027         controller="open-ils.cstore open-ils.pcrud"
10028         oils_obj:fieldmapper="url_verify::url_selector"
10029         oils_persist:tablename="url_verify.url_selector"
10030         reporter:label="URL Verification URL Selector"
10031     >
10032         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
10033             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10034             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10035                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10036             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10037         </fields>
10038
10039         <links>
10040             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10041             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10042         </links>
10043
10044         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10045             <actions>
10046                 <create permission="URL_VERIFY">
10047                     <context link="session" field="owning_lib"/>
10048                 </create>
10049                 <retrieve permission="URL_VERIFY">
10050                     <context link="session" field="owning_lib"/>
10051                 </retrieve>
10052                 <update permission="URL_VERIFY">
10053                     <context link="session" field="owning_lib"/>
10054                 </update>
10055                 <delete permission="URL_VERIFY">
10056                     <context link="session" field="owning_lib"/>
10057                 </delete>
10058             </actions>
10059         </permacrud>
10060
10061     </class>
10062
10063     <class
10064         id="uvu"
10065         controller="open-ils.cstore open-ils.pcrud"
10066         oils_obj:fieldmapper="url_verify::url"
10067         oils_persist:tablename="url_verify.url"
10068         reporter:label="URL Verification URL"
10069     >
10070         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10071             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10072                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10073                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10074                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10075                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10076             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10077             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10078             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10079             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10080             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10081             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10082             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10083             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10084             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10085             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10086             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10087             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10088             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10089         </fields>
10090
10091         <links>
10092             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10093             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10094             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10095             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10096             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10097         </links>
10098
10099         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10100             <actions>
10101                 <create permission="URL_VERIFY">
10102                     <context link="session" field="owning_lib"/>
10103                 </create>
10104                 <retrieve permission="URL_VERIFY">
10105                     <context link="session" field="owning_lib"/>
10106                 </retrieve>
10107                 <update permission="URL_VERIFY">
10108                     <context link="session" field="owning_lib"/>
10109                 </update>
10110                 <delete permission="URL_VERIFY">
10111                     <context link="session" field="owning_lib"/>
10112                 </delete>
10113             </actions>
10114         </permacrud>
10115
10116     </class>
10117
10118     <class
10119         id="uvva"
10120         controller="open-ils.cstore open-ils.pcrud"
10121         oils_obj:fieldmapper="url_verify::verification_attempt"
10122         oils_persist:tablename="url_verify.verification_attempt"
10123         reporter:label="URL Verification Attempt"
10124     >
10125         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10126             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10127                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10128                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10129             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10130             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10131         </fields>
10132
10133         <links>
10134             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10135             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10136         </links>
10137
10138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10139             <actions>
10140                 <create permission="URL_VERIFY">
10141                     <context link="session" field="owning_lib"/>
10142                 </create>
10143                 <retrieve permission="URL_VERIFY">
10144                     <context link="session" field="owning_lib"/>
10145                 </retrieve>
10146                 <update permission="URL_VERIFY">
10147                     <context link="session" field="owning_lib"/>
10148                 </update>
10149                 <delete permission="URL_VERIFY">
10150                     <context link="session" field="owning_lib"/>
10151                 </delete>
10152             </actions>
10153         </permacrud>
10154
10155     </class>
10156
10157     <class
10158         id="uvuv"
10159         controller="open-ils.cstore open-ils.pcrud"
10160         oils_obj:fieldmapper="url_verify::url_verification"
10161         oils_persist:tablename="url_verify.url_verification"
10162         reporter:label="URL Verification"
10163     >
10164         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10165             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10166                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10167                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10168             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10169             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10170             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10171             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10172                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10173         </fields>
10174
10175         <links>
10176             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10177             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10178             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10179         </links>
10180
10181         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10182             <actions>
10183                 <create permission="URL_VERIFY">
10184                     <context link="attempt" jump="session" field="owning_lib"/>
10185                 </create>
10186                 <retrieve permission="URL_VERIFY">
10187                     <context link="attempt" jump="session" field="owning_lib"/>
10188                 </retrieve>
10189                 <update permission="URL_VERIFY">
10190                     <context link="attempt" jump="session" field="owning_lib"/>
10191                 </update>
10192                 <delete permission="URL_VERIFY">
10193                     <context link="attempt" jump="session" field="owning_lib"/>
10194                 </delete>
10195             </actions>
10196         </permacrud>
10197
10198     </class>
10199
10200         <class
10201                 id="cfdi"
10202                 controller="open-ils.cstore open-ils.pcrud"
10203                 oils_obj:fieldmapper="config::filter_dialog_interface"
10204                 oils_persist:tablename="config.filter_dialog_interface"
10205                 reporter:label="FilterDialog Interface">
10206                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10207                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10208                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10209                 </fields>
10210                 <links>
10211                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10212                 </links>
10213                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10214                         <actions>
10215                                 <retrieve />
10216                         </actions>
10217                 </permacrud>
10218         </class>
10219
10220         <class
10221                 id="cfdfs"
10222                 controller="open-ils.cstore open-ils.pcrud"
10223                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10224                 oils_persist:tablename="config.filter_dialog_filter_set"
10225                 reporter:label="FilterDialog Filter Set">
10226                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10227                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10228                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10229                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10230                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10231                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10232                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10233                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10234                 </fields>
10235                 <links>
10236                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10237                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10238                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10239                 </links>
10240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10241                         <actions>
10242                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10243                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10244                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10245                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10246                         </actions>
10247                 </permacrud>
10248
10249         </class>
10250
10251         <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">
10252                 <fields oils_persist:primary="code">
10253                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10254                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10255                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10256                 </fields>
10257                 <links/>
10258                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10259                         <actions>
10260                                 <retrieve/>
10261                         </actions>
10262                 </permacrud>
10263         </class>
10264
10265         <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">
10266                 <oils_persist:source_definition>
10267
10268             SELECT  b.id,
10269                     MAX(dcp.edit_date) AS last_delete_date
10270              FROM   biblio.record_entry b
10271                     JOIN asset.call_number cn ON (cn.record = b.id)
10272                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10273              WHERE  NOT b.deleted
10274              GROUP BY b.id
10275              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10276
10277                 </oils_persist:source_definition>
10278                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10279                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10280                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10281                 </fields>
10282                 <links>
10283                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10284                 </links>
10285                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10286                         <actions>
10287                                 <retrieve/>
10288                         </actions>
10289                 </permacrud>
10290         </class>
10291
10292         <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">
10293                 <oils_persist:source_definition>
10294
10295             -- -- 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.
10296             -- -- 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
10297             -- -- may not.
10298             -- SELECT
10299             --     bre.id AS "bib_id",
10300             --     COALESCE( z.copy_count, 0 ) AS "copy_count",
10301             --     COALESCE( z.hold_count, 0 ) AS "hold_count",
10302             --     COALESCE( z.copy_hold_ratio, 0 ) AS "hold_copy_ratio"
10303             -- FROM (
10304                 SELECT
10305                     y.bre AS "id",
10306                     COALESCE( x.copy_count, 0 ) AS "copy_count",
10307                     y.hold_count AS "hold_count",
10308                     (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"
10309                 FROM (
10310                         SELECT
10311                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS "bre",
10312                             COUNT(*) AS "hold_count"
10313                         FROM action.hold_request h
10314                         WHERE
10315                             cancel_time IS NULL
10316                             AND fulfillment_time IS NULL
10317                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10318                         GROUP BY 1
10319                     )y LEFT JOIN (
10320                         SELECT 
10321                             (SELECT id
10322                                 FROM biblio.record_entry 
10323                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
10324                             ) AS "bre", 
10325                             COUNT(*) AS "copy_count"
10326                         FROM asset.copy
10327                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10328                         WHERE copy.holdable 
10329                             AND NOT copy.deleted 
10330                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10331                         GROUP BY 1
10332                     )x ON x.bre = y.bre
10333                 -- )z RIGHT JOIN (
10334                 --     SELECT id
10335                 --     FROM biblio.record_entry
10336                 --     WHERE NOT deleted
10337                 -- )bre ON (z.bib_id = bre.id)
10338                 
10339
10340                 </oils_persist:source_definition>
10341                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10342                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10343                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10344                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10345                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10346                 </fields>
10347                 <links>
10348                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10349                 </links>
10350                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10351                         <actions>
10352                                 <retrieve/>
10353                         </actions>
10354                 </permacrud>
10355         </class>
10356
10357         <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">
10358                 <oils_persist:source_definition>
10359             SELECT *,
10360                 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,
10361                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10362             FROM
10363                 (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
10364                     FROM
10365                         action.hold_request ahr
10366                         JOIN reporter.hold_request_record rhrr USING (id)
10367                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10368                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10369                     WHERE
10370                         ahr.cancel_time IS NULL
10371                         AND ahr.fulfillment_time IS NULL
10372                     GROUP BY bib_record, pickup_lib
10373                 )x
10374                 JOIN
10375                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10376                     FROM
10377                         action.hold_request ahr
10378                         JOIN reporter.hold_request_record rhrr USING (id)
10379                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10380                     WHERE
10381                         ahr.cancel_time IS NULL
10382                         AND ahr.fulfillment_time IS NULL
10383                     GROUP BY bib_record
10384                 )y
10385                 USING (id)
10386                 </oils_persist:source_definition>
10387                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10388                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10389                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10390                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10391                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10392                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10393                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10394                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10395                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10396                 </fields>
10397                 <links>
10398                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10399                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10400                 </links>
10401                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10402                         <actions>
10403                                 <retrieve/>
10404                         </actions>
10405                 </permacrud>
10406         </class>
10407
10408         <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">
10409                 <oils_persist:source_definition>
10410             SELECT
10411                 ac.id,
10412                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10413                 MAX(actac.xact_start) AS last_circ
10414             FROM asset.copy ac
10415                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10416             GROUP BY ac.id
10417
10418             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10419             --SELECT
10420             --    ac.id,
10421             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10422             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10423             --FROM asset.copy ac
10424             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10425             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10426             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10427                 </oils_persist:source_definition>
10428                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10429                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10430                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10431                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10432                 </fields>
10433                 <links>
10434                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10435                 </links>
10436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10437                         <actions>
10438                                 <retrieve/>
10439                         </actions>
10440                 </permacrud>
10441         </class>
10442
10443         <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">
10444                 <fields oils_persist:primary="id">
10445                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10446                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10447                 </fields>
10448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10449                         <actions>
10450                                 <retrieve/>
10451                         </actions>
10452                 </permacrud>
10453         </class>
10454
10455         <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">
10456                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10457                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10458                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10459                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10460                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10461                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10462                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10463                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10464                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10465                 </fields>
10466                 <links>
10467                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10468                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10469                 </links>
10470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10471                         <actions>
10472                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10473                                 <retrieve/>
10474                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10475                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10476                         </actions>
10477                 </permacrud>
10478         </class>
10479
10480         <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">
10481                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10482                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10483                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10484                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10485                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10486                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10487                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10488                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10489                 </fields>
10490                 <links>
10491                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10492                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10493                 </links>
10494                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10495                         <actions>
10496                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10497                                 <retrieve/>
10498                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10499                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10500                         </actions>
10501                 </permacrud>
10502         </class>
10503
10504
10505         <!-- ********************************************************************************************************************* -->
10506         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10507         <!-- ********************************************************************************************************************* -->
10508         <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">
10509                 <fields oils_persist:primary="id">
10510                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10511                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10512                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10513                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10514                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10515                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10516                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10517                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10518                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10519                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10520                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10521                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10522                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10523                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10524                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10525                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10526                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10527                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10528                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10529                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10530                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10531                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10532                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10533                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10534                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10535                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10536                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10537                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10538                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10539                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10540                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10541                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10542                 </fields>
10543                 <links>
10544                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10545                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10546                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10547                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10548                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10549                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10550                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10551                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10552                 </links>
10553         </class>
10554
10555         <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">
10556                 <fields oils_persist:primary="id">
10557                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10558                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10559                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10560                 </fields>
10561                 <links>
10562                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10563                 </links>
10564         </class>
10565
10566         <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">
10567                 <fields oils_persist:primary="id">
10568                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10569                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10570                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10571                 </fields>
10572                 <links>
10573                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10574                 </links>
10575         </class>
10576
10577         <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">
10578                 <fields oils_persist:primary="id">
10579                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10580
10581                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10582                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10583                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10584
10585                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10586                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10587                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10588
10589                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10590                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10591
10592                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10593                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10594                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10595
10596                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10597                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10598
10599                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10600                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10601                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10602
10603                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10604                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10605                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10606
10607                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10608                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
10609                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
10610                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
10611
10612                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
10613                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
10614
10615                 </fields>
10616                 <links>
10617                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
10618                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10619                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
10620                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
10621                 </links>
10622         </class>
10623
10624         <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">
10625                 <oils_persist:source_definition>
10626
10627             SELECT
10628                 po.ordering_agency AS ordering_agency,
10629                 po.id AS purchase_order,
10630                 li.id AS lineitem,
10631                 lid.id AS lineitem_detail,
10632                 cpa.id AS claim_policy_action
10633             FROM
10634                 acq.lineitem_detail lid
10635                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
10636                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
10637                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
10638                 JOIN acq.claim_policy_action cpa ON (
10639                     cpa.claim_policy = cp.id
10640
10641                     -- we only care about claim policy actions whose claim
10642                     -- interval we'd reached or exceeded
10643                     AND (NOW() - cpa.action_interval) &gt; po.order_date
10644
10645                     -- filter out all claim policy actions where claim events
10646                     -- have occurred on or after the action's action_interval
10647                     AND NOT EXISTS (
10648                         SELECT 1
10649                         FROM
10650                             acq.claim_event evt
10651                             JOIN acq.claim claim ON (
10652                                 claim.id = evt.claim
10653                                 AND claim.lineitem_detail = lid.id
10654                             )
10655                         WHERE
10656                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
10657                     )
10658                 )
10659             WHERE
10660                 lid.cancel_reason IS NULL
10661                 AND li.cancel_reason IS NULL -- belt/suspenders
10662                 AND po.cancel_reason IS NULL -- belt/suspenders
10663                 AND lid.recv_time IS NULL
10664                 AND po.state = 'on-order'
10665             ORDER BY 1, 2, 3, 4, 5
10666
10667                 </oils_persist:source_definition>
10668                 <fields>
10669                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10670                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10671                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10672                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
10673                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
10674                 </fields>
10675                 <links>
10676                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10677                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10678                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10679                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
10680                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
10681                 </links>
10682         </class>
10683         <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">
10684                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10685                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10686                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10687                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10688                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10689                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10690                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10691                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10692                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10693                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10694                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10695                 </fields>
10696                 <links>
10697                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10698                 </links>
10699     </class>
10700         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
10701                 <oils_persist:source_definition>
10702             SELECT * FROM acq.lineitem_summary 
10703                                 WHERE item_count > (invoice_count + cancel_count)
10704         </oils_persist:source_definition>
10705                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10706                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10707                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10708                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10709                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10710                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10711                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10712                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10713                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10714                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10715                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10716                 </fields>
10717                 <links>
10718                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10719                 </links>
10720     </class>
10721         <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">
10722                 <oils_persist:source_definition>
10723
10724                         SELECT  t.*
10725                           FROM  action.transit_copy t
10726                                 JOIN actor.org_unit AS s ON (t.source = s.id)
10727                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
10728                           WHERE s.parent_ou &lt;&gt; d.parent_ou
10729
10730                 </oils_persist:source_definition>
10731                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
10732                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
10733                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
10734                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
10735                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
10736                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
10737                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
10738                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
10739                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
10740                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
10741                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
10742                 </fields>
10743                 <links>
10744                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
10745                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
10746                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
10747                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
10748                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10749                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
10750                 </links>
10751         </class>
10752
10753     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
10754                 <oils_persist:source_definition>
10755
10756         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
10757                 SELECT
10758                         cp.id as copy,
10759                         COUNT(circ.id),
10760                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10761                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10762                 FROM
10763                         asset.copy cp
10764                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
10765                 GROUP BY 1, 3, 4
10766                 UNION ALL
10767                 SELECT
10768                         cp.id as copy,
10769                         COUNT(circ.id),
10770                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10771                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10772                 FROM
10773                         asset.copy cp
10774                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
10775                 GROUP BY 1, 3, 4
10776                 UNION ALL
10777                 SELECT
10778                         id as copy,
10779                         circ_count,
10780                         -1 AS year,
10781                         false as is_renewal
10782                 FROM
10783                         extend_reporter.legacy_circ_count
10784         )x GROUP BY 1, 3, 4
10785
10786                 </oils_persist:source_definition>
10787         <fields>
10788             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
10789             <field reporter:label="Count" name="count" reporter:datatype="int"/>
10790             <field reporter:label="Year" name="year" reporter:datatype="int"/>
10791             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
10792         </fields>
10793                 <links>
10794                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
10795                 </links>
10796                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10797                         <actions>
10798                                 <retrieve/>
10799                         </actions>
10800                 </permacrud>
10801     </class>
10802
10803         <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">
10804                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
10805                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
10806                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
10807                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
10808                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
10809                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
10810                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
10811                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
10812                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
10813                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
10814                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
10815                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
10816                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
10817                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
10818                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
10819                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
10820                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
10821                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
10822                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
10823                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
10824                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
10825                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
10826                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
10827                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
10828                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
10829                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
10830                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
10831                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
10832                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
10833                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
10834                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
10835                 </fields>
10836                 <links>
10837                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
10838                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
10839                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
10840                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10841                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
10842                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10843                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10844                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
10845                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
10846                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
10847                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
10848                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
10849                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
10850                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
10851                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
10852                 </links>
10853         </class>
10854
10855     <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">
10856         <fields oils_persist:primary="id">
10857             <field reporter:label="Title" name="title" reporter:datatype="text"/>
10858             <field reporter:label="Author" name="author" reporter:datatype="text"/>
10859             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
10860             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
10861             <field reporter:label="Price" name="price" reporter:datatype="money"/>
10862             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10863             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
10864             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
10865             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10866             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
10867             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10868             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
10869             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
10870             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
10871             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10872             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10873             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
10874             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
10875             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
10876             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
10877             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
10878             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
10879             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10880             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
10881             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
10882             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
10883             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
10884             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
10885             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
10886             <field reporter:label="Status" name="status" reporter:datatype="link"/>
10887             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
10888             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
10889             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
10890             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
10891         </fields>
10892         <links>
10893             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10894             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10895             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10896             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10897             <link field="age_protect" reltype="might_have" key="id" map="" class="crahp"/>
10898             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
10899             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
10900             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
10901         </links>
10902     </class>
10903
10904     <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">
10905         <fields oils_persist:primary="id">
10906             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10907             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10908             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10909             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10910         </fields>
10911         <links>
10912             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10913             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10914         </links>
10915     </class>
10916
10917     <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">
10918         <fields oils_persist:primary="owning_lib">
10919             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10920             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10921             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10922         </fields>
10923         <links>
10924             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10925         </links>
10926     </class>
10927
10928     <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">
10929         <fields oils_persist:primary="id">
10930             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10931             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10932             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10933             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10934             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10935         </fields>
10936         <links>
10937             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10938             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10939             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10940         </links>
10941     </class>
10942
10943     <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">
10944         <fields oils_persist:primary="circ_lib">
10945             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10946             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10947             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10948             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10949         </fields>
10950         <links>
10951             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10952             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10953         </links>
10954     </class>
10955
10956     <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">
10957         <fields oils_persist:primary="id">
10958             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10959             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10960             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10961             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10962             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10963         </fields>
10964         <links>
10965             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10966             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10967             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10968         </links>
10969     </class>
10970
10971     <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">
10972         <fields oils_persist:primary="home_ou">
10973             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10974             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10975             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10976             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10977         </fields>
10978         <links>
10979             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10980             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10981         </links>
10982     </class>
10983         <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">
10984                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
10985                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
10986                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
10987                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
10988                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10989                 </fields>
10990                 <links>
10991                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10992                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
10993                 </links>
10994                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10995                         <actions>
10996                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10997                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
10998                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10999                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11000                         </actions>
11001                 </permacrud>
11002         </class>
11003         <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">
11004                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
11005                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
11006                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
11007                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
11008                 </fields>
11009                 <links>
11010                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11011                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
11012                         </links>
11013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11014                 <actions>
11015                                 <create permission="ADMIN_ACQ_FUND_TAG">
11016                                         <context link="tag" field="owner"/>
11017                                 </create>
11018                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
11019                                         <context link="tag" field="owner"/>
11020                                 </retrieve>
11021                                 <update permission="ADMIN_ACQ_FUND_TAG">
11022                                         <context link="tag" field="owner"/>
11023                                 </update>
11024                                 <delete permission="ADMIN_ACQ_FUND_TAG">
11025                                         <context link="tag" field="owner"/>
11026                                 </delete>
11027                         </actions>
11028                 </permacrud>
11029         </class>
11030         <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">
11031                 <oils_persist:source_definition><![CDATA[
11032                 SELECT
11033                         poi.purchase_order AS purchase_order,
11034                         ii.invoice AS invoice,
11035                         NULL AS lineitem,
11036                         poi.id AS po_item,
11037                         NULL AS picklist
11038                 FROM
11039                         acq.po_item poi
11040                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11041                 UNION SELECT
11042                         jub.purchase_order AS purchase_order,
11043                         ie.invoice AS invoice,
11044                         jub.id AS lineitem,
11045                         NULL AS po_item,
11046                         jub.picklist AS picklist
11047                 FROM
11048                         acq.lineitem jub
11049                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11050                 UNION SELECT
11051                         ii.purchase_order AS purchase_order,
11052                         ii.invoice AS invoice,
11053                         NULL AS lineitem,
11054                         NULL AS po_item,
11055                         NULL AS picklist
11056                 FROM
11057                         acq.invoice_item ii
11058                 WHERE ii.po_item IS NULL
11059                 UNION SELECT
11060                         ie.purchase_order AS purchase_order,
11061                         ie.invoice AS invoice,
11062                         NULL AS lineitem,
11063                         NULL AS po_item,
11064                         NULL AS picklist
11065                 FROM
11066                         acq.invoice_entry ie
11067                 WHERE ie.lineitem IS NULL
11068                 UNION SELECT
11069                         NULL AS purchase_order,
11070                         NULL AS invoice,
11071                         jub.id AS lineitem,
11072                         NULL AS po_item,
11073                         jub.picklist AS picklist
11074                 FROM
11075                         acq.lineitem jub
11076                 WHERE jub.purchase_order IS NULL
11077                 ]]></oils_persist:source_definition>
11078                 <fields>
11079                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11080                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11081                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11082                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11083                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11084                 </fields>
11085                 <links>
11086                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11087                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11088                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11089                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11090                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11091                 </links>
11092         </class>
11093         <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">
11094                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11095                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11096                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11097                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11098                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11099                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11100                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11101                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11102                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11103                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11104                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11105                 </fields>
11106                 <links>
11107                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11108                 </links>
11109                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11110                         <actions>
11111                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11112                                 <retrieve/>
11113                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11114                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11115                         </actions>
11116                 </permacrud>
11117         </class>
11118
11119         <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">
11120                 <fields oils_persist:primary="date_applied" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11121                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11122                         <field name="date_applied" reporter:datatype="timestamp"/>
11123                         <field name="org" reporter:datatype="org_unit"/>
11124                         <field name="original_value" reporter:datatype="text"/>
11125                         <field name="new_value" reporter:datatype="text"/>
11126                         <field name="field_name" reporter:datatype="link"/>
11127                 </fields>
11128                 <links>
11129                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11130                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11131                 </links>
11132                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11133                         <actions>
11134                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11135                                 <retrieve/>
11136                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11137                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11138                         </actions>
11139                 </permacrud>
11140         </class>
11141         <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">
11142                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11143                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11144                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11145                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11146                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11147                 </fields>
11148                 <links>
11149                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11150                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11151                 </links>
11152         </class>
11153         <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">
11154                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11155                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11156                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11157                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11158                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11159                 </fields>
11160                 <links>
11161                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11162                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11163                 </links>
11164         </class>
11165         <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">
11166                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11167                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11168                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11169                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11170                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11171                 </fields>
11172                 <links>
11173                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11174                 </links>
11175                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11176                         <actions>
11177                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11178                                 <retrieve/>
11179                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11180                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11181                         </actions>
11182                 </permacrud>
11183         </class>
11184         <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">
11185                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11186                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11187                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11188                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11189                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11190                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11191                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11192                 </fields>
11193                 <links>
11194                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11195                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
11196                 </links>
11197                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11198                         <actions>
11199                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11200                                 <retrieve/>
11201                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11202                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11203                         </actions>
11204                 </permacrud>
11205         </class>
11206
11207         <!-- ********************************************************************************************************************* -->
11208
11209 </IDL>
11210
11211 <!--
11212     vim:noet:ts=4:sw=4:
11213 -->