]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1234927 Reporter needs Item -> Combined Aged and Active Circulations link
[Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
78                 <fields>
79                         <field name="usr" oils_persist:virtual="true" />
80                         <field name="forgive_payment" oils_persist:virtual="true" />
81                         <field name="work_payment" oils_persist:virtual="true" />
82                         <field name="credit_payment" oils_persist:virtual="true" />
83                         <field name="goods_payment" oils_persist:virtual="true" />
84                 </fields>
85                 <links>
86                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
87                 </links>
88         </class>
89
90         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
91                 <fields>
92                         <field name="workstation" oils_persist:virtual="true" />
93                         <field name="cash_payment" oils_persist:virtual="true" />
94                         <field name="check_payment" oils_persist:virtual="true" />
95                         <field name="credit_card_payment" oils_persist:virtual="true" />
96                 </fields>
97                 <links>
98                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
99                 </links>
100         </class>
101
102         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
103                 <fields>
104                         <field name="id" oils_persist:virtual="true" />
105                         <field name="children" oils_persist:virtual="true" />
106                         <field name="owner_doc" oils_persist:virtual="true" />
107                         <field name="intra_doc_id" oils_persist:virtual="true" />
108                         <field name="parent_node" oils_persist:virtual="true" />
109                         <field name="node_type" oils_persist:virtual="true" />
110                         <field name="namespace_uri" oils_persist:virtual="true" />
111                         <field name="name" oils_persist:virtual="true" />
112                         <field name="value" oils_persist:virtual="true" />
113                 </fields>
114         </class>
115
116         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
117                 <fields>
118                         <field name="title" oils_persist:virtual="true" />
119                         <field name="author" oils_persist:virtual="true" />
120                         <field name="doc_id" oils_persist:virtual="true" />
121                         <field name="doc_type" oils_persist:virtual="true" />
122                         <field name="pubdate" oils_persist:virtual="true" />
123                         <field name="isbn" oils_persist:virtual="true" />
124                         <field name="publisher" oils_persist:virtual="true" />
125                         <field name="tcn" oils_persist:virtual="true" />
126                         <field name="subject" oils_persist:virtual="true" />
127                         <field name="types_of_resource" oils_persist:virtual="true" />
128                         <field name="call_numbers" oils_persist:virtual="true" />
129                         <field name="edition" oils_persist:virtual="true" />
130                         <field name="online_loc" oils_persist:virtual="true" />
131                         <field name="synopsis" oils_persist:virtual="true" />
132                         <field name="physical_description" oils_persist:virtual="true" />
133                         <field name="toc" oils_persist:virtual="true" />
134                         <field name="copy_count" oils_persist:virtual="true" />
135                         <field name="series" oils_persist:virtual="true" />
136                         <field name="serials" oils_persist:virtual="true" />
137                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
138                 </fields>
139         </class>
140
141         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
142                 <fields>
143                         <field name="err_msg" oils_persist:virtual="true" />
144                         <field name="type" oils_persist:virtual="true" />
145                 </fields>
146         </class>
147
148         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
149                 <fields>
150                         <field name="err_msg" oils_persist:virtual="true" />
151                         <field name="type" oils_persist:virtual="true" />
152                 </fields>
153         </class>
154
155         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
156                 <fields oils_persist:primary="matchpoint">
157                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
158                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
159                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
160                 </fields>
161                 <links>
162                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
163                 </links>
164         </class>
165
166         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
167         <!-- when the time is right, turn me into a view.  -->
168                 <fields>
169             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
170             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
171             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
172             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
173             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
174             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
175             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
176             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
177             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
178             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
179                 </fields>
180         </class>
181
182         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
183                 <fields>
184                         <field name="public_name" oils_persist:virtual="true" />
185                         <field name="target_url" oils_persist:virtual="true" />
186                         <field name="target_coverage" oils_persist:virtual="true" />
187                         <field name="target_embargo" oils_persist:virtual="true" />
188                 </fields>
189         </class>
190
191         <!-- Actually in the DB -->
192         <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
193                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
194                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
195                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
196                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
197                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
198                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
199                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
200                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
201                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
202                 </fields>
203                 <links>
204                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
205                 </links>
206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
207                         <actions>
208                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
209                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
210                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
211                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
212                         </actions>
213                 </permacrud>
214         </class>
215
216         <class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
219                         <field reporter:label="Group" name="grp" reporter:datatype="link"/>
220                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
221                 </fields>
222                 <links>
223                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
224                 </links>
225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
226                         <actions>
227                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
228                     <context link="grp" field="owner"/>
229                 </create>
230                                 <retrieve/>
231                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
232                     <context link="grp" field="owner"/>
233                 </update>
234                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
235                     <context link="grp" field="owner"/>
236                 </delete>
237                         </actions>
238                 </permacrud>
239         </class>
240
241         <class  id="vibtg" 
242             controller="open-ils.cstore open-ils.pcrud" 
243             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
244             oils_persist:tablename="vandelay.import_bib_trash_group" 
245             reporter:label="Import/Overlay Field Groups for Removal">
246                 <fields oils_persist:primary="id" 
247                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
248                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
249                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
250                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
251                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
252                 </fields>
253                 <links>
254                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
255                 </links>
256                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
257                         <actions>
258                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
259                                 <retrieve/>
260                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
261                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
262                         </actions>
263                 </permacrud>
264         </class>
265
266
267         <class id="vii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item" oils_persist:tablename="vandelay.import_item" reporter:label="Import Item">
268                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
269                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
270                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
271                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
272                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
273                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
274                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
275                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
276                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
277                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
278                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
279                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
280                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
281                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
282                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
283                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
284                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
285                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
286                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
287                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
288                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
289                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
290                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
291                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
292                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
293                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
294                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
295                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
296                 </fields>
297                 <links>
298                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
299                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
300                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
301                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
302                 </links>
303                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
304                         <actions>
305                                 <create permission="CREATE_IMPORT_ITEM">
306                     <context link="definition" field="owner"/>
307                                 </create>
308                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
309                     <context link="definition" field="owner"/>
310                                 </retrieve>
311                                 <update permission="UPDATE_IMPORT_ITEM">
312                     <context link="definition" field="owner"/>
313                                 </update>
314                                 <delete permission="DELETE_IMPORT_ITEM">
315                     <context link="definition" field="owner"/>
316                                 </delete>
317                         </actions>
318                 </permacrud>
319         </class>
320
321         <class id="viiad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item_attr_definition" oils_persist:tablename="vandelay.import_item_attr_definition" reporter:label="Import Item Attribute Definition">
322                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
323                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
324                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
325                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
326                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
327                         <field reporter:label="Keep" name="keep" reporter:datatype="bool"/>
328                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
329                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
330                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
331                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
332                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
333                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
334                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
335                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
336                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
337                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
338                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
339                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
340                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
341                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
342                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
343                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
344                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
345                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
346                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
347                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
348                 </fields>
349                 <links>
350                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
351                 </links>
352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
353                         <actions>
354                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
355                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
356                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
357                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
358                         </actions>
359                 </permacrud>
360         </class>
361
362         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
363                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
364                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
365                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
366                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
367                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
368                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
369                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
370                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
371                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
372                 </fields>
373                 <links>
374                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
375                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
376                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
377                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
378                 </links>
379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
380                         <actions>
381                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
382                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
383                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
384                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
385                         </actions>
386                 </permacrud>
387         </class>
388
389         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
390                 <fields oils_persist:primary="code">
391                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
392                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
393                 </fields>
394                 <links>
395                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
396                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
397                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
398                 </links>
399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
400                         <actions>
401                                 <retrieve/>
402                         </actions>
403                 </permacrud>
404         </class>
405
406         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
407                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
408                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
409                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
410                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
411                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
412                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
413                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
414                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
415                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
416                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
417                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
418                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
419                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
420                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
421                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
422                 </fields>
423                 <links>
424                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
425                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
426                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
427                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
428             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
429             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
430             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
431                 </links>
432                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
433                         <actions>
434                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
435                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
436                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
437                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
438                         </actions>
439                 </permacrud>
440         </class>
441
442         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
443                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
444                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
445                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
446                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
447                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
448                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
449                 </fields>
450                 <links/>
451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
452                         <actions>
453                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
454                 <retrieve/>
455                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
456                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
457                         </actions>
458                 </permacrud>
459         </class>
460
461         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
462                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
463                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
464                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
465                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
466                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
467                 </fields>
468                 <links>
469                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
470                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
471                 </links>
472                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
473                         <actions>
474                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
475                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
476                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
477                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
478                         </actions>
479                 </permacrud>
480         </class>
481
482         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
483                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
484                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
485                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
486                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
487                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
488                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
489                 </fields>
490                 <links>
491                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
492                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
493                 </links>
494                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
495                         <actions>
496                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
497                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
498                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
499                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
500                         </actions>
501                 </permacrud>
502         </class>
503
504         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
505                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
506                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
507                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
508                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
509                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
510                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
511                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
512                 </fields>
513                 <links>
514                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
515                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
516                 </links>
517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
518                         <actions>
519                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
520                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
521                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
522                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
523                         </actions>
524                 </permacrud>
525         </class>
526
527         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
528                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
529                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
530                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
531                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
532                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
533                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
534                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
535                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
536                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
537                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
538                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
539                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
540                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
541                 </fields>
542                 <links>
543                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
544                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
545                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
546             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
547             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
548                 </links>
549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
550                         <actions>
551                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
552                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
553                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
554                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
555                         </actions>
556                 </permacrud>
557         </class>
558
559         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
560                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
561                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
562                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
563                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
564                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
565                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
566                 </fields>
567                 <links/>
568                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
569                         <actions>
570                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
571                 <retrieve/>
572                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
573                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
574                         </actions>
575                 </permacrud>
576         </class>
577
578         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
579                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
580                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
581                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
582                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
583                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
584                 </fields>
585                 <links>
586                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
587                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
588                 </links>
589                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
590                         <actions>
591                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
592                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
593                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
594                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
595                         </actions>
596                 </permacrud>
597         </class>
598
599         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
600                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
601                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
602                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
603                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
604                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
605                 </fields>
606                 <links>
607                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
608                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
609                 </links>
610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
611                         <actions>
612                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
613                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
614                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
615                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
616                         </actions>
617                 </permacrud>
618         </class>
619
620         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
621                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
622                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
623                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
624                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
625                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
626                 </fields>
627                 <links>
628                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
629                 </links>
630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
631                         <actions>
632                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
633                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
634                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
635                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
636                         </actions>
637                 </permacrud>
638         </class>
639
640         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
641                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
642                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
643                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
644                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
645                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
646                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
647                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
648                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
649             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
650                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
651                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
652                 </fields>
653                 <links>
654                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
655                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
656                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
657                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
658                 </links>
659                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
660                         <actions>
661                                 <create permission="ADMIN_IMPORT_MATCH_SET">
662                     <context link="match_set" field="owner"/>
663                                 </create>
664                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
665                     <context link="match_set" field="owner"/>
666                                 </retrieve>
667                                 <update permission="ADMIN_IMPORT_MATCH_SET">
668                     <context link="match_set" field="owner"/>
669                                 </update>
670                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
671                     <context link="match_set" field="owner"/>
672                                 </delete>
673                         </actions>
674                 </permacrud>
675         </class>
676
677         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
678                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
679                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
680                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
681                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
682                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
683                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
684                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
685                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
686                 </fields>
687                 <links>
688                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
689                 </links>
690                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
691                         <actions>
692                                 <create permission="ADMIN_IMPORT_MATCH_SET">
693                     <context link="match_set" field="owner"/>
694                                 </create>
695                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
696                     <context link="match_set" field="owner"/>
697                                 </retrieve>
698                                 <update permission="ADMIN_IMPORT_MATCH_SET">
699                     <context link="match_set" field="owner"/>
700                                 </update>
701                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
702                     <context link="match_set" field="owner"/>
703                                 </delete>
704                         </actions>
705                 </permacrud>
706         </class>
707
708         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
709                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
710                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
711                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
712                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
713                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
714                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
715                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
716                 </fields>
717                 <links>
718                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
719                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
720                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
721                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
722                 </links>
723         </class>
724
725     <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
726         <fields oils_persist:primary="name">
727             <field reporter:label="Name" name="name" reporter:datatype="text"/>
728             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
729             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
730             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
731         </fields>
732         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
733             <actions>
734                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
735                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
736                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
737                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
738             </actions>
739         </permacrud>
740     </class>
741
742     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
743         <fields oils_persist:primary="id">
744             <field reporter:label="ID" name="id" reporter:datatype="id"/>
745             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
746             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
747             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
748             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
749         </fields>
750         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
751             <actions>
752                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
753                 <retrieve/>
754                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
755                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
756             </actions>
757         </permacrud>
758     </class>
759
760         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
761                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
762                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
763                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
764                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
765                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
766                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
767                 </fields>
768                 <links>
769                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
770                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
771                 </links>
772         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
773             <actions>
774                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
775                 <retrieve/>
776                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
777                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
778             </actions>
779         </permacrud>
780         </class>
781
782         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
783                 <fields oils_persist:primary="name">
784                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
785                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true"/>
786                         <field reporter:label="Description" name="description" reporter:datatype="text" />
787                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
788                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
789                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
790                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
791                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
792                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
793                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
794                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
795                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
796                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
797                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
798                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
799                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
800                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
801                 </fields>
802                 <links>
803                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
804                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
805                 </links>
806         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
807             <actions>
808                 <create permission="ADMIN_SVF" global_required="true"/>
809                 <retrieve/>
810                 <update permission="ADMIN_SVF" global_required="true"/>
811                 <delete permission="ADMIN_SVF" global_required="true"/>
812             </actions>
813         </permacrud>
814         </class>
815
816         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
817                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
818                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
819                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
820                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
821             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
822                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
823                 </fields>
824                 <links/>
825         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
826             <actions>
827                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
828                 <retrieve/>
829                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
830                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
831             </actions>
832         </permacrud>
833         </class>
834
835         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
836                 <fields oils_persist:primary="coded_value">
837                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
838                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
839                 </fields>
840                 <links>
841                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
842                 </links>
843         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
844             <actions>
845                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
846                 <retrieve/>
847                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
848                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
849             </actions>
850         </permacrud>
851         </class>
852
853         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
854                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
855                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
856                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
857                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
858                 </fields>
859                 <links>
860                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
861                 </links>
862         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
863             <actions>
864                 <retrieve/>
865             </actions>
866         </permacrud>
867         </class>
868
869
870         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
871                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
872                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
873                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
874                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
875                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
876                 </fields>
877                 <links>
878                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
879                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
880                 </links>
881         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
882             <actions>
883                 <retrieve/>
884             </actions>
885         </permacrud>
886         </class>
887
888
889         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
890                 <fields oils_persist:primary="source">
891                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
892                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
893                 </fields>
894                 <links>
895                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
896                 </links>
897         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
898             <actions>
899                 <retrieve/>
900             </actions>
901         </permacrud>
902         </class>
903
904         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
905                 <fields>
906                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
907                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
908                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
909                 </fields>
910                 <links>
911                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
912                 </links>
913         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
914             <actions>
915                 <retrieve/>
916             </actions>
917         </permacrud>
918         </class>
919
920         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
921                 <fields oils_persist:primary="id">
922                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
923                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
924                 </fields>
925                 <links>
926                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
927                 </links>
928         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
929             <actions>
930                 <retrieve/>
931             </actions>
932         </permacrud>
933         </class>
934
935         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
936                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
937                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
938                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
939                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
940                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
941                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
942                 </fields>
943                 <links>
944                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
945                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
946                 </links>
947         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
948             <actions>
949                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
950                 <retrieve/>
951                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
952                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
953             </actions>
954         </permacrud>
955         </class>
956
957         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
958                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
959                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
960                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
961                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
962                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
963                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
964                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
965                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
966             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
967             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
968                 </fields>
969                 <links>
970                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
971                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
972                 </links>
973         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
974             <actions>
975                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
976                 <retrieve/>
977                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
978                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
979             </actions>
980         </permacrud>
981         </class>
982
983         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
984                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
985                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
986                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
987                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
988                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
989                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
990                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
991                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
992                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
993                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
994                 </fields>
995                 <links>
996                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
997                 </links>
998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
999             <actions>
1000                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1001                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1002                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1003                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1004             </actions>
1005         </permacrud>
1006         </class>
1007
1008     <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1009         <fields oils_persist:primary="name">
1010             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1011             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1012             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1013             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1014             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1015             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1016             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1017             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1018             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1019             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1020         </fields>
1021         <links>
1022             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1023             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1024         </links>
1025         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1026             <actions>
1027                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1028                 <retrieve/>
1029                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1030                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1031             </actions>
1032         </permacrud>
1033     </class>
1034
1035     <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1036         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1037             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1038             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1039             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1040             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1041             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1042             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1043             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1044         </fields>
1045         <links>
1046             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1047         </links>
1048         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1049             <actions>
1050                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1051                 <retrieve/>
1052                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1053                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1054             </actions>
1055         </permacrud>
1056     </class>
1057
1058     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1059                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1060                         oils_persist:tablename="config.z3950_index_field_map" 
1061                         reporter:label="Z39.50 Index Field Map">
1062         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1063             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1064             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1065             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1066             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1067             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1068             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1069         </fields>
1070         <links>
1071             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1072             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1073             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1074         </links>
1075         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1076             <actions>
1077                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1078                 <retrieve/>
1079                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1080                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1081             </actions>
1082         </permacrud>
1083     </class>
1084
1085
1086         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1087                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1088                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1089                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1090                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1091                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1092                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1093                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1094                 </fields>
1095                 <links>
1096             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1097             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1098                 </links>
1099                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1100                         <actions>
1101                                 <retrieve/>
1102                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1103                         </actions>
1104                 </permacrud>
1105         </class>
1106
1107         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1108                 <fields oils_persist:primary="key">
1109                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1110                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1111                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1112                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1113                 </fields>
1114                 <links/>
1115                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1116                         <actions>
1117                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1118                                 <retrieve/>
1119                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1120                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1121                         </actions>
1122                 </permacrud>
1123         </class>
1124
1125         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1126                 <fields oils_persist:primary="module">
1127                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1128                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1129                 </fields>
1130                 <links/>
1131         </class>
1132
1133         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1134                 <fields oils_persist:primary="module">
1135                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1136                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1137                 </fields>
1138                 <links/>
1139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1140                         <actions>
1141                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1142                                 <retrieve/>
1143                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1144                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1145                         </actions>
1146                 </permacrud>
1147         </class>
1148
1149         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1150                 <fields oils_persist:primary="module">
1151                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1152                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1153                 </fields>
1154                 <links/>
1155                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1156                         <actions>
1157                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1158                                 <retrieve/>
1159                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1160                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1161                         </actions>
1162                 </permacrud>
1163         </class>
1164
1165         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1166                 <fields oils_persist:primary="module">
1167                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1168                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1169                 </fields>
1170                 <links/>
1171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1172                         <actions>
1173                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1174                                 <retrieve/>
1175                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1176                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1177                         </actions>
1178                 </permacrud>
1179         </class>
1180
1181         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1182                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1183                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1184                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1185                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1186                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1187                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1188                 </fields>
1189                 <links>
1190                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1191                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1192                 </links>
1193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1194                         <actions>
1195                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1196                     <context link="event_def" field="owner"/>
1197                 </create>
1198                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1199                     <context link="event_def" field="owner"/>
1200                 </retrieve>
1201                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1202                     <context link="event_def" field="owner"/>
1203                 </update>
1204                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1205                     <context link="event_def" field="owner"/>
1206                 </delete>
1207                         </actions>
1208                 </permacrud>
1209         </class>
1210
1211         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1212                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1213                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1214                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1215                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1216                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1217                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1218                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1219                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1220                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1221                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1222                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1223                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1224                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1225                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1226                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1227                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1228                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1229                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1230                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1231                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1232                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1233                 </fields>
1234                 <links>
1235                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1236                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1237                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1238                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1239                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1240                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1241                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1242                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1243                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1244                 </links>
1245                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1246                         <actions>
1247                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1248                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1249                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1250                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1251                         </actions>
1252                 </permacrud>
1253         </class>
1254
1255         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1256                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1257                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1258                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1259                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1260                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1261                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1262                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1263                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1264                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1265                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1266                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1267                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1268                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1269                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1270                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1271                 </fields>
1272                 <links>
1273                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1274                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1275                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1276                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1277                 </links>
1278         </class>
1279
1280         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1281                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1282                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1283                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1284                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1285                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1286                 </fields>
1287                 <links>
1288                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1289                 </links>
1290                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291                         <actions>
1292                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1293                     <context link="event_def" field="owner"/>
1294                 </create>
1295                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1296                     <context link="event_def" field="owner"/>
1297                 </retrieve>
1298                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1299                     <context link="event_def" field="owner"/>
1300                 </update>
1301                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1302                     <context link="event_def" field="owner"/>
1303                 </delete>
1304                         </actions>
1305                 </permacrud>
1306         </class>
1307
1308         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1309                 <oils_persist:source_definition><![CDATA[
1310                 SELECT  atevdef.hook,
1311                         atevdef.name,
1312                         atevdef.reactor,
1313                         atev.id,
1314                         atev.event_def,
1315                         atev.add_time,
1316                         atev.run_time,
1317                         atev.start_time,
1318                         atev.update_time,
1319                         atev.complete_time,
1320                         atev.update_process,
1321                         atev.state,
1322                         atev.user_data,
1323                         atev.template_output,
1324                         atev.error_output,
1325                         atev.async_output,
1326                         targ_circ.id AS target_circ,
1327                         targ_ahr.id AS target_hold,
1328                         COALESCE(
1329                                 targ_circ.circ_lib,
1330                                 targ_ahr.pickup_lib
1331                         ) AS perm_lib
1332                 FROM action_trigger.event atev
1333                 JOIN action_trigger.event_definition atevdef ON
1334                         (atevdef.id = atev.event_def)
1335                 JOIN action_trigger.hook ath ON
1336                         (ath.key = atevdef.hook)
1337                 LEFT JOIN action.circulation targ_circ ON
1338                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1339                 LEFT JOIN action.hold_request targ_ahr ON
1340                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1341                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1342                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1343                                 'circ.staff.max_visible_event_age',
1344                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1345                         ) UNION
1346                         SELECT '1000 YEARS'::INTERVAL AS value
1347                 ) ous)
1348                 ]]></oils_persist:source_definition>
1349                 <fields oils_persist:primary="id">
1350                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1351                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1352                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1353                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1354                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1355                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1356                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1357                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1358                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1359                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1360                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1361                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1362                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1363                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1364                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1365                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1366                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1367                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1368                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1369                 </fields>
1370                 <links>
1371                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1372                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1373                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1374                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1375                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1376                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1377                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1378                 </links>
1379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1380                         <actions>
1381                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1382                         </actions>
1383                 </permacrud>
1384         </class>
1385
1386         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1387                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1388                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1389                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1390                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1391                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1392                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1393                 </fields>
1394                 <links>
1395                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1396                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1397                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1398                 </links>
1399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1400                         <actions>
1401                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1402                         </actions>
1403                 </permacrud>
1404         </class>
1405
1406         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1407                 <fields oils_persist:primary="code">
1408                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1409                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1410                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1411                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1412                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1413                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1414                 </fields>
1415                 <links/>
1416         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1417             <actions>
1418                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1419                 <retrieve/>
1420                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1421                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1422             </actions>
1423         </permacrud>
1424         </class>
1425
1426         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1427                 <fields oils_persist:primary="code">
1428                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1429                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1430                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1431                 </fields>
1432                 <links/>
1433         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1434             <actions>
1435                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1436                 <retrieve/>
1437                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1438                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1439             </actions>
1440         </permacrud>
1441         </class>
1442
1443         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1444                 <fields oils_persist:primary="code">
1445                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1446                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1447                 </fields>
1448                 <links/>
1449         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1450             <actions>
1451                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1452                 <retrieve/>
1453                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1454                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1455             </actions>
1456         </permacrud>
1457         </class>
1458
1459         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1460                 <fields oils_persist:primary="code">
1461                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1462                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1463                 </fields>
1464                 <links/>
1465         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1466             <actions>
1467                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1468                 <retrieve/>
1469                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1470                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1471             </actions>
1472         </permacrud>
1473         </class>
1474
1475         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1476                 <fields oils_persist:primary="code">
1477                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1478                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1479                 </fields>
1480                 <links/>
1481         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1482             <actions>
1483                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1484                 <retrieve/>
1485                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1486                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1487             </actions>
1488         </permacrud>
1489         </class>
1490
1491         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1492                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1493                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1494                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1495                 </fields>
1496                 <links/>
1497         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1498             <actions>
1499                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1500                 <retrieve/>
1501                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1502                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1503             </actions>
1504         </permacrud>
1505         </class>
1506
1507         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1508                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1509                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1510                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1511                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1512                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1513                 </fields>
1514         <links>
1515             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1516             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1517             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1518         </links>
1519         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1520             <actions>
1521                 <create permission="UPDATE_COPY">
1522                     <context link="target_copy" field="circ_lib"/>
1523                 </create>
1524                 <retrieve/>
1525                 <update permission="UPDATE_COPY">
1526                     <context link="target_copy" field="circ_lib"/>
1527                 </update>
1528                 <delete permission="UPDATE_COPY">
1529                     <context link="target_copy" field="circ_lib"/>
1530                 </delete>
1531             </actions>
1532         </permacrud>
1533         </class>
1534
1535         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1536                 <fields oils_persist:primary="code">
1537                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1538                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1539                 </fields>
1540                 <links/>
1541         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1542             <actions>
1543                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1544                 <retrieve/>
1545                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1546                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1547             </actions>
1548         </permacrud>
1549         </class>
1550
1551         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1552                 <fields oils_persist:primary="code">
1553                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1554                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1555                 </fields>
1556                 <links/>
1557         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1558             <actions>
1559                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1560                 <retrieve/>
1561                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1562                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1563             </actions>
1564         </permacrud>
1565         </class>
1566
1567         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
1568                 <fields oils_persist:primary="code">
1569                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1570                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1571                 </fields>
1572                 <links/>
1573         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1574             <actions>
1575                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1576                 <retrieve/>
1577                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1578                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1579             </actions>
1580         </permacrud>
1581         </class>
1582
1583     <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
1584         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1585             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1586             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1587             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1588             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1589             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1590             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1591             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1592             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1593             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1594             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1595             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1596             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1597             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1598             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1599             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1600             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1601             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1602         </fields>
1603         <links/>
1604         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1605             <actions>
1606                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1607                 <retrieve/>
1608                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1609                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1610             </actions>
1611         </permacrud>
1612     </class>
1613
1614     <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
1615         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1616             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1617             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1618             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1619             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1620             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1621             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1622             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1623             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1624             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1625             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1626             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1627             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1628             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1629             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1630             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1631             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1632             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1633             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1634             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1635         </fields>
1636         <links/>
1637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1638             <actions>
1639                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1640                 <retrieve/>
1641                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1642                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1643             </actions>
1644         </permacrud>
1645     </class>
1646
1647     <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
1648         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1649             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1650             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1651             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1652             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1653             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1654         </fields>
1655         <links>
1656             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1657             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1658             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1659         </links>
1660         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1661             <actions>
1662                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1663                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1664                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1665                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1666             </actions>
1667         </permacrud>
1668     </class>
1669
1670         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
1671                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1672                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1673                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1674                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1675                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1676                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1677                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1678                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1679                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1680                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1681                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1682                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1683                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1684                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1685                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1686                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1687                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1688             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1689                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1690                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1691                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1692                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1693                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1694                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1695                 </fields>
1696                 <links>
1697                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1698                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1699                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1700                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1701                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1702                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1703                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1704                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1705                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1706                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1707                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1708                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1709                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1710             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1711                 </links>
1712         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1713             <actions>
1714                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1715                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1716                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1717                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1718             </actions>
1719         </permacrud>
1720         </class>
1721
1722         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
1723                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1724                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1725                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1726                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1727                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1728                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1729                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1730                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1731                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1732                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1733                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1734                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1735                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1736                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1737                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1738                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1739             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1740                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1741                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1742             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1743                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1744                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1745                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1746                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1747             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1748             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1749             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1750                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1751                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1752                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1753                 </fields>
1754                 <links>
1755                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1756                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1757                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1758                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1759                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1760                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1761                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1762                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1763                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1764                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1765                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1766                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1767                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1768                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1769             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1770                 </links>
1771         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1772             <actions>
1773                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1774                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1775                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1776                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1777             </actions>
1778         </permacrud>
1779         </class>
1780
1781     <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
1782         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1783             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1784             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1785             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1786         </fields>
1787         <links/>
1788         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1789             <actions>
1790                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1791                 <retrieve/>
1792                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1793                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1794             </actions>
1795         </permacrud>
1796     </class>
1797
1798     <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
1799         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1800             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1801             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1802             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1803             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1804             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1805             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1806             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1807         </fields>
1808         <links>
1809             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1810         </links>
1811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1812             <actions>
1813                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1814                 <retrieve/>
1815                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1816                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1817             </actions>
1818         </permacrud>
1819     </class>
1820
1821     <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
1822         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
1823             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1824             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
1825             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1826             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
1827             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1828         </fields>
1829         <links>
1830             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
1831             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1832         </links>
1833         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1834             <actions>
1835                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1836                     <context link="matchpoint" field="org_unit"/>
1837                 </create>
1838                 <retrieve/>
1839                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1840                     <context link="matchpoint" field="org_unit"/>
1841                 </update>
1842                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1843                     <context link="matchpoint" field="org_unit"/>
1844                 </delete>
1845             </actions>
1846         </permacrud>
1847     </class>
1848
1849     <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
1850         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
1851             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1852             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1853             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
1854         </fields>
1855         <links>
1856             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1857             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
1858         </links>
1859         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1860             <actions>
1861                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1862                     <context link="limit_set" field="owning_lib"/>
1863                 </create>
1864                 <retrieve/>
1865                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1866                     <context link="limit_set" field="owning_lib"/>
1867                 </update>
1868                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1869                     <context link="limit_set" field="owning_lib"/>
1870                 </delete>
1871             </actions>
1872         </permacrud>
1873     </class>
1874     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
1875         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
1876             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1877             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1878             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
1879         </fields>
1880         <links>
1881             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1882             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
1883         </links>
1884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1885             <actions>
1886                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1887                     <context link="limit_set" field="owning_lib"/>
1888                 </create>
1889                 <retrieve/>
1890                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1891                     <context link="limit_set" field="owning_lib"/>
1892                 </update>
1893                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1894                     <context link="limit_set" field="owning_lib"/>
1895                 </delete>
1896             </actions>
1897         </permacrud>
1898     </class>
1899
1900     <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
1901         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
1902             <field reporter:label="ID" name="id" reporter:datatype="id"/>
1903             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
1904             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
1905             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
1906         </fields>
1907         <links>
1908             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
1909             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
1910         </links>
1911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1912             <actions>
1913                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1914                     <context link="limit_set" field="owning_lib"/>
1915                 </create>
1916                 <retrieve/>
1917                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1918                     <context link="limit_set" field="owning_lib"/>
1919                 </update>
1920                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
1921                     <context link="limit_set" field="owning_lib"/>
1922                 </delete>
1923             </actions>
1924         </permacrud>
1925     </class>
1926
1927         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
1928                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
1929                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1930                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1931                 </fields>
1932                 <links/>
1933         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1934             <actions>
1935                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
1936                 <retrieve/>
1937                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
1938                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
1939             </actions>
1940         </permacrud>
1941         </class>
1942
1943         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
1944                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
1945                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
1946                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
1947                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
1948                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
1949                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
1950                 </fields>
1951                 <links>
1952                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
1953                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
1954                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
1955                 </links>
1956         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1957             <actions>
1958                 <create permission="ADMIN_SURVEY">
1959                     <context link="survey" field="owner"/>
1960                 </create>
1961                 <retrieve/>
1962                 <update permission="ADMIN_SURVEY">
1963                     <context link="survey" field="owner"/>
1964                 </update>
1965                 <delete permission="ADMIN_SURVEY">
1966                     <context link="survey" field="owner"/>
1967                 </delete>
1968             </actions>
1969         </permacrud>
1970         </class>
1971         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
1972                 <fields oils_persist:primary="id" oils_persist:sequence="">
1973                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
1974                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
1975                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
1976                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
1977                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
1978                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
1979                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
1980                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
1981                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
1982                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
1983                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
1984                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
1985                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
1986                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
1987                 </fields>
1988                 <links>
1989                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
1990                 </links>
1991                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1992                         <actions>
1993                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
1994                                         <context link="usr" field="home_ou" />
1995                                 </retrieve>
1996                         </actions>
1997                 </permacrud>
1998         </class>
1999         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2000                 <fields oils_persist:primary="id" oils_persist:sequence="">
2001                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2002                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2003                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2004                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2005                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2006                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2007                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2008                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2009                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2010                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2011                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2012                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2013                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2014                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2015                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2016                 </fields>
2017                 <links>
2018                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2019                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2020                 </links>
2021         </class>
2022         <class id="aun" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_note" oils_persist:tablename="actor.usr_note" reporter:label="User Note">
2023                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2024                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2025                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2026                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2027                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2028                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2029                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2030                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2031                 </fields>
2032                 <links>
2033                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2034                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2035                 </links>
2036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2037             <actions>
2038                 <create permission="UPDATE_USER" context_field="owner">
2039                     <context link="usr" field="home_ou"/>
2040                 </create>
2041                                 <!-- note: public notes are still accessible via API -->
2042                 <retrieve permission="UPDATE_USER">
2043                     <context link="usr" field="home_ou"/>
2044                                 </retrieve>
2045                 <update permission="UPDATE_USER">
2046                     <context link="usr" field="home_ou"/>
2047                                 </update>
2048                 <delete permission="UPDATE_USER">
2049                     <context link="usr" field="home_ou"/>
2050                                 </delete>
2051             </actions>
2052         </permacrud>
2053         </class>
2054         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2055                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2056                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2057                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2058                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2059                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2060                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2061                 </fields>
2062                 <links>
2063                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2064                 </links>
2065         </class>
2066         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2067                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2068                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2069                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2070                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2071                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2072                 </fields>
2073                 <links>
2074                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2075                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2076                 </links>
2077         </class>
2078         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2079                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2080                         <field name="field" reporter:datatype="link"/>
2081                         <field name="id" reporter:datatype="id" />
2082                         <field name="source" reporter:datatype="link"/>
2083                         <field name="value" reporter:datatype="text"/>
2084                 </fields>
2085                 <links>
2086                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2087                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2088                 </links>
2089         </class>
2090         <class id="aihu" controller="open-ils.cstore" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2091                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2092                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2093                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2094                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2095                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2096                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2097                 </fields>
2098                 <links>
2099                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2100                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2101                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2102                 </links>
2103         </class>
2104         <class id="ancihu" controller="open-ils.cstore" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2105                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2106                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2107                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2108                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2109                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2110                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2111                 </fields>
2112                 <links>
2113                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2114                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2115                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2116                 </links>
2117         </class>
2118         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2119                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2120                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2121                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2122                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2123                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2124                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2125                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2126                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2127                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2128                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2129                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2130                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2131                 </fields>
2132                 <links>
2133                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2134                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2135                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2136                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2137                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2138                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2139                 </links>
2140         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2141             <actions>
2142                 <create permission="TRANSIT_COPY" context_field="owner">
2143                     <context link="target_copy" field="circ_lib"/>
2144                 </create>
2145                 <retrieve/>
2146                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2147                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2148             </actions>
2149         </permacrud>
2150         </class>
2151         <class id="asvr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_response" oils_persist:tablename="action.survey_response" reporter:label="Survey Response">
2152                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2153                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2154                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2155                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2156                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2157                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2158                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2159                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2160                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2161                 </fields>
2162                 <links>
2163                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2164                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2165                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2166                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2167                 </links>
2168         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2169             <actions>
2170                 <create permission="ADMIN_SURVEY">
2171                     <context link="survey" field="owner"/>
2172                 </create>
2173                 <retrieve/>
2174                 <update permission="ADMIN_SURVEY">
2175                     <context link="survey" field="owner"/>
2176                 </update>
2177                 <delete permission="ADMIN_SURVEY">
2178                     <context link="survey" field="owner"/>
2179                 </delete>
2180             </actions>
2181         </permacrud>
2182         </class>
2183         <class id="ccbi" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2184                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2185                         <field name="bucket" />
2186                         <field name="id" reporter:datatype="id" />
2187                         <field name="target_copy" reporter:datatype="link"/>
2188                         <field name="create_time" reporter:datatype="timestamp" />
2189                         <field name="pos" reporter:datatype="int" />
2190                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2191                 </fields>
2192                 <links>
2193                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2194                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2195             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2196                 </links>
2197         </class>
2198         <class id="ccbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item_note" oils_persist:tablename="container.copy_bucket_item_note" reporter:label="Copy Bucket Item Note">
2199                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2200                         <field name="id" reporter:datatype="id" />
2201                         <field name="item" reporter:datatype="link"/>
2202                         <field name="note" reporter:datatype="text" />
2203                 </fields>
2204                 <links>
2205                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2206                 </links>
2207         </class>
2208
2209         <class id="acs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set" oils_persist:tablename="authority.control_set" reporter:label="Authority Control Set" oils_persist:field_safe="true">
2210                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2211                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2212                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2213                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2214                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2215                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2216                 </fields>
2217                 <links>
2218                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2219                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2220                 </links>
2221                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2222                         <actions>
2223                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2224                                 <retrieve/>
2225                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2226                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2227                         </actions>
2228                 </permacrud>
2229         </class>
2230
2231         <class id="acsaf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_authority_field" oils_persist:tablename="authority.control_set_authority_field" reporter:label="Authority Control Set Authority Field" oils_persist:field_safe="true">
2232                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2233                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2234                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2235                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2236                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2237                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2238                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2239                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2240                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2241                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2242                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2243                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2244                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2245                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2246                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2247                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2248                 </fields>
2249                 <links>
2250                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2251                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2252                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2253                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2254                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2255                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2256                 </links>
2257                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2258                         <actions>
2259                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2260                                 <retrieve/>
2261                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2262                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2263                         </actions>
2264                 </permacrud>
2265         </class>
2266
2267         <class id="acsbf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field" oils_persist:tablename="authority.control_set_bib_field" reporter:label="Authority Control Set Bib Field" oils_persist:field_safe="true">
2268                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2269                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2270                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2271                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2272                 </fields>
2273                 <links>
2274                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2275                 </links>
2276                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2277                         <actions>
2278                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2279                                 <retrieve/>
2280                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2281                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2282                         </actions>
2283                 </permacrud>
2284         </class>
2285
2286         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2287                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2288                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2289                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2290                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2291                 </fields>
2292                 <links>
2293                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2294                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2295                 </links>
2296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2297                         <actions>
2298                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2299                                 <retrieve/>
2300                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2301                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2302                         </actions>
2303                 </permacrud>
2304         </class>
2305
2306         <class id="at" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::thesaurus" oils_persist:tablename="authority.thesaurus" reporter:label="Authority Thesaurus" oils_persist:field_safe="true">
2307                 <fields oils_persist:primary="code">
2308                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2309                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2310                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2311                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2312                 </fields>
2313                 <links>
2314                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2315                 </links>
2316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2317                         <actions>
2318                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2319                                 <retrieve/>
2320                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2321                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2322                         </actions>
2323                 </permacrud>
2324         </class>
2325
2326         <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis" oils_persist:field_safe="true">
2327                 <fields oils_persist:primary="code">
2328                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2329                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2330                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2331                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2332                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2333                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2334                 </fields>
2335                 <links>
2336                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2337                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2338                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2339                 </links>
2340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2341                         <actions>
2342                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2343                                 <retrieve/>
2344                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2345                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2346                         </actions>
2347                 </permacrud>
2348         </class>
2349
2350     <class id="abaafm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis_authority_field_map" oils_persist:tablename="authority.browse_axis_authority_field_map" reporter:label="Authority Browse Axis Field Map" oils_persist:field_safe="true">
2351         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2352             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2353             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2354             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2355         </fields>
2356         <links>
2357             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2358             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2359         </links>
2360         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2361             <actions>
2362                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2363                 <retrieve/>
2364                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2365                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2366             </actions>
2367         </permacrud>
2368     </class>
2369
2370         <class id="are" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_entry" oils_persist:tablename="authority.record_entry" reporter:label="Authority Record Entry">
2371                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2372                         <field name="active" reporter:datatype="bool"/>
2373                         <field name="create_date" reporter:datatype="timestamp"/>
2374                         <field name="creator" />
2375                         <field name="deleted" reporter:datatype="bool"/>
2376                         <field name="edit_date" reporter:datatype="timestamp"/>
2377                         <field name="editor" />
2378                         <field name="id" reporter:datatype="id" />
2379                         <field name="last_xact_id" />
2380                         <field name="marc" />
2381                         <field name="source" />
2382                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2383                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2384                         <field name="heading" />
2385                         <field name="simple_heading" />
2386                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2387                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2388                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2389                 </fields>
2390                 <links>
2391                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2392                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2393                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2394                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2395                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2396                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2397                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2398                 </links>
2399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2400                         <actions>
2401                                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2402                                 <retrieve/>
2403                                 <update permission="UPDATE_MARC" global_required="true"/>
2404                                 <delete permission="UPDATE_MARC" global_required="true"/>
2405                         </actions>
2406                 </permacrud>
2407         </class>
2408         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2409                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2410                         <field name="char_encoding" />
2411                         <field name="id" />
2412                         <field name="record" />
2413                         <field name="record_status" />
2414                         <field name="thesaurus" />
2415                 </fields>
2416                 <links>
2417                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2418                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2419                 </links>
2420         </class>
2421         <class id="abl" controller="open-ils.cstore" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
2422                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2423                         <field name="id" reporter:datatype="id" />
2424                         <field name="bib" reporter:datatype="link" />
2425                         <field name="authority" reporter:datatype="link" />
2426                 </fields>
2427                 <links>
2428                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2429                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2430                 </links>
2431         </class>
2432         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2433                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2434                         <field name="id" reporter:datatype="id" />
2435                         <field name="record" reporter:datatype="link" />
2436                         <field name="atag" reporter:datatype="link" />
2437                         <field name="value" reporter:datatype="text" />
2438                 </fields>
2439                 <links>
2440                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2441                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2442                 </links>
2443         </class>
2444         <class id="clm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::language_map" oils_persist:tablename="config.language_map" reporter:label="Language Map" oils_persist:field_safe="true">
2445                 <fields oils_persist:primary="code" oils_persist:sequence="">
2446                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2447                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2448                 </fields>
2449                 <links/>
2450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2451             <actions>
2452                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2453                 <retrieve/>
2454                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2455                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2456             </actions>
2457         </permacrud>
2458         </class>
2459         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
2460                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2461                         <field name="accepting_usr" />
2462                         <field name="amount" reporter:datatype="money" />
2463                         <field name="amount_collected" reporter:datatype="money" />
2464                         <field name="approval_code" reporter:datatype="text"/>
2465                         <field name="cash_drawer" reporter:datatype="link"/>
2466                         <field name="cc_first_name" reporter:datatype="text"/>
2467                         <field name="cc_last_name" reporter:datatype="text"/>
2468                         <field name="cc_number" reporter:datatype="text"/>
2469                         <field name="cc_order_number" reporter:datatype="text"/>
2470                         <field name="cc_type" reporter:datatype="text"/>
2471                         <field name="cc_processor" reporter:datatype="text"/>
2472                         <field name="expire_month" reporter:datatype="int" />
2473                         <field name="expire_year" reporter:datatype="int" />
2474                         <field name="id" reporter:datatype="id" />
2475                         <field name="note" reporter:datatype="text"/>
2476                         <field name="payment_ts" reporter:datatype="timestamp"/>
2477                         <field name="xact" reporter:datatype="link"/>
2478                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2479                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2480                 </fields>
2481                 <links>
2482                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2483                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2484                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2485                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2486                 </links>
2487         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2488             <actions>
2489                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2490                     <context link="xact" jump="usr" field="home_ou"/>
2491                 </retrieve>
2492                         </actions>
2493                 </permacrud>
2494         </class>
2495         <class id="cxt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::xml_transform" oils_persist:tablename="config.xml_transform" reporter:label="XML/XSLT Transform Definition">
2496                 <fields oils_persist:primary="name">
2497                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2498                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2499                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2500                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2501                 </fields>
2502                 <links/>
2503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2504             <actions>
2505                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2506                 <retrieve/>
2507                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2508                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2509             </actions>
2510         </permacrud>
2511         </class>
2512
2513         <class id="cmsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_search_alias" oils_persist:tablename="config.metabib_search_alias" reporter:label="Metabib Search Alias" oils_persist:field_safe="true">
2514                 <fields oils_persist:primary="alias">
2515                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2516                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2517                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2518                 </fields>
2519                 <links>
2520                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2521                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2522                 </links>
2523         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2524             <actions>
2525                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2526                 <retrieve/>
2527                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2528                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2529             </actions>
2530         </permacrud>
2531         </class>
2532
2533         <class id="cmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class" oils_persist:tablename="config.metabib_class" reporter:label="Metabib Class" oils_persist:field_safe="true">
2534                 <fields oils_persist:primary="name">
2535                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2536                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2537                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2538                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2539                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2540                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2541                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2542                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2543                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2544                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2545                 </fields>
2546                 <links>
2547                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2548                 </links>
2549         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2550             <actions>
2551                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2552                 <retrieve/>
2553                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2554                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2555             </actions>
2556         </permacrud>
2557         </class>
2558
2559         <class id="cmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field" oils_persist:tablename="config.metabib_field" reporter:label="Metabib Field" oils_persist:field_safe="true">
2560                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2561                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2562                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2563                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2564                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2565                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2566                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2567                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2568                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2569                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2570                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2571                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2572                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2573                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2574                 </fields>
2575                 <links>
2576                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2577                 </links>
2578         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2579             <actions>
2580                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2581                 <retrieve/>
2582                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2583                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2584             </actions>
2585         </permacrud>
2586         </class>
2587         <class id="cbho" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::best_hold_order" oils_persist:tablename="config.best_hold_order" reporter:label="Best-Hold Sort Order">
2588                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2589                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2590                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2591                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2592                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2593                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2594                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2595                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2596                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2597                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2598                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2599                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2600                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2601                 </fields>
2602                 <links>
2603                 </links>
2604                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2605                         <actions>
2606                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2607                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2608                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2609                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2610                         </actions>
2611                 </permacrud>
2612         </class>
2613         <class id="cbfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::biblio_fingerprint" oils_persist:tablename="config.biblio_fingerprint" reporter:label="Fingerprint Definition">
2614                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2615                         <field name="id" reporter:datatype="id" />
2616                         <field name="name" reporter:datatype="text"/>
2617                         <field name="xpath" reporter:datatype="text"/>
2618                         <field name="format" reporter:datatype="link"/>
2619                         <field name="first_word" reporter:datatype="bool" />
2620                 </fields>
2621                 <links/>
2622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2623             <actions>
2624                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2625                 <retrieve/>
2626                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2627                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2628             </actions>
2629         </permacrud>
2630         </class>
2631         <class id="cam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::audience_map" oils_persist:tablename="config.audience_map" reporter:label="Audience Map" oils_persist:field_safe="true">
2632                 <fields oils_persist:primary="code" oils_persist:sequence="">
2633                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2634                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2635                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2636                 </fields>
2637                 <links/>
2638         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2639             <actions>
2640                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2641                 <retrieve/>
2642                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2643                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2644             </actions>
2645         </permacrud>
2646         </class>
2647         <class id="cifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_form_map" oils_persist:tablename="config.item_form_map" reporter:label="Item Form Map" oils_persist:field_safe="true">
2648                 <fields oils_persist:primary="code" oils_persist:sequence="">
2649                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2650                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2651                 </fields>
2652                 <links/>
2653         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2654             <actions>
2655                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2656                 <retrieve/>
2657                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2658                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2659             </actions>
2660         </permacrud>
2661         </class>
2662     <class id="acnc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_class" oils_persist:tablename="asset.call_number_class" reporter:label="Call number classification scheme">
2663         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2664             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2665             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2666             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2667             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2668         </fields>
2669         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2670             <actions>
2671                 <retrieve/>
2672             </actions>
2673         </permacrud>
2674     </class>
2675         <class id="acns" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_suffix" oils_persist:tablename="asset.call_number_suffix" reporter:label="Call Number/Volume Suffix">
2676                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2677                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2678                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2679                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2680                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2681                 </fields>
2682                 <links>
2683                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2684                 </links>
2685         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2686             <actions>
2687                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2688                 <retrieve/>
2689                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2690                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2691             </actions>
2692         </permacrud>
2693         </class>
2694         <class id="acnp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_prefix" oils_persist:tablename="asset.call_number_prefix" reporter:label="Call Number/Volume Prefix">
2695                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2696                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2697                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2698                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2699                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2700                 </fields>
2701                 <links>
2702                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2703                 </links>
2704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2705             <actions>
2706                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2707                 <retrieve/>
2708                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2709                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2710             </actions>
2711         </permacrud>
2712         </class>
2713         <class id="acn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number" oils_persist:tablename="asset.call_number" reporter:label="Call Number/Volume">
2714                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2715                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2716                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2717                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2718                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2719                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2720                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2721                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2722                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2723                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2724                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2725                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2726                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2727                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2728                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2729                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2730                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2731                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2732                 </fields>
2733                 <links>
2734                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2735                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2736                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2737                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2738                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2739                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2740                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2741                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2742                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2743                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2744                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2745                 </links>
2746         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2747             <actions>
2748                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2749                 <retrieve/>
2750                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2751                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2752             </actions>
2753         </permacrud>
2754         </class>
2755         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2756                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2757                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2758                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2759                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2760                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2761                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2762                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2763                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2764                 </fields>
2765                 <links>
2766                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2767                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
2768         </links>
2769         </class>
2770         <class id="auricnm" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri_call_number_map" oils_persist:tablename="asset.uri_call_number_map" reporter:label="Electronic Access URI to Call Number Map">
2771                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
2772                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2773                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
2774                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
2775                 </fields>
2776                 <links>
2777                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
2778                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
2779                 </links>
2780         </class>
2781         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
2782                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
2783                         <field name="id" reporter:datatype="id" />
2784                         <field name="value" oils_persist:i18n="true" />
2785                 </fields>
2786                 <links/>
2787         </class>
2788         <class id="mous" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_user_summary" oils_persist:tablename="money.open_usr_summary" reporter:label="Open User Summary">
2789                 <fields oils_persist:primary="usr" oils_persist:sequence="">
2790                         <field name="balance_owed" reporter:datatype="money" />
2791                         <field name="total_owed" reporter:datatype="money" />
2792                         <field name="total_paid" reporter:datatype="money" />
2793                         <field name="usr" reporter:datatype="link"/>
2794                 </fields>
2795                 <links>
2796                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2797         </links>
2798         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2799             <actions>
2800                 <retrieve permission="VIEW_USER">
2801                     <context link="usr" field="home_ou"/>
2802                 </retrieve>
2803             </actions>
2804         </permacrud>
2805         </class>
2806         <class id="mct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::collections_tracker" oils_persist:tablename="money.collections_tracker" reporter:label="Collections Tracker">
2807                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
2808                         <field name="collector" />
2809                         <field name="enter_time" reporter:datatype="timestamp"/>
2810                         <field name="id" reporter:datatype="id" />
2811                         <field name="location" reporter:datatype="link"/>
2812                         <field name="usr" reporter:datatype="link"/>
2813                 </fields>
2814                 <links>
2815                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2816                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
2817                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
2818                 </links>
2819         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2820             <actions>
2821                 <create permission="money.collections_tracker.create" context_field="location"/>
2822                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
2823                 <delete permission="money.collections_tracker.create" context_field="location"/>
2824             </actions>
2825         </permacrud>
2826         </class>
2827         <class id="bre" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_entry" oils_persist:tablename="biblio.record_entry" reporter:core="true" reporter:label="Bibliographic Record">
2828                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
2829                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2830                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2831                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
2832                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2833                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
2834                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
2835                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
2836                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2837                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
2838                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
2839                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
2840                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
2841                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
2842                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
2843                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
2844                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
2845                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2846                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
2847                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
2848                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
2849                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2850                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2851                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2852                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2853                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2854                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2855                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2856                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
2857                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
2858                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
2859                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
2860                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
2861                 </fields>
2862                 <links>
2863                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2864                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2865                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2866                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
2867                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
2868                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
2869                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
2870                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
2871                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
2872                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
2873                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
2874                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
2875                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
2876                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
2877                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
2878                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
2879                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
2880                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
2881                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
2882                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
2883                 </links>
2884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2885             <actions>
2886                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
2887                 <retrieve/>
2888                 <update permission="UPDATE_MARC" global_required="true"/>
2889                 <!-- 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. -->
2890                 <delete permission="DELETE_RECORD" global_required="true"/>
2891             </actions>
2892         </permacrud>
2893         </class>
2894         <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">
2895                 <fields oils_persist:primary="id">
2896                         <field name="dow_0_close" />
2897                         <field name="dow_0_open" />
2898                         <field name="dow_1_close" />
2899                         <field name="dow_1_open" />
2900                         <field name="dow_2_close" />
2901                         <field name="dow_2_open" />
2902                         <field name="dow_3_close" />
2903                         <field name="dow_3_open" />
2904                         <field name="dow_4_close" />
2905                         <field name="dow_4_open" />
2906                         <field name="dow_5_close" />
2907                         <field name="dow_5_open" />
2908                         <field name="dow_6_close" />
2909                         <field name="dow_6_open" />
2910                         <field name="id" reporter:datatype="id" />
2911                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
2912                 </fields>
2913                 <links>
2914                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
2915                 </links>
2916         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2917             <actions>
2918                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
2919                 <retrieve/>
2920                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
2921                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
2922             </actions>
2923         </permacrud>
2924         </class>
2925         <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">
2926                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
2927                         <field name="id" reporter:datatype="id" />
2928                         <field name="record" reporter:datatype="link"/>
2929                         <field name="label" reporter:datatype="text"/>
2930                         <field name="label_sortkey" reporter:datatype="text"/>
2931                 </fields>
2932                 <links>
2933                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2934                 </links>
2935         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2936             <actions>
2937                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
2938                 <retrieve/>
2939                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
2940                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
2941             </actions>
2942         </permacrud>
2943         </class>
2944         <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">
2945                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
2946                         <field name="id" reporter:datatype="id" />
2947                         <field name="target_copy" reporter:datatype="link" />
2948                         <field name="part" reporter:datatype="link"/>
2949                 </fields>
2950                 <links>
2951                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2952                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
2953                 </links>
2954         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2955             <actions>
2956                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
2957                 <retrieve/>
2958                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
2959                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
2960             </actions>
2961         </permacrud>
2962         </class>
2963         <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">
2964                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
2965                         <field name="close_end" reporter:datatype="timestamp" />
2966                         <field name="close_start" reporter:datatype="timestamp" />
2967                         <field name="id" reporter:datatype="id" />
2968                         <field name="org_unit" reporter:datatype="org_unit"/>
2969                         <field name="reason" reporter:datatype="text"/>
2970                 </fields>
2971                 <links>
2972                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2973                 </links>
2974         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2975             <actions>
2976                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2977                 <retrieve/>
2978                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2979                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
2980             </actions>
2981         </permacrud>
2982         </class>
2983         <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">
2984                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
2985                         <field name="extended" reporter:datatype="interval"/>
2986                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
2987                         <field name="max_renewals" reporter:datatype="int" />
2988                         <field name="name" reporter:datatype="text"/>
2989                         <field name="normal" reporter:datatype="interval"/>
2990                         <field name="shrt" reporter:datatype="interval"/>
2991                 </fields>
2992                 <links>
2993                 </links>
2994         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2995             <actions>
2996                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
2997                 <retrieve/>
2998                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
2999                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3000             </actions>
3001         </permacrud>
3002         </class>
3003
3004         <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">
3005                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3006                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3007                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3008             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3009                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3010             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3011                 </fields>
3012                 <links>
3013             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3014                 </links>
3015                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3016             <actions>
3017                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3018                 <retrieve/>
3019                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3020                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3021             </actions>
3022                 </permacrud>
3023         </class>
3024
3025         <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">
3026                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3027                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3028                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3029                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3030             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3031                 </fields>
3032                 <links>
3033                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3034                 </links>
3035                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3036             <actions>
3037                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3038                 <retrieve/>
3039                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3040                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3041             </actions>
3042                 </permacrud>
3043         </class>
3044
3045         <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">
3046                 <fields oils_persist:primary="id" oils_persist:sequence="">
3047                         <field name="balance_owed" reporter:datatype="money"/>
3048                         <field name="id" reporter:datatype="id" />
3049                         <field name="last_billing_note" reporter:datatype="text"/>
3050                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3051                         <field name="last_billing_type" reporter:datatype="text"/>
3052                         <field name="last_payment_note" reporter:datatype="text"/>
3053                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3054                         <field name="last_payment_type" reporter:datatype="text"/>
3055                         <field name="total_owed" reporter:datatype="money"/>
3056                         <field name="total_paid" reporter:datatype="money"/>
3057                         <field name="usr" reporter:datatype="link"/>
3058                         <field name="xact_finish" reporter:datatype="timestamp" />
3059                         <field name="xact_start" reporter:datatype="timestamp" />
3060                         <field name="xact_type" reporter:datatype="text"/>
3061                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3062                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3063                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3064                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3065                         <field name="billing_location" reporter:datatype="link"/>
3066                 </fields>
3067                 <links>
3068                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3069                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3070                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3071                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3072                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3073                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3074                 </links>
3075                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3076                         <actions>
3077                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3078                                         <context link="usr" field="home_ou" />
3079                                 </retrieve>
3080                         </actions>
3081                 </permacrud>
3082         </class>
3083         <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">
3084                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3085                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3086                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3087                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3088                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3089                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3090                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3091                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3092                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3093                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3094                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3095                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3096                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3097                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3098                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3099                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3100                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3101                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3102                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3103                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3104                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3105                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3106                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3107                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3108                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3109                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3110                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3111                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3112                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3113                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3114                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3115                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3116                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3117                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3118                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3119                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3120                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3121                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3122                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3123                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3124                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3125                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3126                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3127                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3128                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3129                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3130                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3131                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3132                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3133                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3134                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3135                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3136                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3137                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3138                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3139                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3140                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3141                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3142                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3143                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3144                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3145                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3146                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3147                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3148                 </fields>
3149                 <links>
3150                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3151                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3152                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3153                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3154                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3155                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3156                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3157                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3158                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3159                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3160                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3161                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3162                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3163                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3164                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3165                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3166                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3167                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3168                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3169                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3170                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3171                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3172                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3173                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3174                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3175                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3176                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3177                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3178                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3179                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3180                 </links>
3181                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3182                         <actions>
3183                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3184                         </actions>
3185                 </permacrud>
3186         </class>
3187         <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">
3188                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3189                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3190                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3191                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3192                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3193                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3194                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3195                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3196                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3197         </fields>
3198                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3199                         <actions>
3200                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3201                                 <retrieve/>
3202                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3203                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3204                         </actions>
3205                 </permacrud>
3206         </class>
3207         <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">
3208                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3209                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3210                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3211                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3212                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3213         </fields>
3214         <links>
3215                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3216                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3217                 </links>
3218                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3219                         <actions>
3220                                 <retrieve permission="RUN_REPORTS">
3221                                         <context link="usr" field="home_ou" />
3222                                 </retrieve>
3223                         </actions>
3224                 </permacrud>
3225         </class>
3226         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3227                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3228                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3229                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3230                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3231                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3232                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3233                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3234         </fields>
3235         <links>
3236                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3237                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3238                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3239                 </links>
3240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3241                         <actions>
3242                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3243                                         <context link="usr" field="home_ou" />
3244                                         <context link="ws" field="owning_lib" />
3245                                 </retrieve>
3246                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3247                                         <context link="usr" field="home_ou" />
3248                                         <context link="ws" field="owning_lib" />
3249                                 </create>
3250                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3251                                         <context link="usr" field="home_ou" />
3252                                         <context link="ws" field="owning_lib" />
3253                                 </update>
3254                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3255                                         <context link="usr" field="home_ou" />
3256                                         <context link="ws" field="owning_lib" />
3257                                 </delete>
3258                         </actions>
3259                 </permacrud>
3260         </class>
3261         <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">
3262                 <fields oils_persist:primary="name">
3263                         <field name="name" reporter:datatype="text"/>
3264                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3265                 </fields>
3266                 <links/>
3267                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3268                         <actions>
3269                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3270                                 <retrieve/>
3271                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3272                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3273                         </actions>
3274                 </permacrud>
3275         </class>
3276         <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">
3277                 <fields oils_persist:primary="name">
3278                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3279                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3280                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3281                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3282                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3283                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3284                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3285                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3286                 </fields>
3287                 <links>
3288                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3289                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3290                 </links>
3291                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3292                         <actions>
3293                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3294                                 <retrieve/>
3295                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3296                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3297                         </actions>
3298                 </permacrud>
3299         </class>
3300         <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">
3301                 <fields oils_persist:primary="name">
3302                         <field name="name" reporter:datatype="text"/>
3303                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3304                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3305                         <field name="datatype" reporter:datatype="text"/>
3306                         <field name="view_perm" reporter:datatype="link"/>
3307                         <field name="update_perm" reporter:datatype="link"/>
3308                         <field name="fm_class" reporter:datatype="text"/>
3309                         <field name="grp" reporter:datatype="link"/>
3310                 </fields>
3311                 <links>
3312                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3313                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3314                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3315                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3316                 </links>
3317                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3318                         <actions>
3319                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3320                                 <retrieve/>
3321                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3322                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3323                         </actions>
3324                 </permacrud>
3325         </class>
3326         <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">
3327                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3328                         <field name="id" />
3329                         <field name="name"  reporter:datatype="text"/>
3330                         <field name="org_unit" reporter:datatype="org_unit"/>
3331                         <field name="value"  reporter:datatype="text"/>
3332                 </fields>
3333                 <links>
3334                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3335                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3336                 </links>
3337         </class>
3338         <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">
3339                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3340                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3341                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3342                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3343                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3344                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3345                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3346                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3347                 </fields>
3348                 <links>
3349                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3350                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3351                 </links>
3352         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3353             <actions>
3354                 <create permission="CREATE_COPY_NOTE">
3355                     <context link="owning_copy" field="circ_lib"/>
3356                 </create>
3357                 <retrieve permission="VIEW_COPY_NOTES">
3358                     <context link="owning_copy" field="circ_lib"/>
3359                 </retrieve>
3360                 <update permission="UPDATE_COPY_NOTE">
3361                     <context link="owning_copy" field="circ_lib"/>
3362                 </update>
3363                 <delete permission="DELETE_COPY_NOTE">
3364                     <context link="owning_copy" field="circ_lib"/>
3365                 </delete>
3366             </actions>
3367         </permacrud>
3368         </class>
3369         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3370                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3371                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3372                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3373                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3374                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3375                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3376                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3377                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3378                 </fields>
3379                 <links>
3380                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3381                 </links>
3382         </class>
3383         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3384                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3385                         <field name="fingerprint"  reporter:datatype="text"/>
3386                         <field name="id" reporter:datatype="id" />
3387                         <field name="master_record" reporter:datatype="link"/>
3388                         <field name="mods"  reporter:datatype="text"/>
3389                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3390                 </fields>
3391                 <links>
3392                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3393                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3394                 </links>
3395         </class>
3396         <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">
3397                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3398                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3399                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3400                 </fields>
3401                 <links/>
3402         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3403             <actions>
3404                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3405                 <retrieve/>
3406                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3407                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3408             </actions>
3409         </permacrud>
3410         </class>
3411         <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">
3412                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3413                         <field name="code"  reporter:datatype="text"/>
3414                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3415                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3416                 </fields>
3417                 <links/>
3418         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3419             <actions>
3420                 <create permission="CREATE_PERM" global_required="true"/>
3421                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3422                 <update permission="UPDATE_PERM" global_required="true"/>
3423                 <delete permission="DELETE_PERM" global_required="true"/>
3424             </actions>
3425         </permacrud>
3426         </class>
3427         <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">
3428                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3429                         <field name="id" reporter:datatype="id" />
3430                         <field name="metarecord" reporter:datatype="link"/>
3431                         <field name="source" reporter:datatype="link"/>
3432                 </fields>
3433                 <links>
3434                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3435                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3436                 </links>
3437         </class>
3438         <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">
3439                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3440                         <field name="id" reporter:datatype="id" />
3441                         <field name="field" reporter:datatype="link"/>
3442                         <field name="source" reporter:datatype="link"/>
3443                         <field name="value"  reporter:datatype="text"/>
3444                 </fields>
3445                 <links>
3446                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3447                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3448                 </links>
3449         </class>
3450         <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">
3451                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3452                         <field name="id" reporter:datatype="id" />
3453                         <field name="value" reporter:datatype="text"/>
3454                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3455                 </fields>
3456                 <links>
3457                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3458                 </links>
3459         </class>
3460         <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">
3461                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3462                         <field name="id" reporter:datatype="id" />
3463                         <field name="entry" reporter:datatype="link"/>
3464                         <field name="def" reporter:datatype="link"/>
3465                         <field name="source" reporter:datatype="link"/>
3466                 </fields>
3467                 <links>
3468                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3469                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3470                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3471                 </links>
3472         </class>
3473         <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">
3474                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3475                         <field name="id" reporter:datatype="id" />
3476                         <field name="entry" reporter:datatype="link"/>
3477                         <field name="simple_heading" reporter:datatype="link"/>
3478                 </fields>
3479                 <links>
3480                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3481                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3482                 </links>
3483         </class>
3484         <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">
3485                 <oils_persist:source_definition>
3486                         SELECT * FROM metabib.author_field_entry
3487                                                 UNION ALL
3488                         SELECT * FROM metabib.keyword_field_entry
3489                                                 UNION ALL
3490                         SELECT * FROM metabib.identifier_field_entry
3491                                                 UNION ALL
3492                         SELECT * FROM metabib.title_field_entry
3493                                                 UNION ALL
3494                         SELECT * FROM metabib.subject_field_entry
3495                                                 UNION ALL
3496                         SELECT * FROM metabib.series_field_entry
3497                 </oils_persist:source_definition>
3498                 <fields>
3499                         <field name="field" reporter:datatype="link"/>
3500                         <field name="id" reporter:datatype="id" />
3501                         <field name="source" reporter:datatype="link"/>
3502                         <field name="value"  reporter:datatype="text"/>
3503                 </fields>
3504                 <links>
3505                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3506                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3507                 </links>
3508         </class>
3509         <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">
3510                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3511                         <field name="field" reporter:datatype="link"/>
3512                         <field name="id" reporter:datatype="id" />
3513                         <field name="source" reporter:datatype="link"/>
3514                         <field name="value"  reporter:datatype="text"/>
3515                 </fields>
3516                 <links>
3517                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3518                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3519                 </links>
3520         </class>
3521         <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">
3522                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3523                         <field name="accepting_usr" reporter:datatype="link"/>
3524                         <field name="amount" reporter:datatype="money" />
3525                         <field name="amount_collected" reporter:datatype="money" />
3526                         <field name="cash_drawer" reporter:datatype="link"/>
3527                         <field name="id" reporter:datatype="id" />
3528                         <field name="note"  reporter:datatype="text"/>
3529                         <field name="payment_ts" reporter:datatype="timestamp"/>
3530                         <field name="xact" reporter:datatype="link"/>
3531                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3532                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3533                 </fields>
3534                 <links>
3535                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3536                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3537                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3538                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3539                 </links>
3540         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3541             <actions>
3542                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3543                     <context link="xact" jump="usr" field="home_ou"/>
3544                 </retrieve>
3545                         </actions>
3546                 </permacrud>
3547         </class>
3548         <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">
3549                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3550                         <field name="accepting_usr" reporter:datatype="link"/>
3551                         <field name="amount" reporter:datatype="money" />
3552                         <field name="amount_collected" reporter:datatype="money" />
3553                         <field name="id" reporter:datatype="id" />
3554                         <field name="note"  reporter:datatype="text"/>
3555                         <field name="payment_ts" reporter:datatype="timestamp"/>
3556                         <field name="xact" reporter:datatype="link"/>
3557                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3558                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3559                 </fields>
3560                 <links>
3561                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3562                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3563                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3564                 </links>
3565         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3566             <actions>
3567                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3568                     <context link="xact" jump="usr" field="home_ou"/>
3569                 </retrieve>
3570                         </actions>
3571                 </permacrud>
3572         </class>
3573         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3574                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3575                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3576                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3577                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3578                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3579                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3580                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3581                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3582                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3583                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3584                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3585                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3586                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3587                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3588                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3589                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3590                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3591                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3592                 </fields>
3593                 <links>
3594                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3595                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3596                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3597                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3598                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3599                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3600                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3601                 </links>
3602         </class>
3603
3604         <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">
3605                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3606                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3607                         <field name="name"  reporter:datatype="text"/>
3608                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3609                         <field name="block_list" reporter:datatype="text"/>
3610                         <field name="staff_alert" reporter:datatype="bool"/>
3611                         <field name="org_depth" reporter:datatype="int"/>
3612                 </fields>
3613                 <links/>
3614         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3615             <actions>
3616                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3617                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3618                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3619                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3620             </actions>
3621         </permacrud>
3622         </class>
3623         <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">
3624                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3625                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3626                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3627                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3628                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3629                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3630                 </fields>
3631                 <links>
3632                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3633                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3634                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3635         </links>
3636         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3637             <actions>
3638                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3639                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3640                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3641                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3642             </actions>
3643         </permacrud>
3644         </class>
3645         <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">
3646                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3647                         <field name="holdable" reporter:datatype="bool"/>
3648                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3649                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3650                         <field name="opac_visible" reporter:datatype="bool"/>
3651             <field name="copy_active" reporter:datatype="bool"/>
3652             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3653                 </fields>
3654                 <links/>
3655         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3656             <actions>
3657                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3658                 <retrieve/>
3659                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3660                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3661             </actions>
3662         </permacrud>
3663         </class>
3664         <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">
3665                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3666                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3667                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3668                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3669                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3670                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3671                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3672                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3673                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3674                 </fields>
3675                 <links>
3676                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3677                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3678                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3679                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3680                 </links>
3681                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3682                         <actions>
3683                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3684                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3685                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3686                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3687                         </actions>
3688                 </permacrud>
3689         </class>
3690         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3691                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3692                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3693                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3694                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3695                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3696                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3697                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3698                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3699                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3700                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3701                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3702                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3703                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3704                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3705                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3706                 </fields>
3707                 <links>
3708                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3709                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3710                 </links>
3711         </class>
3712         <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">
3713                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3714                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3715                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3716                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3717                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3718                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3719                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3720                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3721                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3722                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3723                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3724                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3725                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3726                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3727                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3728                 </fields>
3729                 <links>
3730                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3731                 </links>
3732                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3733                         <actions>
3734                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3735                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3736                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3737                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3738                         </actions>
3739                 </permacrud>
3740         </class>
3741
3742
3743         <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">
3744                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
3745                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3746                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
3747                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3748                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
3749                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
3750                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
3751                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
3752                 </fields>
3753                 <links>
3754                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
3755                 </links>
3756         </class>
3757
3758         <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">
3759                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
3760                         <field name="call_number" />
3761                         <field name="create_date" reporter:datatype="timestamp"/>
3762                         <field name="creator" reporter:datatype="link"/>
3763                         <field name="id" reporter:datatype="id" />
3764                         <field name="pub" reporter:datatype="bool"/>
3765                         <field name="title"  reporter:datatype="text"/>
3766                         <field name="value"  reporter:datatype="text"/>
3767                 </fields>
3768                 <links>
3769                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3770                 </links>
3771         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3772             <actions>
3773                 <create permission="CREATE_VOLUME_NOTE">
3774                     <context link="call_number" field="owning_lib"/>
3775                 </create>
3776                 <retrieve permission="VIEW_VOLUME_NOTES">
3777                     <context link="call_number" field="owning_lib"/>
3778                 </retrieve>
3779                 <update permission="UPDATE_VOLUME_NOTE">
3780                     <context link="call_number" field="owning_lib"/>
3781                 </update>
3782                 <delete permission="DELETE_VOLUME_NOTE">
3783                     <context link="call_number" field="owning_lib"/>
3784                 </delete>
3785             </actions>
3786         </permacrud>
3787         </class>
3788         <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">
3789                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
3790                         <field name="create_date" reporter:datatype="timestamp"/>
3791                         <field name="creator" reporter:datatype="link"/>
3792                         <field name="edit_date" reporter:datatype="timestamp"/>
3793                         <field name="editor" reporter:datatype="link"/>
3794                         <field name="id" reporter:datatype="id" />
3795                         <field name="record" reporter:datatype="link"/>
3796                         <field name="value" reporter:datatype="text"/>
3797                 </fields>
3798                 <links>
3799                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3800                 </links>
3801         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3802             <actions>
3803                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3804                 <retrieve/>
3805                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3806                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
3807             </actions>
3808         </permacrud>
3809         </class>
3810         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
3811         <oils_persist:source_definition>
3812 SELECT  usr,
3813         SUM(
3814             CASE
3815                 WHEN (
3816                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3817                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3818                 ) THEN 1
3819                 ELSE 0
3820             END
3821         ) AS out,
3822
3823         SUM(
3824             CASE
3825                 WHEN (
3826                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3827                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3828                 ) THEN 1
3829                 ELSE 0
3830             END
3831         ) AS overdue,
3832
3833         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
3834         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
3835         SUM( CASE WHEN stop_fines = 'LONGOVERDUE' THEN 1 ELSE 0 END) AS long_overdue
3836   FROM  action.circulation
3837   WHERE checkin_time IS NULL
3838   GROUP BY 1
3839         </oils_persist:source_definition>
3840         <fields oils_persist:primary="usr">
3841             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3842             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3843             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3844             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3845             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3846             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3847         </fields>
3848         <links>
3849             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3850         </links>
3851         </class>
3852         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
3853         <oils_persist:source_definition>
3854 SELECT  usr,
3855         STRING_AGG(
3856             CASE
3857                 WHEN (
3858                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
3859                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3860                 ) THEN id::TEXT
3861                 ELSE '0'
3862             END
3863         ,',') AS out,
3864
3865         STRING_AGG(
3866             CASE
3867                 WHEN (
3868                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
3869                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
3870                 ) THEN id::TEXT
3871                 ELSE '0'
3872             END
3873         ,',') AS overdue,
3874
3875         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
3876         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
3877         STRING_AGG( CASE WHEN stop_fines = 'LONGOVERDUE' THEN id::TEXT ELSE '0' END,',') AS long_overdue
3878   FROM  action.circulation
3879   WHERE checkin_time IS NULL
3880   GROUP BY 1
3881         </oils_persist:source_definition>
3882         <fields oils_persist:primary="usr">
3883             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
3884             <field reporter:label="Out" name="out" reporter:datatype="text"/>
3885             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
3886             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
3887             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
3888             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
3889         </fields>
3890         <links>
3891             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3892         </links>
3893         </class>
3894         <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">
3895                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3896                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3897                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3898                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3899                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3900                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3901                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3902                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3903                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3904                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3905                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3906                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3907                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3908                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3909                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3910                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3911                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3912                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3913                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3914                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3915                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3916                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3917                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3918                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
3919                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3920                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3921                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3922                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
3923                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
3924                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
3925                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
3926                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3927                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3928                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3929                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3930                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
3931                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
3932                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
3933                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
3934                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3935                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3936                 </fields>
3937                 <links>
3938                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
3939                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
3940                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
3941                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3942                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
3943                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3944                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3945                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
3946                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
3947                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
3948                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
3949                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
3950                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
3951                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
3952                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
3953                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
3954                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
3955                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
3956                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
3957                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
3958                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
3959                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
3960                 </links>
3961                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3962                         <actions>
3963                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
3964                         </actions>
3965                 </permacrud>
3966         </class>
3967         <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">
3968                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
3969                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
3970                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
3971                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
3972                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
3973                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
3974                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
3975                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
3976                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
3977                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
3978                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
3979                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
3980                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
3981                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
3982                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
3983                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
3984                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
3985                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
3986                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
3987                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
3988                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
3989                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
3990                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
3991                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
3992                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
3993                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
3994                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
3995                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
3996                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
3997                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
3998                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
3999                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4000                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4001                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4002                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4003                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4004                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4005                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4006                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4007                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4008                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4009                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4010                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4011                 </fields>
4012                 <links>
4013                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4014                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4015                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4016                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4017                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4018                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4019                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4020                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4021                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4022                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4023                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4024                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4025                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4026                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4027                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4028                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4029                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4030                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4031                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4032                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4033                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4034                 </links>
4035         </class>
4036         <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">
4037                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4038                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4039                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4040                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4041                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4042                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4043                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4044                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4045                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4046                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4047                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4048                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4049                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4050                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4051                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4052                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4053                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4054                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4055                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4056                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4057                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4058                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4059                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4060                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4061                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4062                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
4063                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4064                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4065                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4066                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4067                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4068                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4069                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4070                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4071                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4072                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4073                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4074                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4075                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4076                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4077                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4078                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4079                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4080                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4081                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4082                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4083                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4084                 </fields>
4085                 <links>
4086                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4087                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4088                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4089                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4090                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4091                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4092                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4093                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4094                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4095                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4096                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4097                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4098                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4099                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4100                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4101                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4102                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4103                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4104                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4105                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4106                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4107                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4108                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4109                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4110                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4111                 </links>
4112         </class>
4113
4114         <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">
4115                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4116                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4117                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4118                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4119                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4120                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4121                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4122                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4123                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4124                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4125                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4126                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4127                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4128                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4129                 </fields>
4130                 <links>
4131                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4132                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4133                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4134                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4135                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4136                 </links>
4137                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4138                         <actions>
4139                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4140                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4141                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4142                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4143                         </actions>
4144                 </permacrud>
4145         </class>
4146
4147         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4148                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4149                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4150                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4151                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4152                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4153                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4154                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4155                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4156                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4157                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4158                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4159                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4160                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4161                 </fields>
4162                 <links>
4163                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4164                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4165                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4166                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4167                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4168                 </links>
4169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4170                         <actions>
4171                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4172                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4173                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4174                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4175                         </actions>
4176                 </permacrud>
4177         </class>
4178         
4179         <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">
4180                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4181                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4182                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4183                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4184                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4185                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4186                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4187                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4188                 </fields>
4189                 <links>
4190                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4191                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4192                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4193                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4194                 </links>
4195                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4196                         <actions>
4197                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4198                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4199                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4200                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4201                         </actions>
4202                 </permacrud>
4203         </class>
4204         
4205         <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">
4206                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4207                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4208                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4209                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4210                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4211                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4212                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4213                 </fields>
4214                 <links>
4215                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4216                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4217                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4218                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4219                 </links>
4220                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4221                         <actions>
4222                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4223                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4224                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4225                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4226                         </actions>
4227                 </permacrud>
4228         </class>
4229         
4230         <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">
4231                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4232                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4233                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4234                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4235                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4236                 </fields>
4237                 <links>
4238                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4239                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4240                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4241                 </links>
4242                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4243                         <actions>
4244                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4245                     <context link="resource" field="owner" />
4246                 </create>
4247                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4248                     <context link="resource" field="owner" />
4249                 </retrieve>
4250                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4251                     <context link="resource" field="owner" />
4252                 </update>
4253                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4254                     <context link="resource" field="owner" />
4255                 </delete>
4256                         </actions>
4257                 </permacrud>
4258         </class>
4259         
4260         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4261                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4262                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4263                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4264                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4265                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4266                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4267                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4268                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4269                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4270                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4271                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4272                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4273                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4274                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4275                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4276                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4277                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4278                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4279                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4280                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4281                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4282                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4283                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4284                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4285                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4286                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4287                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4288                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4289                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4290                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4291                 </fields>
4292                 <links>
4293                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4294                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4295                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4296                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4297                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4298                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4299                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4300                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4301                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4302                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4303                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4304                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4305                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4306                 </links>
4307                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4308                         <actions>
4309                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4310                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4311                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4312                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4313                         </actions>
4314                 </permacrud>
4315         </class>
4316         
4317         <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">
4318                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4319                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4320                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4321                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4322                 </fields>
4323                 <links>
4324                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4325                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4326                 </links>
4327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4328                         <actions>
4329                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4330                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4331                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4332                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4333                         </actions>
4334                 </permacrud>
4335         </class>
4336
4337         <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">
4338                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4339                         <field name="bucket" reporter:datatype="link"/>
4340                         <field name="id" reporter:datatype="id" />
4341                         <field name="target_call_number" reporter:datatype="link" />
4342                         <field name="create_time" reporter:datatype="timestamp" />
4343                         <field name="pos" reporter:datatype="int" />
4344                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4345                 </fields>
4346                 <links>
4347                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4348                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4349             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4350                 </links>
4351         </class>
4352         <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">
4353                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4354                         <field name="id" reporter:datatype="id" />
4355                         <field name="item" reporter:datatype="link"/>
4356                         <field name="note" reporter:datatype="text" />
4357                 </fields>
4358                 <links>
4359                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4360                 </links>
4361         </class>
4362         <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">
4363                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4364                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4365                         <field name="btype" reporter:datatype="text"/>
4366                         <field name="id" reporter:datatype="id" />
4367                         <field name="name" reporter:datatype="text"/>
4368                         <field name="description" reporter:datatype="text"/>
4369                         <field name="owner" reporter:datatype="link"/>
4370                         <field name="pub" reporter:datatype="bool"/>
4371                         <field name="create_time" reporter:datatype="timestamp" />
4372                 </fields>
4373                 <links>
4374                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4375                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4376                 </links>
4377         </class>
4378         <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">
4379                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4380                         <field name="id" reporter:datatype="id" />
4381                         <field name="bucket" reporter:datatype="link"/>
4382                         <field name="note" reporter:datatype="text" />
4383                 </fields>
4384                 <links>
4385                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4386                 </links>
4387         </class>
4388         <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">
4389                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4390                         <field name="hold" reporter:datatype="link"/>
4391                         <field name="id" reporter:datatype="id" />
4392                         <field name="target_copy" reporter:datatype="link"/>
4393                         <field name="proximity" reporter:datatype="number"/>
4394                 </fields>
4395                 <links>
4396                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4397                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4398                 </links>
4399         </class>
4400         <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">
4401                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4402                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4403                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4404                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4405                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4406                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4407                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4408                 </fields>
4409                 <links>
4410                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4411                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4412                 </links>
4413         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4414             <actions>
4415                 <create permission="CREATE_HOLD_NOTIFICATION">
4416                                         <context link="hold" jump="usr" field="home_ou" />
4417                                 </create>
4418                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4419                                         <context link="hold" jump="usr" field="home_ou" />
4420                                 </retrieve>
4421                 <update permission="CREATE_HOLD_NOTIFICATION">
4422                                         <context link="hold" jump="usr" field="home_ou" />
4423                                 </update>
4424                 <delete permission="CREATE_HOLD_NOTIFICATION">
4425                                         <context link="hold" jump="usr" field="home_ou" />
4426                                 </delete>
4427             </actions>
4428         </permacrud>
4429         </class>
4430         <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">
4431                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4432                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4433                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4434                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4435                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4436                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4437                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4438                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4439                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4440                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4441                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4442                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4443                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4444                 </fields>
4445                 <links>
4446                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4447                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4448                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4449                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4450                 </links>
4451         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4452             <actions>
4453                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4454                 <retrieve/>
4455                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4456                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4457             </actions>
4458         </permacrud>
4459         </class>
4460         <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">
4461                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4462                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4463                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4464                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4465                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4466             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4467             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4468             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4469                 </fields>
4470                 <links>
4471                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4472                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4473                 </links>
4474         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4475             <actions>
4476                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4477                 <retrieve/>
4478                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4479                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4480             </actions>
4481         </permacrud>
4482         </class>
4483         <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">
4484                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4485                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4486             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4487             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4488                 </fields>
4489                 <links>
4490                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4491                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4492                 </links>
4493         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4494             <actions>
4495                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4496                                         <context link="lgroup" field="owner" />
4497                 </create>
4498                 <retrieve/>
4499                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4500                                         <context link="lgroup" field="owner" />
4501                 </update>
4502                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4503                                         <context link="lgroup" field="owner" />
4504                 </delete>
4505             </actions>
4506         </permacrud>
4507         </class>
4508
4509     <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">
4510         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4511             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4512             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4513             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4514             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4515         </fields>
4516         <links>
4517             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4518             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4519         </links>
4520         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4521             <actions>
4522                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4523                 <retrieve/>
4524                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4525                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4526             </actions>
4527         </permacrud>
4528     </class>
4529
4530         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4531                 <fields>
4532                         <field name="sre_id" oils_persist:virtual="true" />
4533                         <field name="location" oils_persist:virtual="true" />
4534                         <field name="owning_lib" oils_persist:virtual="true" />
4535                         <field name="basic_holdings" oils_persist:virtual="true" />
4536                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4537                         <field name="supplement_holdings" oils_persist:virtual="true" />
4538                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4539                         <field name="index_holdings" oils_persist:virtual="true" />
4540                         <field name="index_holdings_add" oils_persist:virtual="true" />
4541                         <field name="online" oils_persist:virtual="true" />
4542                         <field name="missing" oils_persist:virtual="true" />
4543                         <field name="incomplete" oils_persist:virtual="true" />
4544                 </fields>
4545         </class>
4546
4547         <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">
4548                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4549                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4550                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4551                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4552                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4553                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4554                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4555                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4556                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4557                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4558                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4559                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4560                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4561                 </fields>
4562                 <links>
4563                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4564                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4565                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4566                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4567                 </links>
4568                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4569                         <actions>
4570                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4571                                 <retrieve/>
4572                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4573                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4574                         </actions>
4575                 </permacrud>
4576         </class>
4577
4578         <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">
4579                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4580                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4581                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4582                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4583                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4584                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4585                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4586                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4587                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4588                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4589                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4590                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4591                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4592                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4593                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4594                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4595                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4596                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4597                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4598                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4599                 </fields>
4600                 <links>
4601                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4602                 </links>
4603                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4604                         <actions>
4605                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4606                                         <context link="subscription" field="owning_lib" />
4607                                 </create>
4608                                 <retrieve />
4609                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4610                                         <context link="subscription" field="owning_lib" />
4611                                 </update>
4612                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4613                                         <context link="subscription" field="owning_lib" />
4614                                 </delete>
4615                         </actions>
4616                 </permacrud>
4617         </class>
4618
4619         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4620                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4621                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4622                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4623                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4624                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4625                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4626                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4627                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4628                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4629                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4630                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4631                 </fields>
4632                 <links>
4633                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4634                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4635                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4636                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4637                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4638                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4639                 </links>
4640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4641                         <actions>
4642                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4643                                 <retrieve />
4644                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4645                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4646                         </actions>
4647                 </permacrud>
4648         </class>
4649
4650         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4651                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4652                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4653                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4654                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4655                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4656                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4657                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4658                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4659                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4660                 </fields>
4661                 <links>
4662                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4663                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4664                 </links>
4665         </class>
4666
4667         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4668                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4669                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4670                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4671                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4672                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4673                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4674                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4675                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4676                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4677                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4678                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4679                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4680                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4681                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
4682                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
4683                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4684                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4685                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4686                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4687                 </fields>
4688                 <links>
4689                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
4690                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4691                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
4692                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
4693                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
4694                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
4695                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
4696                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
4697                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
4698                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
4699                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
4700                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
4701                 </links>
4702                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4703                         <actions>
4704                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4705                                 <retrieve />
4706                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4707                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4708                         </actions>
4709                 </permacrud>
4710         </class>
4711
4712         <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">
4713                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
4714                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4715                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4716                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4717                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4718                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4719                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4720                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4721                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4722                 </fields>
4723                 <links>
4724                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4725                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4726                 </links>
4727                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4728                         <actions>
4729                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4730                                         <context link="distribution" field="holding_lib" />
4731                                 </create>
4732                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
4733                                         <context link="distribution" field="holding_lib" />
4734                                 </retrieve>
4735                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4736                                         <context link="distribution" field="holding_lib" />
4737                                 </update>
4738                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4739                                         <context link="distribution" field="holding_lib" />
4740                                 </delete>
4741                         </actions>
4742                 </permacrud>
4743         </class>
4744
4745         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
4746                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
4747                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4748                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4749                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
4750                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4751                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
4752                 </fields>
4753                 <links>
4754                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4755                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
4756                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
4757                 </links>
4758                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4759                         <actions>
4760                                 <create permission="ADMIN_SERIAL_STREAM">
4761                                         <context link="distribution" field="holding_lib" />
4762                                 </create>
4763                                 <retrieve />
4764                                 <update permission="ADMIN_SERIAL_STREAM">
4765                                         <context link="distribution" field="holding_lib" />
4766                                 </update>
4767                                 <delete permission="ADMIN_SERIAL_STREAM">
4768                                         <context link="distribution" field="holding_lib" />
4769                                 </delete>
4770                         </actions>
4771                 </permacrud>
4772         </class>
4773
4774         <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">
4775                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
4776                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4777                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4778                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4779                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
4780                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
4781                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
4782                 </fields>
4783                 <links>
4784                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4785                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
4786                 </links>
4787                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4788                         <actions>
4789                                 <create permission="ADMIN_SERIAL_STREAM">
4790                                         <context link="stream" jump="distribution" field="holding_lib" />
4791                                 </create>
4792                                 <retrieve permission="RECEIVE_SERIAL">
4793                                         <context link="stream" jump="distribution" field="holding_lib" />
4794                                 </retrieve>
4795                                 <update permission="ADMIN_SERIAL_STREAM">
4796                                         <context link="stream" jump="distribution" field="holding_lib" />
4797                                 </update>
4798                                 <delete permission="ADMIN_SERIAL_STREAM">
4799                                         <context link="stream" jump="distribution" field="holding_lib" />
4800                                 </delete>
4801                         </actions>
4802                 </permacrud>
4803         </class>
4804
4805         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
4806                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
4807                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4808                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4809                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4810                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4811                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4812                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4813                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
4814                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4815                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
4816                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
4817                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
4818                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
4819                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4820                 </fields>
4821                 <links>
4822                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4823                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4824                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4825                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
4826                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
4827                 </links>
4828                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4829                         <actions>
4830                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
4831                                         <context link="subscription" field="owning_lib" />
4832                                 </create>
4833                                 <retrieve/>
4834                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
4835                                         <context link="subscription" field="owning_lib" />
4836                                 </update>
4837                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
4838                                         <context link="subscription" field="owning_lib" />
4839                                 </delete>
4840                         </actions>
4841                 </permacrud>
4842         </class>
4843
4844         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
4845                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
4846                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4847                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
4848                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
4849                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4850                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
4851                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
4852                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4853                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
4854                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
4855                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
4856                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4857                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
4858                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
4859                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4860                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
4861                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4862                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
4863                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
4864                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
4865                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
4866                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
4867                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
4868                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
4869                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
4870                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
4871                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
4872                         <field reporter:label="Price" name="price" reporter:datatype="money" />
4873                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
4874                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
4875                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
4876                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
4877                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
4878                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
4879                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
4880                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
4881                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
4882                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4883                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4884                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4885                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
4886                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
4887                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4888                 </fields>
4889                 <links>
4890                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
4891                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4892                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4893                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4894                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4895                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
4896                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4897                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
4898                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
4899                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
4900                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
4901                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
4902                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
4903                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
4904                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
4905                 </links>
4906                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4907                         <actions>
4908                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4909                                 <retrieve/>
4910                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4911                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4912                         </actions>
4913                 </permacrud>
4914         </class>
4915
4916         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
4917                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
4918                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4919                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4920                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4921                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4922                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4923                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
4924                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4925                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
4926                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
4927                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
4928                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
4929                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
4930                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4931                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
4932                 </fields>
4933                 <links>
4934                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4935                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4936                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4937                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4938                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
4939                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
4940                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
4941                 </links>
4942                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4943                         <actions>
4944                                 <create permission="ADMIN_SERIAL_ITEM">
4945                                         <context link="stream" jump="distribution" field="holding_lib" />
4946                                 </create>
4947                                 <retrieve permission="ADMIN_SERIAL_ITEM">
4948                                         <context link="stream" jump="distribution" field="holding_lib" />
4949                                 </retrieve>
4950                                 <update permission="ADMIN_SERIAL_ITEM">
4951                                         <context link="stream" jump="distribution" field="holding_lib" />
4952                                 </update>
4953                                 <delete permission="ADMIN_SERIAL_ITEM">
4954                                         <context link="stream" jump="distribution" field="holding_lib" />
4955                                 </delete>
4956                         </actions>
4957                 </permacrud>
4958         </class>
4959
4960         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
4961                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
4962                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4963                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
4964                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4965                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4966                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4967                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4968                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4969                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4970                 </fields>
4971                 <links>
4972                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
4973                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4974                 </links>
4975                 <!-- Not available via PCRUD at this time -->
4976         </class>
4977         <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">
4978                 <fields>
4979                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
4980                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
4981                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
4982                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
4983                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
4984                 </fields>
4985                 <links>
4986                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4987                 </links>
4988         </class>
4989         <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">
4990                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
4991                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4992                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
4993                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
4994                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
4995                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
4996                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
4997                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
4998                 </fields>
4999                 <links>
5000                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5001                 </links>
5002         </class>
5003         <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">
5004                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5005                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5006                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5007                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5008                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5009                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5010                 </fields>
5011                 <links>
5012                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5013                 </links>
5014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5015                         <actions>
5016                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5017                                         <context link="distribution" field="holding_lib" />
5018                                 </create>
5019                                 <retrieve/>
5020                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5021                                         <context link="distribution" field="holding_lib" />
5022                                 </update>
5023                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5024                                         <context link="distribution" field="holding_lib" />
5025                                 </delete>
5026                         </actions>
5027                 </permacrud>
5028         </class>
5029
5030         <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">
5031                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5032                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5033                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5034                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5035                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5036                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5037                 </fields>
5038                 <links>
5039                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5040                 </links>
5041                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5042                         <actions>
5043                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5044                                         <context link="distribution" field="holding_lib" />
5045                                 </create>
5046                                 <retrieve/>
5047                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5048                                         <context link="distribution" field="holding_lib" />
5049                                 </update>
5050                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5051                                         <context link="distribution" field="holding_lib" />
5052                                 </delete>
5053                         </actions>
5054                 </permacrud>
5055         </class>
5056
5057         <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">
5058                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5059                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5060                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5061                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5062                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5063                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5064                 </fields>
5065                 <links>
5066                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5067                 </links>
5068                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5069                         <actions>
5070                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5071                                         <context link="distribution" field="holding_lib" />
5072                                 </create>
5073                                 <retrieve/>
5074                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5075                                         <context link="distribution" field="holding_lib" />
5076                                 </update>
5077                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5078                                         <context link="distribution" field="holding_lib" />
5079                                 </delete>
5080                         </actions>
5081                 </permacrud>
5082         </class>
5083
5084         <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">
5085                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5086                         <field name="id" reporter:datatype="id" />
5087                         <field name="owning_copy" reporter:datatype="link"/>
5088                         <field name="stat_cat" reporter:datatype="link"/>
5089                         <field name="stat_cat_entry" reporter:datatype="link"/>
5090                 </fields>
5091                 <links>
5092                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5093                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5094                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5095                 </links>
5096         </class>
5097         <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">
5098                 <fields oils_persist:primary="code">
5099                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5100                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5101                 </fields>
5102                 <links/>
5103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5104             <actions>
5105                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5106                 <retrieve/>
5107                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5108                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5109             </actions>
5110         </permacrud>
5111         </class>
5112         <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">
5113                 <fields oils_persist:primary="code">
5114                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5115                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5116                 </fields>
5117                 <links/>
5118         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5119             <actions>
5120                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5121                 <retrieve/>
5122                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5123                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5124             </actions>
5125         </permacrud>
5126         </class>
5127         <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">
5128                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5129                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5130                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5131                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5132                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5133                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5134                 </fields>
5135                 <links>
5136             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5137         </links>
5138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5139             <actions>
5140                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5141                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5142                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5143                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5144             </actions>
5145         </permacrud>
5146         </class>
5147         <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">
5148                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5149                         <field name="id" reporter:datatype="id" />
5150                         <field name="name" reporter:datatype="text"/>
5151                 </fields>
5152                 <links/>
5153         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5154             <actions>
5155                 <create permission="CREATE_LASSO" global_required="true"/>
5156                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5157                 <update permission="UPDATE_LASSO" global_required="true"/>
5158                 <delete permission="DELETE_LASSO" global_required="true"/>
5159             </actions>
5160         </permacrud>
5161         </class>
5162         <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">
5163                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5164                         <field name="id" reporter:datatype="id" />
5165                         <field name="lasso" reporter:datatype="link"/>
5166                         <field name="org_unit" reporter:datatype="org_unit"/>
5167                 </fields>
5168                 <links>
5169                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5170                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5171                 </links>
5172         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5173             <actions>
5174                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5175                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5176                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5177                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5178             </actions>
5179         </permacrud>
5180         </class>
5181         <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">
5182                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5183                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5184                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5185                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5186                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5187                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5188                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5189                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5190                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5191                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5192                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5193                 </fields>
5194                 <links>
5195                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5196                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5197                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5198                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5199                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5200                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5201                 </links>
5202         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5203             <actions>
5204                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5205                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5206                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5207                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5208             </actions>
5209         </permacrud>
5210         </class>
5211         <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">
5212                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5213                         <field name="id" reporter:datatype="id" />
5214                         <field name="from_org" reporter:datatype="org_unit"/>
5215                         <field name="to_org" reporter:datatype="org_unit"/>
5216                         <field name="prox" reporter:datatype="int" />
5217                 </fields>
5218                 <links>
5219                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5220                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5221                 </links>
5222         </class>
5223         <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">
5224                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5225                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5226                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5227                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5228                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5229                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5230                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5231                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5232                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5233                 </fields>
5234                 <links/>
5235         </class>
5236         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5237                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5238                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5239                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5240                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5241                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5242                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5243                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5244                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5245                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5246                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5247                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5248                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5249                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5250                 </fields>
5251                 <links>
5252                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5253                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5254                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5255                 </links>
5256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5257             <actions>
5258                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5259                 <retrieve/>
5260                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5261                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5262             </actions>
5263         </permacrud>
5264         </class>
5265         <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">
5266                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5267                         <field name="address_type"  reporter:datatype="text"/>
5268                         <field name="city"  reporter:datatype="text"/>
5269                         <field name="country"  reporter:datatype="text"/>
5270                         <field name="county"  reporter:datatype="text"/>
5271                         <field name="id" reporter:datatype="id" />
5272                         <field name="org_unit" reporter:datatype="org_unit"/>
5273                         <field name="post_code"  reporter:datatype="text"/>
5274                         <field name="state"  reporter:datatype="text"/>
5275                         <field name="street1"  reporter:datatype="text"/>
5276                         <field name="street2"  reporter:datatype="text"/>
5277                         <field name="valid" reporter:datatype="bool"/>
5278                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5279                 </fields>
5280                 <links>
5281                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5282                 </links>
5283         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5284             <actions>
5285                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5286                 <retrieve/>
5287                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5288                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5289             </actions>
5290         </permacrud>
5291         </class>
5292         <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">
5293                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5294                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5295                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5296                         <field name="query_text" reporter:datatype="text"/>
5297                 </fields>
5298         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5299             <actions>
5300                 <retrieve/>
5301             </actions>
5302         </permacrud>
5303         </class>
5304
5305         <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">
5306                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5307                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5308                         <field name="owner" reporter:datatype="org_unit"/>
5309                         <field name="code" reporter:datatype="text"/>
5310                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5311                         <field name="create_date" reporter:datatype="timestamp"/>
5312                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5313                 </fields>
5314                 <links>
5315                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5316                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5317                 </links>
5318         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5319             <actions>
5320                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5321                 <retrieve/>
5322                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5323                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5324             </actions>
5325         </permacrud>
5326         </class>
5327         <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">
5328                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5329                         <field name="id" reporter:datatype="id"/>
5330                         <field name="grp" reporter:datatype="link"/>
5331                         <field name="pos" reporter:datatype="int"/>
5332                         <field name="query" reporter:datatype="link"/>
5333                 </fields>
5334                 <links>
5335                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5336                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5337                 </links>
5338         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5339             <actions>
5340                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5341                     <context link="grp" field="owner"/>
5342                 </create>
5343                 <retrieve/>
5344                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5345                     <context link="grp" field="owner"/>
5346                 </update>
5347                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5348                     <context link="grp" field="owner"/>
5349                 </delete>
5350             </actions>
5351         </permacrud>
5352         </class>
5353
5354         <!-- A note: Please update alhr and ahopl when updating ahr -->
5355         <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">
5356                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5357                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5358                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5359                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5360                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5361                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5362                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5363                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5364                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5365                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5366                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5367                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5368                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5369                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5370                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5371                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5372                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5373                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5374                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5375                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5376                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5377                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5378                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5379                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5380                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5381                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5382                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5383                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5384                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5385                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5386                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5387                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5388                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5389                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5390                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5391                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5392                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5393                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5394                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5395                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5396                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5397                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5398                 </fields>
5399                 <links>
5400                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5401                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5402                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5403                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5404                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5405                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5406                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5407                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5408                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5409                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5410                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5411                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5412                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5413                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5414                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5415                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5416                 </links>
5417                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5418                         <actions>
5419                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5420                         </actions>
5421                 </permacrud>
5422         </class>
5423         <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">
5424                 <oils_persist:source_definition><![CDATA[
5425                 SELECT
5426                         ahr.*,
5427                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5428                                 copy_location_order_position,
5429                         CASE WHEN au.alias IS NOT NULL THEN
5430                                 au.alias
5431                         ELSE
5432                                 au.first_given_name
5433                         END AS usr_alias_or_first_given_name,
5434                         au.first_given_name AS usr_first_given_name,
5435                         au.second_given_name AS usr_second_given_name,
5436                         au.family_name AS usr_family_name,
5437                         au.prefix AS usr_prefix,
5438                         au.suffix AS usr_suffix,
5439                         au.alias AS usr_alias,
5440                         CASE WHEN au.alias IS NOT NULL THEN
5441                                 au.alias
5442                         ELSE
5443                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5444                                         COALESCE(au.family_name, ''),
5445                                         COALESCE(au.suffix, ''),
5446                                         ', ',
5447                                         COALESCE(au.prefix, ''),
5448                                         COALESCE(au.first_given_name, ''),
5449                                         COALESCE(au.second_given_name, '')
5450                                 ], ' '), E'\\s+,', ',')
5451                         END AS usr_alias_or_display_name,
5452                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5453                                 COALESCE(au.family_name, ''),
5454                                 COALESCE(au.suffix, ''),
5455                                 ', ',
5456                                 COALESCE(au.prefix, ''),
5457                                 COALESCE(au.first_given_name, ''),
5458                                 COALESCE(au.second_given_name, '')
5459                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5460                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5461                                 AS call_number_label,
5462                         siss.label AS issuance_label,
5463                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5464                         ahcm_1.copy_count AS potential_copies
5465                 FROM action.hold_request ahr
5466                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5467                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5468                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5469                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5470                 JOIN actor.usr au ON (au.id = ahr.usr)
5471                 JOIN (
5472                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5473                         FROM asset.copy_location
5474                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5475                 LEFT JOIN actor.usr_standing_penalty ausp 
5476                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5477                 LEFT JOIN config.standing_penalty csp
5478                         ON (
5479                                 csp.id = ausp.standing_penalty AND 
5480                                 csp.block_list LIKE '%CAPTURE%' AND (
5481                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5482                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5483                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5484                                         )
5485                                 )
5486                         )
5487                 JOIN (
5488                         SELECT COUNT(target_copy) AS copy_count, hold
5489                         FROM action.hold_copy_map
5490                         GROUP BY 2
5491                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5492                 LEFT JOIN serial.issuance siss
5493                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5494                 LEFT JOIN asset.copy_location_order acplo
5495                         ON (acp.location = acplo.location AND
5496                                 acp.circ_lib = acplo.org)
5497                 WHERE
5498                         ahr.capture_time IS NULL AND
5499                         ahr.cancel_time IS NULL AND
5500                         csp.id IS NULL AND
5501                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5502                         acp.status IN (0,7)
5503                 ]]></oils_persist:source_definition>
5504                 <fields oils_persist:primary="id">
5505                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5506                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5507                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5508                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5509                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5510                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5511                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5512                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5513                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5514                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5515                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5516                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5517                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5518                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5519                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5520                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5521                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5522                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5523                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5524                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5525                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5526                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5527                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5528                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5529                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5530                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5531                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5532                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5533                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5534                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5535                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5536                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5537                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5538                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5539                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5540                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5541                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5542                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5543                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5544                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5545                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5546                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5547                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5548                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5549                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5550                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5551                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5552                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5553                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5554                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5555                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5556                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5557                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5558                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5559                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5560                 </fields>
5561                 <links>
5562                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5563                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5564                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5565                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5566                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5567                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5568                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5569                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5570                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5571                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5572                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5573                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5574                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5575                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5576                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5577                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5578                 </links>
5579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5580                         <actions>
5581                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5582                         </actions>
5583                 </permacrud>
5584         </class>
5585         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5586                 <oils_persist:source_definition>
5587                         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)
5588                 </oils_persist:source_definition>
5589                 <fields oils_persist:primary="id">
5590                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5591                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5592                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5593                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5594                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5595                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5596                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5597                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5598                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5599                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5600                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5601                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5602                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5603                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5604                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5605                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5606                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5607                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5608                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5609                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5610                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5611                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5612                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5613                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5614                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5615                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5616                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5617                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5618                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5619                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5620                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5621                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5622                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5623                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5624                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5625                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5626                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5627                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5628                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5629                 </fields>
5630                 <links>
5631                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5632                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5633                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5634                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5635                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5636                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5637                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5638                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5639                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5640                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5641                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5642                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5643                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5644                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5645                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5646                 </links>
5647         </class>
5648
5649         <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">
5650                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5651                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5652                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5653                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5654                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5655                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5656                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5657                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5658                 </fields>
5659                 <links>
5660                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5661                 </links>
5662                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5663                         <actions>
5664                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5665                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5666                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5667                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5668                         </actions>
5669                 </permacrud>
5670         </class>
5671         <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">
5672                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5673                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5674                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5675                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5676                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5677                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5678                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5679                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5680                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5681                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5682                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5683                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5684                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5685                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5686                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5687                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5688                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5689                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5690                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5691                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5692                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5693                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5694                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5695                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5696                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5697                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5698                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5699                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5700                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5701                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5702                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5703                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5704                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5705                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5706                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5707                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5708                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5709                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5710                 </fields>
5711                 <links>
5712                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5713                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5714                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5715                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5716                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5717                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5718                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5719                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5720                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5721                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5722                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5723                 </links>
5724                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5725                         <actions>
5726                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5727                         </actions>
5728                 </permacrud>
5729         </class>
5730         <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">
5731                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5732                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5733                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5734                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5735                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5736                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5737                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5738                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5739                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5740                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5741                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5742                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5743                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5744                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5745                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5746                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5747                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5748                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5749                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5750                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5751                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5752                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5753                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5754                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5755                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5756                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5757                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5758                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5759                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5760                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5761                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5762                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5763                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5764                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5765                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5766                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5767                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5768                 </fields>
5769                 <links>
5770                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5771                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5772                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5773                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5774                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5775                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5776                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5777                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5778                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5779                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5780                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5781                 </links>
5782                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5783                         <actions>
5784                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5785                         </actions>
5786                 </permacrud>
5787         </class>
5788
5789         <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">
5790                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
5791                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
5792                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
5793                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
5794                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
5795                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
5796                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
5797                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5798                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
5799                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
5800                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
5801                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
5802                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
5803                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5804                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
5805                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
5806                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
5807                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5808                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
5809                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
5810                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
5811                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
5812                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
5813                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
5814                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
5815                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
5816                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
5817                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5818                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5819                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5820                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
5821                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
5822                 </fields>
5823                 <links>
5824                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
5825                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
5826                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
5827                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
5828                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
5829                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
5830                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
5831                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
5832                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
5833                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
5834                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
5835                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
5836                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
5837                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
5838                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
5839                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
5840                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
5841                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
5842                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
5843                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
5844                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
5845                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
5846                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
5847                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
5848                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
5849                 </links>
5850         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5851             <actions>
5852                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
5853                 <retrieve />
5854                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
5855                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
5856             </actions>
5857         </permacrud>
5858         </class>
5859         <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">
5860                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
5861                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5862                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
5863                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
5864                 </fields>
5865                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5866                         <actions>
5867                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5868                                 <retrieve/>
5869                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5870                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5871                         </actions>
5872                 </permacrud>
5873         </class>
5874         <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">
5875                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
5876                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5877                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
5878                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
5879                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
5880                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
5881                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
5882                 </fields>
5883                 <links>
5884                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
5885                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5886                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
5887                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
5888                 </links>
5889                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5890                         <actions>
5891                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5892                                 <retrieve/>
5893                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5894                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5895                         </actions>
5896                 </permacrud>
5897         </class>
5898         <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">
5899                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
5900                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5901                         <field name="btype" reporter:datatype="text"/>
5902                         <field name="id" reporter:datatype="id" />
5903                         <field name="name"  reporter:datatype="text"/>
5904                         <field name="description" reporter:datatype="text"/>
5905                         <field name="owner" reporter:datatype="link"/>
5906                         <field name="pub" reporter:datatype="bool"/>
5907                         <field name="create_time" reporter:datatype="timestamp" />
5908                 </fields>
5909                 <links>
5910                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5911                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
5912                 </links>
5913         </class>
5914         <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">
5915                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
5916                         <field name="id" reporter:datatype="id" />
5917                         <field name="bucket" reporter:datatype="link"/>
5918                         <field name="note" reporter:datatype="text" />
5919                 </fields>
5920                 <links>
5921                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5922                 </links>
5923         </class>
5924         <class id="asc" controller="open-ils.cstore" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
5925                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
5926                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5927                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5928                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5929                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5930                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5931                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5932                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5933                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5934                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5935                 </fields>
5936                 <links>
5937                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5938                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
5939                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
5940                 </links>
5941         </class>
5942         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
5943                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
5944                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
5945                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5946                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
5947                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5948                 </fields>
5949                 <links>
5950                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5951                 </links>
5952                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5953                         <actions>
5954                                 <retrieve permission="VIEW_USER">
5955                                         <context link="usr" field="home_ou" />
5956                                 </retrieve>
5957                         </actions>
5958                 </permacrud>
5959         </class>
5960     <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">
5961         <fields oils_persist:primary="field">
5962             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
5963             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
5964             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
5965         </fields>
5966         <links/>
5967         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5968             <actions>
5969                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
5970                 <retrieve />
5971                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
5972                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
5973             </actions>
5974         </permacrud>
5975     </class>
5976         <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">
5977                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
5978                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5979                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5980                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5981                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5982                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5983                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5984                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
5985                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5986                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5987                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5988                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5989                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
5990                 </fields>
5991                 <links>
5992                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5993                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
5994                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
5995                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
5996                 </links>
5997         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5998             <actions>
5999                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6000                 <retrieve />
6001                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6002                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6003             </actions>
6004         </permacrud>
6005         </class>
6006         <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">
6007                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6008                         <field name="field" reporter:datatype="link"/>
6009                         <field name="id" reporter:datatype="id" />
6010                         <field name="source" reporter:datatype="link"/>
6011                         <field name="value"  reporter:datatype="text"/>
6012                 </fields>
6013                 <links>
6014                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6015                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6016                 </links>
6017         </class>
6018         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6019                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6020                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6021                         <field name="btype" reporter:datatype="text"/>
6022                         <field name="id" reporter:datatype="id" />
6023                         <field name="name"  reporter:datatype="text"/>
6024                         <field name="description" reporter:datatype="text"/>
6025                         <field name="owner" reporter:datatype="link"/>
6026                         <field name="pub" reporter:datatype="bool"/>
6027                         <field name="create_time" reporter:datatype="timestamp" />
6028                 </fields>
6029                 <links>
6030                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6031                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6032                 </links>
6033         </class>
6034         <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">
6035                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6036                         <field name="id" reporter:datatype="id" />
6037                         <field name="bucket" reporter:datatype="link"/>
6038                         <field name="note" reporter:datatype="text" />
6039                 </fields>
6040                 <links>
6041                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6042                 </links>
6043         </class>
6044         <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">
6045                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6046                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6047                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6048                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6049                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6050                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6051                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6052                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6053                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6054                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6055                 </fields>
6056                 <links>
6057                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6058                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6059                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6060                 </links>
6061         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6062             <actions>
6063                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6064                     <context link="xact" jump="usr" field="home_ou"/>
6065                 </retrieve>
6066                         </actions>
6067                 </permacrud>
6068         </class>
6069         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6070                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6071                         <field name="id" reporter:datatype="id" />
6072                         <field name="ind1" />
6073                         <field name="ind2" />
6074                         <field name="record" />
6075                         <field name="subfield" />
6076                         <field name="tag" />
6077                         <field name="value" />
6078                 </fields>
6079                 <links>
6080                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6081                 </links>
6082         </class>
6083         <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">
6084                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6085                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6086                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6087                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6088                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6089                 </fields>
6090                 <links>
6091                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6092                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6093                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6094                 </links>
6095         </class>
6096         <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">
6097                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6098                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6099                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6100                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6101                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6102                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6103                 </fields>
6104                 <links>
6105                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6106                 </links>
6107         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6108             <actions>
6109                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6110                 <retrieve/>
6111                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6112                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6113             </actions>
6114         </permacrud>
6115
6116         </class>
6117         <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">
6118                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6119                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6120                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6121                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6122                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6123                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6124                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6125                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6126                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6127                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6128                 </fields>
6129                 <links>
6130                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6131                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6132                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6133                 </links>
6134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6135             <actions>
6136                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6137                 <retrieve/>
6138                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6139                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6140             </actions>
6141         </permacrud>
6142         </class>
6143         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6144                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6145                         <field name="create_date" reporter:datatype="timestamp"/>
6146                         <field name="creator" reporter:datatype="link"/>
6147                         <field name="edit_date" reporter:datatype="timestamp"/>
6148                         <field name="editor" reporter:datatype="link"/>
6149                         <field name="id" reporter:datatype="id" />
6150                         <field name="pub" reporter:datatype="bool"/>
6151                         <field name="record" reporter:datatype="link"/>
6152                         <field name="value"  reporter:datatype="text"/>
6153                 </fields>
6154                 <links>
6155                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6156                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6157                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6158                 </links>
6159         </class>
6160         <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">
6161                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6162                         <field name="balance_owed" reporter:datatype="money" />
6163                         <field name="total_owed" reporter:datatype="money" />
6164                         <field name="total_paid" reporter:datatype="money" />
6165                         <field name="usr" reporter:datatype="link"/>
6166                 </fields>
6167                 <links>
6168                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6169                 </links>
6170         </class>
6171         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6172                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6173                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6174                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6175                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6176                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6177                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6178                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6179                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6180                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6181                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6182                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6183                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6184                 </fields>
6185                 <links>
6186                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6187                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6188                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6189                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6190                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6191                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6192                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6193                 </links>
6194         </class>
6195         <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">
6196                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6197                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6198                         <field name="quality" reporter:datatype="int" />
6199                         <field name="source" reporter:datatype="text"/>
6200                         <field name="transcendant" reporter:datatype="bool"/>
6201                         <field name="can_have_copies" reporter:datatype="bool"/>
6202                 </fields>
6203                 <links/>
6204         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6205             <actions>
6206                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6207                 <retrieve/>
6208                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6209                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6210             </actions>
6211         </permacrud>
6212         </class>
6213         <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">
6214                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6215                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6216                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6217                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6218                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6219                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6220                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6221                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6222                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6223                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6224                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6225                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6226                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6227                 </fields>
6228                 <links>
6229                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6230                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6231                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6232                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6233                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6234                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6235                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6236                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6237                 </links>
6238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6239                         <actions>
6240                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6241                                         <context link="usr" field="home_ou" />
6242                                 </retrieve>
6243                         </actions>
6244                 </permacrud>
6245         </class>
6246         <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">
6247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6248                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6249                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6250                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6251                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6252                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6253                 </fields>
6254                 <links>
6255                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6256                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6257                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6258                 </links>
6259         </class>
6260         <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">
6261                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6262                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6263                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6264                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6265                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6266                 </fields>
6267                 <links>
6268                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6269                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6270                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6271                 </links>
6272         </class>
6273         <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">
6274                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6275                         <field name="bucket" reporter:datatype="link"/>
6276                         <field name="id" reporter:datatype="id" />
6277                         <field name="target_user" reporter:datatype="link"/>
6278                         <field name="create_time" reporter:datatype="timestamp" />
6279                         <field name="pos" reporter:datatype="int" />
6280                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6281                 </fields>
6282                 <links>
6283                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6284                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6285             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6286                 </links>
6287         </class>
6288         <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">
6289                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6290                         <field name="id" reporter:datatype="id" />
6291                         <field name="item" reporter:datatype="link"/>
6292                         <field name="note" reporter:datatype="text" />
6293                 </fields>
6294                 <links>
6295                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6296                 </links>
6297         </class>
6298         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6299                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6300                         <field name="balance_owed" reporter:datatype="money" />
6301                         <field name="total_owed" reporter:datatype="money" />
6302                         <field name="total_paid" reporter:datatype="money" />
6303                         <field name="usr" reporter:datatype="link"/>
6304                 </fields>
6305                 <links>
6306                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6307                 </links>
6308         </class>
6309         <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">
6310                 <fields oils_persist:primary="code" oils_persist:sequence="">
6311                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6312                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6313                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6314                 </fields>
6315                 <links/>
6316         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6317             <actions>
6318                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6319                 <retrieve/>
6320                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6321                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6322             </actions>
6323         </permacrud>
6324         </class>
6325         <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">
6326                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6327                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6328                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6329                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6330                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6331                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6332                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6333                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6334                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6335                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6336                 </fields>
6337                 <links>
6338                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6339                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6340                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6341                 </links>
6342         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6343             <actions>
6344                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6345                     <context link="xact" jump="usr" field="home_ou"/>
6346                 </retrieve>
6347                         </actions>
6348                 </permacrud>
6349         </class>
6350         <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">
6351                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6352                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6353                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6354                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6355                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6356                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6357                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6358                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6359                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6360                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6361                 </fields>
6362                 <links>
6363                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6364                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6365                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6366                 </links>
6367         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6368             <actions>
6369                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6370                     <context link="xact" jump="usr" field="home_ou"/>
6371                 </retrieve>
6372                         </actions>
6373                 </permacrud>
6374         </class>
6375         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6376                 <fields oils_persist:primary="id" oils_persist:sequence="">
6377                         <field name="checkin_lib" reporter:datatype="link"/>
6378                         <field name="checkin_staff" reporter:datatype="link"/>
6379                         <field name="checkin_time" reporter:datatype="timestamp"/>
6380                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6381                         <field name="circ_staff" reporter:datatype="link"/>
6382                         <field name="desk_renewal" reporter:datatype="bool"/>
6383                         <field name="due_date" reporter:datatype="timestamp"/>
6384                         <field name="duration" reporter:datatype="interval"/>
6385                         <field name="duration_rule" reporter:datatype="link"/>
6386                         <field name="fine_interval" reporter:datatype="interval"/>
6387                         <field name="id" reporter:datatype="id" />
6388                         <field name="max_fine" reporter:datatype="money" />
6389                         <field name="max_fine_rule" reporter:datatype="link"/>
6390                         <field name="opac_renewal" reporter:datatype="bool"/>
6391                         <field name="phone_renewal" reporter:datatype="bool"/>
6392                         <field name="recurring_fine" reporter:datatype="money" />
6393                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6394                         <field name="renewal_remaining" reporter:datatype="int" />
6395             <field name="grace_period" reporter:datatype="interval" />
6396                         <field name="stop_fines" reporter:datatype="text"/>
6397                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6398                         <field name="target_copy" reporter:datatype="link"/>
6399                         <field name="usr" reporter:datatype="link"/>
6400                         <field name="xact_finish" reporter:datatype="timestamp" />
6401                         <field name="xact_start" reporter:datatype="timestamp" />
6402                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6403                 </fields>
6404                 <links>
6405                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6406                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6407                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6408                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6409                 </links>
6410         </class>
6411         <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">
6412                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6413                         <field name="field" reporter:datatype="link"/>
6414                         <field name="id" reporter:datatype="id" />
6415                         <field name="source" reporter:datatype="link"/>
6416                         <field name="value" reporter:datatype="text"/>
6417                 </fields>
6418                 <links>
6419                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6420                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6421                 </links>
6422         </class>
6423         <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">
6424                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6425                         <field name="high" reporter:datatype="money" />
6426                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6427                         <field name="low" reporter:datatype="money" />
6428                         <field name="name" reporter:datatype="text"/>
6429                         <field name="normal" reporter:datatype="money" />
6430                         <field name="recurrence_interval" reporter:datatype="interval"/>
6431             <field name="grace_period" reporter:datatype="interval" />
6432                 </fields>
6433                 <links/>
6434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6435             <actions>
6436                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6437                 <retrieve/>
6438                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6439                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6440             </actions>
6441         </permacrud>
6442         </class>
6443         <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">
6444                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6445                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6446                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6447                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6448                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6449                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6450                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6451                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6452                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6453                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6454                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6455                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6456                 </fields>
6457                 <links>
6458                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6459                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6460                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6461                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6462                 </links>
6463         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6464             <actions>
6465                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6466                     <context link="xact" jump="usr" field="home_ou"/>
6467                 </retrieve>
6468                         </actions>
6469                 </permacrud>
6470         </class>
6471         <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">
6472                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6473                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6474                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6475                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6476                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6477                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6478                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6479                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6480                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6481                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6482                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6483                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6484                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6485                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6486                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6487                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6488                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6489                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6490                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6491                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6492                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6493                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6494                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6495                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6496                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6497                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6498                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6499                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6500                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6501                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6502                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6503                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6504                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6505                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6506                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6507                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6508                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6509                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6510                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6511                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6512                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6513                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6514                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6515                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6516                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6517                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6518                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6519                 </fields>
6520                 <links>
6521                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6522                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6523                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6524                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6525                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6526                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6527                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6528                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6529                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6530                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6531                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6532                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6533                         <link field="aged_circulation" reltype="has_many" key="target_copy" map="" class="acirc"/>
6534                         <link field="all_circulation" reltype="has_many" key="target_copy" map="" class="combcirc"/>
6535                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6536                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6537                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6538                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6539                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6540                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6541                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6542                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6543                 </links>
6544         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6545             <actions>
6546                 <create permission="CREATE_COPY">
6547                     <context link="call_number" field="owning_lib"/>
6548                 </create>
6549                 <retrieve/>
6550                 <update permission="UPDATE_COPY">
6551                     <context link="call_number" field="owning_lib"/>
6552                 </update>
6553                 <delete permission="DELETE_COPY">
6554                     <context link="call_number" field="owning_lib"/>
6555                 </delete>
6556             </actions>
6557         </permacrud>
6558         </class>
6559
6560         <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">
6561                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6562                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6563                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6564                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6565                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6566                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6567                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6568                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6569                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6570                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6571                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6572                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6573                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6574                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6575                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6576                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6577                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6578                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6579                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6580                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6581                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6582                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6583                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6584                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6585                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6586                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6587                 </fields>
6588                 <links>
6589                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6590                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6591                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6592                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6593                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6594                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6595                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6596                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6597                 </links>
6598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6599                         <actions>
6600                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6601                                 <retrieve />
6602                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6603                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6604                         </actions>
6605                 </permacrud>
6606         </class>
6607
6608         <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">
6609                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6610                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6611                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6612                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6613                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6614                 </fields>
6615                 <links/>
6616         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6617             <actions>
6618                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6619                 <retrieve/>
6620                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6621                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6622             </actions>
6623         </permacrud>
6624         </class>
6625         <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">
6626                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6627                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6628                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6629                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6630                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6631                 </fields>
6632                 <links/>
6633         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6634             <actions>
6635                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6636                 <retrieve/>
6637                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6638                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6639             </actions>
6640         </permacrud>
6641         </class>
6642         <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">
6643                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6644                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6645                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6646                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6647                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6648                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6649                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6650                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6651                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6652                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6653                 </fields>
6654                 <links>
6655                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6656                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6657                 </links>
6658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6659             <actions>
6660                 <create permission="CREATE_PERM" global_required="true"/>
6661                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6662                 <update permission="UPDATE_PERM" global_required="true"/>
6663                 <delete permission="DELETE_PERM" global_required="true"/>
6664             </actions>
6665         </permacrud>
6666         </class>
6667         <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">
6668                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6669                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6670                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
6671                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
6672                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
6673                 </fields>
6674                 <links>
6675                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
6676                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
6677                 </links>
6678         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6679             <actions>
6680                 <create permission="ADMIN_SURVEY">
6681                     <context link="question" jump="survey" field="owner"/>
6682                 </create>
6683                 <retrieve/>
6684                 <update permission="ADMIN_SURVEY">
6685                     <context link="question" jump="survey" field="owner"/>
6686                 </update>
6687                 <delete permission="ADMIN_SURVEY">
6688                     <context link="question" jump="survey" field="owner"/>
6689                 </delete>
6690             </actions>
6691         </permacrud>
6692         </class>
6693         <class id="ancc" controller="open-ils.cstore" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
6694                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
6695                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6696                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
6697                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
6698                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
6699                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
6700                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
6701                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
6702                 </fields>
6703                 <links>
6704                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
6705                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
6706                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
6707                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6708                 </links>
6709         </class>
6710         <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">
6711                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6712                         <field name="balance_owed" reporter:datatype="money" />
6713                         <field name="total_owed" reporter:datatype="money" />
6714                         <field name="total_paid" reporter:datatype="money" />
6715                         <field name="usr" reporter:datatype="link"/>
6716                 </fields>
6717                 <links>
6718                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6719                 </links>
6720         </class>
6721         <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">
6722                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
6723                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
6724                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
6725                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
6726                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
6727                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
6728                 </fields>
6729                 <links>
6730                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6731                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6732                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6733                 </links>
6734         </class>
6735         <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">
6736                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
6737                         <field name="field" reporter:datatype="link"/>
6738                         <field name="id" reporter:datatype="id" />
6739                         <field name="source" reporter:datatype="link"/>
6740                         <field name="value" reporter:datatype="text"/>
6741                 </fields>
6742                 <links>
6743                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6744                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6745                 </links>
6746         </class>
6747         <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">
6748                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
6749                         <field name="field" reporter:datatype="link"/>
6750                         <field name="id" reporter:datatype="id" />
6751                         <field name="source" reporter:datatype="link"/>
6752                         <field name="value" reporter:datatype="text"/>
6753                 </fields>
6754                 <links>
6755                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6756                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6757                 </links>
6758         </class>
6759         <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">
6760                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
6761                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6762                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
6763                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
6764                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
6765                 </fields>
6766                 <links>
6767                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
6768                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6769                 </links>
6770         </class>
6771         <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">
6772                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
6773                         <field name="depth" reporter:datatype="int" />
6774                         <field name="grantable" reporter:datatype="bool"/>
6775                         <field name="grp" reporter:datatype="link"/>
6776                         <field name="id" reporter:datatype="id" />
6777                         <field name="perm" reporter:datatype="link"/>
6778                 </fields>
6779                 <links>
6780                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
6781                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6782                 </links>
6783         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6784             <actions>
6785                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
6786                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
6787                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
6788                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
6789             </actions>
6790         </permacrud>
6791         </class>
6792         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
6793                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
6794                         <field name="items" oils_persist:virtual="true" />
6795                         <field name="btype" reporter:datatype="text"/>
6796                         <field name="id" reporter:datatype="id" />
6797                         <field name="name" reporter:datatype="text"/>
6798                         <field name="description" reporter:datatype="text"/>
6799                         <field name="owner" reporter:datatype="link"/>
6800                         <field name="pub" reporter:datatype="bool"/>
6801                         <field name="create_time" reporter:datatype="timestamp" />
6802                 </fields>
6803                 <links>
6804                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6805                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
6806                 </links>
6807         </class>
6808         <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">
6809                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
6810                         <field name="id" reporter:datatype="id" />
6811                         <field name="bucket" reporter:datatype="link"/>
6812                         <field name="note" reporter:datatype="text" />
6813                 </fields>
6814                 <links>
6815                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
6816                 </links>
6817         </class>
6818         <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">
6819                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
6820                         <field name="id" reporter:datatype="int" />
6821                         <field name="usr" reporter:datatype="link"/>
6822                         <field name="work_ou" reporter:datatype="link"/>
6823                 </fields>
6824                 <links>
6825                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6826                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
6827                 </links>
6828         </class>
6829         <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">
6830                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
6831                         <field name="depth" reporter:datatype="int"/>
6832                         <field name="grantable" reporter:datatype="bool"/>
6833                         <field name="id" reporter:datatype="id" />
6834                         <field name="perm" reporter:datatype="link"/>
6835                         <field name="usr" reporter:datatype="link"/>
6836                 </fields>
6837                 <links>
6838                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6839                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6840                 </links>
6841         </class>
6842         <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">
6843                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
6844                         <field name="object_id" reporter:datatype="text"/>
6845                         <field name="grantable" reporter:datatype="bool"/>
6846                         <field name="id" reporter:datatype="id" />
6847                         <field name="perm" reporter:datatype="link"/>
6848                         <field name="usr" reporter:datatype="link"/>
6849                         <field name="object_type" reporter:datatype="text"/>
6850                 </fields>
6851                 <links>
6852                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6853                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6854                 </links>
6855         </class>
6856         <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">
6857                 <fields oils_persist:primary="id" oils_persist:sequence="">
6858                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6859                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6860                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6861                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6862                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6863                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6864                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6865                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6866                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6867                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6868                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6869                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6870                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6871                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6872                 </fields>
6873                 <links>
6874                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6875                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6876                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6877                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6878                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6879                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6880                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6881                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6882                 </links>
6883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6884             <actions>
6885                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6886                     <context link="xact" jump="usr" field="home_ou"/>
6887                 </retrieve>
6888                         </actions>
6889                 </permacrud>
6890         </class>
6891         <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">
6892                 <fields oils_persist:primary="id" oils_persist:sequence="">
6893                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6894                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6895                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6896                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6897                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6898                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6899                         <field reporter:label="Accepting User" name="accepting_usr" 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                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6919                 </links>
6920         </class>
6921         <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">
6922                 <fields oils_persist:primary="id" oils_persist:sequence="">
6923                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6924                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6925                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6926                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6927                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6928                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6929                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6930                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6931                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6932                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6933                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6934                 </fields>
6935                 <links>
6936                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6937                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6938                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6939                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6940                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6941                 </links>
6942         </class>
6943         <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">
6944                 <fields oils_persist:primary="id" oils_persist:sequence="">
6945                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6946                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6947                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6948                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6949                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6950                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6951                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6952                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
6953                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6954                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6955                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6956                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6957                 </fields>
6958                 <links>
6959                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6960                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6961                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6962                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6963                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6964                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6965                 </links>
6966         </class>
6967         <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">
6968                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
6969                         <field name="bucket" reporter:datatype="link"/>
6970                         <field name="id" reporter:datatype="id" />
6971                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
6972                         <field name="create_time" reporter:datatype="timestamp" />
6973                         <field name="pos" reporter:datatype="int" />
6974                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6975                 </fields>
6976                 <links>
6977                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
6978                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
6979             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
6980                 </links>
6981         </class>
6982         <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">
6983                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
6984                         <field name="id" reporter:datatype="id" />
6985                         <field name="item" reporter:datatype="link"/>
6986                         <field name="note" reporter:datatype="text" />
6987                 </fields>
6988                 <links>
6989                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
6990                 </links>
6991         </class>
6992         <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">
6993                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
6994                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
6995                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6996                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6997                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6998                 </fields>
6999                 <links>
7000                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7001                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7002                 </links>
7003         </class>
7004     <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">
7005         <fields oils_persist:primary="field">
7006             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7007             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7008             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7009         </fields>
7010         <links/>
7011         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7012             <actions>
7013                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7014                 <retrieve />
7015                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7016                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7017             </actions>
7018         </permacrud>
7019     </class>
7020         <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">
7021                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7022                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7023                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7024                 </fields>
7025                 <links/>
7026         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7027             <actions>
7028                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7029                 <retrieve/>
7030                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7031                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7032             </actions>
7033         </permacrud>
7034         </class>
7035
7036
7037         <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">
7038                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7039                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7040                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7041                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7042                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7043                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7044                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7045                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7046                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7047                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7048                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7049                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7050                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7051                 </fields>
7052                 <links>
7053                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7054                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7055                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7056                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7057                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7058                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7059                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7060                 </links>
7061         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7062             <actions>
7063                 <create permission="TRANSIT_COPY">
7064                     <context link="target_copy" field="owner"/>
7065                 </create>
7066                 <retrieve/>
7067                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7068                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7069             </actions>
7070         </permacrud>
7071         </class>
7072         <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">
7073                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7074                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7075                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7076                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7077                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7078                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7079                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7080                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7081                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7082                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7083                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7084                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7085                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7086                 </fields>
7087                 <links>
7088                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7089                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7090                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7091                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7092                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7093                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7094                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7095                 </links>
7096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7097             <actions>
7098                 <create permission="TRANSIT_COPY" context_field="owner">
7099                     <context link="target_copy" field="circ_lib"/>
7100                 </create>
7101                 <retrieve/>
7102                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7103                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7104             </actions>
7105         </permacrud>
7106         </class>
7107         <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">
7108                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7109                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7110                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7111                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7112                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7113                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7114                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7115                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7116                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7117                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7118                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7119                 </fields>
7120                 <links>
7121                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7122                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7123                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7124                 </links>
7125         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7126             <actions>
7127                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7128                     <context link="xact" jump="usr" field="home_ou"/>
7129                 </retrieve>
7130                         </actions>
7131                 </permacrud>
7132         </class>
7133         <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">
7134                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7135                         <field name="grp" />
7136                         <field name="id" reporter:datatype="id" />
7137                         <field name="usr" />
7138                 </fields>
7139                 <links>
7140                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7141                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7142                 </links>
7143         </class>
7144         <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">
7145                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7146                         <field name="id" reporter:datatype="id" />
7147                         <field name="fq_field" reporter:datatype="text"/>
7148                         <field name="identity_value" reporter:datatype="text"/>
7149                         <field name="translation" reporter:datatype="text"/>
7150                         <field name="string" reporter:datatype="text"/>
7151                 </fields>
7152                 <links>
7153                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7154                 </links>
7155         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7156             <actions>
7157                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7158                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7159                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7160                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7161             </actions>
7162         </permacrud>
7163         </class>
7164         <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">
7165                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7166                         <field name="id" reporter:datatype="id" />
7167                         <field name="fm_class" reporter:datatype="text"/>
7168                         <field name="field" reporter:datatype="text"/>
7169                         <field name="owner" reporter:datatype="org_unit"/>
7170                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7171                 </fields>
7172                 <links>
7173                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7174                 </links>
7175         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7176             <actions>
7177                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7178                 <retrieve/>
7179                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7180                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7181             </actions>
7182         </permacrud>
7183         </class>
7184         <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">
7185                 <fields oils_persist:primary="code">
7186                         <field name="code" reporter:datatype="id" />
7187                         <field name="marc_code" reporter:datatype="text"/>
7188                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7189                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7190                 </fields>
7191                 <links/>
7192         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7193             <actions>
7194                 <create permission="CREATE_LOCALE" global_required="true"/>
7195                 <retrieve/>
7196                 <update permission="UPDATE_LOCALE" global_required="true"/>
7197                 <delete permission="DELETE_LOCALE" global_required="true"/>
7198             </actions>
7199         </permacrud>
7200         </class>
7201         <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">
7202                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7203                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7204                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7205                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7206             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
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="CREATE_BILLING_TYPE" context_field="owner"/>
7214                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7215                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7216                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7217             </actions>
7218         </permacrud>
7219         </class>
7220
7221         <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">
7222                 <fields oils_persist:primary="id">
7223                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7224                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7225                 </fields>
7226                 <links/>
7227         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7228             <actions>
7229                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7230                 <retrieve/>
7231                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7232                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7233             </actions>
7234         </permacrud>
7235         </class>
7236
7237         <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">
7238                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7239                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7240                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7241                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7242                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7243                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7244                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7245                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7246                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7247                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7248                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7249                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7250                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7251                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7252                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7253                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7254                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7255                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7256                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7257                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7258                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7259                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7260                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7261                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7262                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7263                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7264                 </fields>
7265                 <links>
7266                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7267                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7268                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7269                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7270                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7271                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7272                 </links>
7273         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7274             <actions>
7275                 <create permission="user_request.create">
7276                     <context link="usr" field="home_ou"/>
7277                                 </create>
7278                 <retrieve permission="user_request.view">
7279                     <context link="usr" field="home_ou"/>
7280                                 </retrieve>
7281                 <update permission="user_request.update">
7282                     <context link="usr" field="home_ou"/>
7283                                 </update>
7284                 <delete permission="user_request.delete">
7285                     <context link="usr" field="home_ou"/>
7286                                 </delete>
7287             </actions>
7288         </permacrud>
7289         </class>
7290
7291         <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">
7292                 <fields oils_persist:primary="code">
7293                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7294                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7295                 </fields>
7296                 <links/>
7297         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7298             <actions>
7299                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7300                 <retrieve/>
7301                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7302                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7303             </actions>
7304         </permacrud>
7305         </class>
7306
7307         <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">
7308                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7309                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7310                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7311                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7312                         <field reporter:label="Ratio" name="ratio" />
7313                 </fields>
7314                 <links>
7315                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7316                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7317                 </links>
7318                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7319                         <actions>
7320                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7321                                 <retrieve/>
7322                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7323                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7324                         </actions>
7325                 </permacrud>
7326         </class>
7327
7328         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7329                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7330                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7331                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7332                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7333                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7334                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7335                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7336                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7337                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7338                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7339                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7340                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7341                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7342                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7343                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7344                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7345                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7346                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7347                 </fields>
7348                 <links>
7349                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7350                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7351             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7352             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7353             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7354                 </links>
7355         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7356             <actions>
7357                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7358                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7359                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7360                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7361             </actions>
7362         </permacrud>
7363         </class>
7364
7365         <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">
7366                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7367                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7368                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7369                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7370                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7371                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7372                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7373                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7374                 </fields>
7375                 <links>
7376                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7377                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7378                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7379                 </links>
7380         </class>
7381
7382         <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">
7383                 <fields oils_persist:primary="code">
7384                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7385                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7386                 </fields>
7387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7388             <actions>
7389                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7390                 <retrieve/>
7391                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7392                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7393             </actions>
7394                 </permacrud>
7395         </class>
7396
7397         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7398                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7399                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7400                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7401                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7402                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7403                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7404                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7405                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7406                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7407                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7408                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7409                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7410                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7411                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7412                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7413                 </fields>
7414                 <links>
7415                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7416                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7417                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7418                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7419                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7420                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7421                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7422                 </links>
7423         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7424             <actions>
7425                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7426                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7427                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7428                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7429             </actions>
7430         </permacrud>
7431         </class>
7432
7433         <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">
7434                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7435                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7436                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7437                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7438                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7439                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7440                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7441                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7442                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7443                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7444                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7445                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7446                 </fields>
7447                 <links>
7448                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7449                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7450                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7451                 </links>
7452         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7453             <actions>
7454                 <create   permission="ADMIN_INVOICE">
7455                                         <context link="invoice" field="receiver"/>
7456                                 </create>
7457                 <retrieve permission="ADMIN_INVOICE">
7458                                         <context link="invoice" field="receiver"/>
7459                                 </retrieve>
7460                 <update   permission="ADMIN_INVOICE">
7461                                         <context link="invoice" field="receiver"/>
7462                                 </update>
7463                                 <delete   permission="ADMIN_INVOICE">
7464                                         <context link="invoice" field="receiver"/>
7465                                 </delete>
7466             </actions>
7467         </permacrud>
7468         </class>
7469
7470         <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">
7471                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7472                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7473                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7474                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7475                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7476                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7477                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7478                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7479                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7480                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7481                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7482                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7483                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7484                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7485                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7486                 </fields>
7487                 <links>
7488                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7489                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7490                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7491                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7492                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7493                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7494                 </links>
7495         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7496             <actions>
7497                 <create   permission="ADMIN_INVOICE">
7498                                         <context link="invoice" field="receiver"/>
7499                                 </create>
7500                 <retrieve permission="ADMIN_INVOICE">
7501                                         <context link="invoice" field="receiver"/>
7502                                 </retrieve>
7503                 <update   permission="ADMIN_INVOICE">
7504                                         <context link="invoice" field="receiver"/>
7505                                 </update>
7506                                 <delete   permission="ADMIN_INVOICE">
7507                                         <context link="invoice" field="receiver"/>
7508                                 </delete>
7509             </actions>
7510         </permacrud>
7511         </class>
7512
7513         <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">
7514                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7515                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7516                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7517                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7518                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7519                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7520                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7521                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7522                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7523                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7524                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7525                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7526                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7527                 </fields>
7528                 <links>
7529                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7530                 </links>
7531         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7532             <actions>
7533                 <create permission="ADMIN_PROVIDER">
7534                     <context link="provider" field="owner"/>
7535                 </create>
7536                 <retrieve permission="ADMIN_PROVIDER">
7537                     <context link="provider" field="owner"/>
7538                 </retrieve>
7539                 <update permission="ADMIN_PROVIDER">
7540                     <context link="provider" field="owner"/>
7541                 </update>
7542                 <delete permission="ADMIN_PROVIDER">
7543                     <context link="provider" field="owner"/>
7544                 </delete>
7545             </actions>
7546         </permacrud>
7547         </class>
7548
7549         <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">
7550                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7551                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7552                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7553                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7554                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7555                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7556                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7557         </fields>
7558                 <links>
7559                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7560                 </links>
7561         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7562             <actions>
7563                 <create permission="ADMIN_PROVIDER">
7564                     <context link="provider" field="owner"/>
7565                 </create>
7566                 <retrieve permission="ADMIN_PROVIDER">
7567                     <context link="provider" field="owner"/>
7568                 </retrieve>
7569                 <update permission="ADMIN_PROVIDER">
7570                     <context link="provider" field="owner"/>
7571                 </update>
7572                 <delete permission="ADMIN_PROVIDER">
7573                     <context link="provider" field="owner"/>
7574                 </delete>
7575             </actions>
7576         </permacrud>
7577     </class>
7578         <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">
7579                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7580                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7581                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7582                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7583                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7584                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7585                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7586                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7587                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7588                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7589                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7590                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7591                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7592                 </fields>
7593                 <links>
7594                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7595                 </links>
7596         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7597             <actions>
7598                 <create permission="ADMIN_PROVIDER">
7599                     <context link="contact" jump='provider' field="owner"/>
7600                 </create>
7601                 <retrieve permission="ADMIN_PROVIDER">
7602                     <context link="contact" jump='provider' field="owner"/>
7603                 </retrieve>
7604                 <update permission="ADMIN_PROVIDER">
7605                     <context link="contact" jump='provider' field="owner"/>
7606                 </update>
7607                 <delete permission="ADMIN_PROVIDER">
7608                     <context link="contact" jump='provider' field="owner"/>
7609                 </delete>
7610             </actions>
7611         </permacrud>
7612         </class>
7613
7614         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7615                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7616                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7617                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7618                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7619                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7620                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7621                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7622                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7623                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7624                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7625                 </fields>
7626                 <links>
7627                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7628                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7629                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7630                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7631                 </links>
7632         </class>
7633
7634         <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">
7635                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7636                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7637                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7638                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7639                 </fields>
7640                 <links>
7641             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7642                 </links>
7643                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7644                         <actions>
7645                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7646                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7647                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7648                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7649                         </actions>
7650                 </permacrud>
7651         </class>
7652
7653         <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">
7654                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
7655                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
7656                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
7657                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
7658                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
7659                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
7660                 </fields>
7661                 <links>
7662                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7663                 </links>
7664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7665                         <actions>
7666                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7667                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7668                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7669                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7670                         </actions>
7671                 </permacrud>
7672         </class>
7673
7674         <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">
7675                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
7676                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7677                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7678                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7679                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7680                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7681                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7682                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7683                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
7684                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7685                 </fields>
7686                 <links>
7687                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7688                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7689             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
7690             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
7691                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
7692                 </links>
7693         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7694             <actions>
7695                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7696                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
7697                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7698                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7699             </actions>
7700         </permacrud>
7701         </class>
7702
7703         <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">
7704                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
7705                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
7706                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
7707                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7708                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7709                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
7710                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
7711                 </fields>
7712                 <links>
7713                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7714                 </links>
7715                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7716                         <actions>
7717                                 <create permission="ADMIN_FUNDING_SOURCE">
7718                     <context link="funding_source" field="owner"/>
7719                 </create>
7720                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
7721                     <context link="funding_source" field="owner"/>
7722                 </retrieve>
7723                                 <update permission="ADMIN_FUNDING_SOURCE">
7724                     <context link="funding_source" field="owner"/>
7725                 </update>
7726                                 <delete permission="ADMIN_FUNDING_SOURCE">
7727                     <context link="funding_source" field="owner"/>
7728                 </delete>
7729                         </actions>
7730                 </permacrud>
7731         </class>
7732
7733         <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">
7734                 <fields oils_persist:primary="id">
7735                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
7736                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
7737                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
7738                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
7739                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
7740                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7741                 </fields>
7742                 <links>
7743                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7744                 </links>
7745         </class>
7746
7747         <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">
7748                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
7749                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
7750                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7751                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
7752                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
7753                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7754                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
7755                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
7756                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7757                 </fields>
7758                 <links>
7759                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7760                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7761                 </links>
7762                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7763                         <actions>
7764                                 <create permission="ADMIN_ACQ_FUND">
7765                     <context link="fund" field="org"/>
7766                 </create>
7767                                 <retrieve permission="ADMIN_ACQ_FUND">
7768                     <context link="fund" field="org"/>
7769                 </retrieve>
7770                                 <update permission="ADMIN_ACQ_FUND">
7771                     <context link="fund" field="org"/>
7772                 </update>
7773                                 <delete permission="ADMIN_ACQ_FUND">
7774                     <context link="fund" field="org"/>
7775                 </delete>
7776                         </actions>
7777                 </permacrud>
7778         </class>
7779
7780         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
7781                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
7782                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7783                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
7784                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7785                         <field reporter:label="Year" name="year" reporter:datatype="int" />
7786                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
7787                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7788                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
7789                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
7790                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7791                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
7792                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
7793                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7794                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7795                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
7796                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7797                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
7798                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
7799                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
7800                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
7801                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7802                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7803                 </fields>
7804                 <links>
7805                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7806                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7807             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
7808             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
7809             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
7810             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
7811             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
7812             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
7813             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
7814             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
7815             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
7816                 </links>
7817         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
7818             <actions>
7819                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
7820                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
7821                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
7822                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
7823             </actions>
7824         </permacrud>
7825         </class>
7826
7827         <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">
7828                 <fields oils_persist:primary="fund">
7829                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7830                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7831                 </fields>
7832                 <links>
7833                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7834                 </links>
7835         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7836             <actions>
7837                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7838                                         <context link="fund" field="org" />
7839                 </retrieve>
7840             </actions>
7841         </permacrud>
7842         </class>
7843
7844         <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">
7845                 <fields oils_persist:primary="fund">
7846                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7847                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
7848                 </fields>
7849                 <links>
7850                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7851                 </links>
7852         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7853             <actions>
7854                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7855                                         <context link="fund" field="org" />
7856                 </retrieve>
7857             </actions>
7858         </permacrud>
7859         </class>
7860
7861         <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">
7862                 <fields oils_persist:primary="fund">
7863                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7864                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
7865                 </fields>
7866                 <links>
7867                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7868                 </links>
7869         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7870             <actions>
7871                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7872                                         <context link="fund" field="org" />
7873                 </retrieve>
7874             </actions>
7875         </permacrud>
7876         </class>
7877
7878         <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">
7879                 <fields oils_persist:primary="fund">
7880                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7881                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7882                 </fields>
7883                 <links>
7884                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7885                 </links>
7886         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7887             <actions>
7888                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7889                                         <context link="fund" field="org" />
7890                 </retrieve>
7891             </actions>
7892         </permacrud>
7893         </class>
7894
7895         <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">
7896                 <fields oils_persist:primary="fund">
7897                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7898                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
7899                 </fields>
7900                 <links>
7901                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7902                 </links>
7903         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7904             <actions>
7905                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7906                                         <context link="fund" field="org" />
7907                 </retrieve>
7908             </actions>
7909         </permacrud>
7910         </class>
7911
7912    <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">
7913         <fields oils_persist:primary="fund">
7914             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7915             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7916         </fields>
7917         <links>
7918             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7919         </links>
7920     </class>
7921
7922    <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">
7923         <fields oils_persist:primary="fund">
7924             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7925             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
7926         </fields>
7927         <links>
7928             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7929         </links>
7930     </class>
7931
7932    <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">
7933         <fields oils_persist:primary="fund">
7934             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7935             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7936         </fields>
7937         <links>
7938             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7939         </links>
7940     </class>
7941
7942    <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">
7943         <fields oils_persist:primary="fund">
7944             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7945             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
7946         </fields>
7947         <links>
7948             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7949         </links>
7950     </class>
7951
7952    <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">
7953         <fields oils_persist:primary="fund">
7954             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7955             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
7956         </fields>
7957         <links>
7958             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7959         </links>
7960     </class>
7961
7962         <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">
7963                 <fields oils_persist:primary="funding_source">
7964                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7965                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
7966                 </fields>
7967                 <links>
7968                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7969                 </links>
7970         </class>
7971
7972         <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">
7973                 <fields oils_persist:primary="funding_source">
7974                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7975                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
7976                 </fields>
7977                 <links>
7978                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7979                 </links>
7980         </class>
7981
7982         <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">
7983                 <fields oils_persist:primary="funding_source">
7984                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7985                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
7986                 </fields>
7987                 <links>
7988                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7989                 </links>
7990         </class>
7991
7992         <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">
7993                 <fields oils_persist:primary="fund">
7994                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7995                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
7996                 </fields>
7997                 <links>
7998                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7999                 </links>
8000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8001             <actions>
8002                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8003                                         <context link="fund" field="org" />
8004                 </retrieve>
8005             </actions>
8006         </permacrud>
8007     </class>
8008     <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">
8009         <oils_persist:source_definition><![CDATA[
8010             SELECT
8011                 acqf.*,
8012                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8013                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8014                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8015                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8016             FROM
8017                 acq.fund acqf
8018                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8019                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8020                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8021                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8022         ]]></oils_persist:source_definition>
8023         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8024             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8025             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8026             <field reporter:label="Name" name="name" reporter:datatype="text" />
8027             <field reporter:label="Year" name="year" reporter:datatype="int" />
8028             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8029             <field reporter:label="Code" name="code" reporter:datatype="text" />
8030             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8031             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8032             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8033             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8034             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8035
8036             <!-- non fund-native fields -->
8037             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8038             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8039             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8040             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8041         </fields>
8042         <links>
8043             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8044             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8045             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8046         </links>
8047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8048             <actions>
8049                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8050             </actions>
8051         </permacrud>
8052         </class>
8053         <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">
8054                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8055                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8056                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8057                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8058                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8059                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8060                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8061                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8062                 </fields>
8063                 <links>
8064                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8065                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8066                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8067                 </links>
8068                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8069                         <actions>
8070                                 <create permission="ADMIN_ACQ_FUND">
8071                     <context link="fund" field="org"/>
8072                 </create>
8073                                 <retrieve permission="ADMIN_ACQ_FUND">
8074                     <context link="fund" field="org"/>
8075                 </retrieve>
8076                                 <update permission="ADMIN_ACQ_FUND">
8077                     <context link="fund" field="org"/>
8078                 </update>
8079                                 <delete permission="ADMIN_ACQ_FUND">
8080                     <context link="fund" field="org"/>
8081                 </delete>
8082                         </actions>
8083                 </permacrud>
8084         </class>
8085
8086     <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">
8087         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8088             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8089             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8090             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8091             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8092             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8093             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8094             <field reporter:label="Note" name="note" reporter:datatype="text" />
8095             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8096         </fields>
8097         <links>
8098             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8099             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8100             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8101         </links>
8102                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8103                         <actions>
8104                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8105                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8106                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8107                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8108                         </actions>
8109                 </permacrud>
8110     </class>
8111
8112         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8113                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8114                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8115                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8116                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8117                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8118                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8119                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8120                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8121                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8122                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8123                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8124                 </fields>
8125                 <links>
8126                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8127                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8128                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8129                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8130                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8131                 </links>
8132                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8133                         <actions>
8134                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8135                         </actions>
8136                 </permacrud>
8137         </class>
8138
8139         <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">
8140                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8141                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8142                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8143                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8144                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8145                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8146                 </fields>
8147                 <links>
8148                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8149                 </links>
8150                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8151                         <actions>
8152                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8153                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8154                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8155                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8156                         </actions>
8157                 </permacrud>
8158         </class>
8159
8160         <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">
8161                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8162                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8163                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8164                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8165                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8166                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8167                         <field reporter:label="State" name="state" reporter:datatype="text" />
8168                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8169                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8170                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8171                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8172                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8173                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8174                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8175                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8176                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8177                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8178                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8179                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8180                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8181                 </fields>
8182                 <links>
8183                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8184                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8185                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8186                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8187                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8188                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8189                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8190                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8191                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8192                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8193                 </links>
8194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8195                         <actions>
8196                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8197                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8198                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8199                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8200                         </actions>
8201                 </permacrud>
8202         </class>
8203
8204         <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">
8205                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8206                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8207                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8208                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8209                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8210                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8211                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8212                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8213                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8214                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8215                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8216                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8217                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8218                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8219                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8220                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8221                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8222                 </fields>
8223                 <links>
8224                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8225                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8226                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8227                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8228                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8229                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8230                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8231                 </links>
8232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8233             <actions>
8234                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8235             </actions>
8236                 </permacrud>
8237         </class>
8238
8239         <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">
8240                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8241                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8242                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8243                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8244                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8245                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8246                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8247                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8248                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8249                 </fields>
8250                 <links>
8251                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8252                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8253                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8254                 </links>
8255                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8256             <actions>
8257                 <create permission="CREATE_PURCHASE_ORDER">
8258                     <context link="purchase_order" field="ordering_agency"/>
8259                 </create>
8260                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8261                     <context link="purchase_order" field="ordering_agency"/>
8262                 </retrieve>
8263                 <update permission="CREATE_PURCHASE_ORDER">
8264                     <context link="purchase_order" field="ordering_agency"/>
8265                 </update>
8266                 <delete permission="CREATE_PURCHASE_ORDER">
8267                     <context link="purchase_order" field="ordering_agency"/>
8268                 </delete>
8269             </actions>
8270                 </permacrud>
8271         </class>
8272
8273         <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">
8274                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8275                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8276                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8277                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8278                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8279                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8280                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8281                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8282                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8283                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8284                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8285                 </fields>
8286                 <links>
8287                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8288                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8289                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8290                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8291                 </links>
8292                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8293             <actions>
8294                 <create permission="CREATE_PURCHASE_ORDER">
8295                     <context link="purchase_order" field="ordering_agency"/>
8296                 </create>
8297                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8298                     <context link="purchase_order" field="ordering_agency"/>
8299                 </retrieve>
8300                 <update permission="CREATE_PURCHASE_ORDER">
8301                     <context link="purchase_order" field="ordering_agency"/>
8302                 </update>
8303                 <delete permission="CREATE_PURCHASE_ORDER">
8304                     <context link="purchase_order" field="ordering_agency"/>
8305                 </delete>
8306             </actions>
8307                 </permacrud>
8308         </class>
8309
8310         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8311                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8312                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8313                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8314                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8315                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8316                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8317                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8318                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8319                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8320                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8321                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8322                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8323                         <field reporter:label="State" name="state" reporter:datatype="text" />
8324                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8325                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8326                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8327                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8328                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8329                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8330                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8331                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8332                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8333                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8334                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8335                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8336                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8337                 </fields>
8338                 <links>
8339                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8340                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8341                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8342                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8343                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8344                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8345                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8346                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8347                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8348                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8349                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8350                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8351                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8352                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8353                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8354                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8355                 </links>
8356                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8357                         <actions>
8358                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8359                                         <context link="purchase_order" field="ordering_agency"/>
8360                                         <context link="picklist" field="org_unit"/>
8361                                 </retrieve>
8362                         </actions>
8363                 </permacrud>
8364         </class>
8365
8366         <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">
8367                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8368                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8369                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8370                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8371                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8372                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8373                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8374                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8375                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8376                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8377                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8378                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8379                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8380                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8381                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8382                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8383                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8384                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8385                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8386                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8387                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8388                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8389                 </fields>
8390                 <links>
8391                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8392                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8393                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8394                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8395                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8396                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8397                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8398                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8399                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8400                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8401                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8402                 </links>
8403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8404                         <actions>
8405                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8406                                         <context link="purchase_order" field="ordering_agency"/>
8407                                         <context link="picklist" field="org_unit"/>
8408                                 </retrieve>
8409                         </actions>
8410                 </permacrud>
8411         </class>
8412
8413         <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">
8414                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8415                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8416                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8417                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8418                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8419                 </fields>
8420                 <links>
8421                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8422                 </links>
8423                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8424                         <actions>
8425                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8426                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8427                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8428                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8429                         </actions>
8430                 </permacrud>
8431         </class>
8432
8433         <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">
8434                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8435                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8436                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8437                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8438                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8439                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8440                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8441                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8442                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8443                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8444                 </fields>
8445                 <links>
8446                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8447                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8448                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8449                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8450                 </links>
8451         </class>
8452
8453         <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">
8454                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8455                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8456                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8457                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8458                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8459                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8460                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8461                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8462                 </fields>
8463                 <links>
8464                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8465                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8466                 </links>
8467         </class>
8468
8469         <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">
8470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8471                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8472                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8473                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8474                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8475                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8476                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8477                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8478                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8479                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8480                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8481                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8482                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8483                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8484                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8485                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8486                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8487                 </fields>
8488                 <links>
8489                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8490                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8491                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8492                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8493                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8494                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8495                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8496                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8497                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8498                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8499                 </links>
8500         </class>
8501
8502         <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">
8503                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8504                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8505                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8506                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8507                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8508                 </fields>
8509                 <links/>
8510                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8511                         <actions>
8512                                 <retrieve />
8513                         </actions>
8514                 </permacrud>
8515         </class>
8516
8517         <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">
8518                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8519                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8520                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8521                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8522                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8523                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8524             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8525                 </fields>
8526                 <links/>
8527         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8528             <actions>
8529                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8530                 <retrieve />
8531                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8532                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8533             </actions>
8534         </permacrud>
8535         </class>
8536
8537         <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">
8538                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8539                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8540                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8541                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8542                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8543                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8544                 </fields>
8545                 <links/>
8546         </class>
8547         <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">
8548                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8549                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8550                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8551                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8552                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8553                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8554                 </fields>
8555                 <links>
8556                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8557                 </links>
8558         </class>
8559
8560         <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">
8561             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8562                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8563                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8564                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8565                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8566                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8567                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8568         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8569
8570             </fields>
8571             <links>
8572                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8573             </links>
8574             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8575                 <actions>
8576                     <create permission="ADMIN_PROVIDER">
8577                         <context link="provider" field="owner"/>
8578                     </create>
8579                     <retrieve permission="ADMIN_PROVIDER">
8580                         <context link="provider" field="owner"/>
8581                     </retrieve>
8582                     <update permission="ADMIN_PROVIDER">
8583                         <context link="provider" field="owner"/>
8584                     </update>
8585                     <delete permission="ADMIN_PROVIDER">
8586                         <context link="provider" field="owner"/>
8587                     </delete>
8588                 </actions>
8589             </permacrud>
8590         </class>
8591         
8592         <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">
8593             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8594                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8595                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8596                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8597                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8598             </fields>
8599             <links>
8600                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8601             </links>
8602             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8603                 <actions>
8604                     <create permission="ADMIN_PROVIDER">
8605                         <context link="provider" field="owner"/>
8606                     </create>
8607                     <retrieve permission="ADMIN_PROVIDER">
8608                         <context link="provider" field="owner"/>
8609                     </retrieve>
8610                     <update permission="ADMIN_PROVIDER">
8611                         <context link="provider" field="owner"/>
8612                     </update>
8613                     <delete permission="ADMIN_PROVIDER">
8614                         <context link="provider" field="owner"/>
8615                     </delete>
8616                 </actions>
8617             </permacrud>
8618         </class>
8619         
8620         <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">
8621             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8622                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8623                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8624                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8625                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8626                 </fields>
8627                 <links/>
8628         </class>
8629
8630         <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">
8631                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8632                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8633                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8634                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8635                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8636                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8637                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8638                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8639                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8640                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8641                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8642                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8643                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8644                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8645                 </fields>
8646                 <links>
8647                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8648                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8649                 </links>
8650         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8651             <actions>
8652                 <create permission="ADMIN_PROVIDER">
8653                     <context link="provider" field="owner"/>
8654                 </create>
8655                 <retrieve permission="ADMIN_PROVIDER">
8656                     <context link="provider" field="owner"/>
8657                 </retrieve>
8658                 <update permission="ADMIN_PROVIDER">
8659                     <context link="provider" field="owner"/>
8660                 </update>
8661                 <delete permission="ADMIN_PROVIDER">
8662                     <context link="provider" field="owner"/>
8663                 </delete>
8664             </actions>
8665         </permacrud>
8666         </class>
8667
8668         <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">
8669                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
8670                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
8671                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
8672                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
8673                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
8674                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
8675                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
8676                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
8677                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
8678                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
8679                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
8680                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
8681                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
8682                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
8683                 </fields>
8684                 <links>
8685                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
8686                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8687                 </links>
8688         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8689             <actions>
8690                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8691                     <context link="account" jump="provider" field="owner"/>
8692                 </retrieve>
8693                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8694                     <context link="account" jump="provider" field="owner"/>
8695                 </update>
8696                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8697                     <context link="account" jump="provider" field="owner"/>
8698                 </delete>
8699             </actions>
8700         </permacrud>
8701         </class>
8702
8703
8704         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
8705                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
8706                         <field name="id" reporter:datatype="id" />
8707                         <field name="parent" reporter:datatype="link"/>
8708                         <field name="owner" reporter:datatype="link"/>
8709                         <field name="create_time" reporter:datatype="timestamp"/>
8710                         <field name="name" reporter:datatype="text"/>
8711                         <field name="shared" reporter:datatype="bool"/>
8712                         <field name="share_with" reporter:datatype="link"/>
8713                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8714                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
8715                 </fields>
8716                 <links>
8717                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8718                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
8719                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
8720                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8721                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
8722                 </links>
8723         </class>
8724         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
8725                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
8726                         <field name="id" reporter:datatype="id" />
8727                         <field name="parent" reporter:datatype="link"/>
8728                         <field name="owner" reporter:datatype="link"/>
8729                         <field name="create_time" reporter:datatype="timestamp"/>
8730                         <field name="name" reporter:datatype="text"/>
8731                         <field name="shared" reporter:datatype="bool"/>
8732                         <field name="share_with" reporter:datatype="link"/>
8733                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8734                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
8735                 </fields>
8736                 <links>
8737                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8738                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
8739                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
8740                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8741                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
8742                 </links>
8743         </class>
8744         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
8745                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
8746                         <field name="id" reporter:datatype="id" />
8747                         <field name="parent" reporter:datatype="link"/>
8748                         <field name="owner" reporter:datatype="link"/>
8749                         <field name="create_time" reporter:datatype="timestamp"/>
8750                         <field name="name" reporter:datatype="text"/>
8751                         <field name="shared" reporter:datatype="bool"/>
8752                         <field name="share_with" reporter:datatype="link"/>
8753                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8754                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8755                 </fields>
8756                 <links>
8757                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8758                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
8759                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
8760                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8761                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
8762                 </links>
8763         </class>
8764         <class id="rt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
8765                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
8766                         <field name="id" reporter:datatype="id" />
8767                         <field name="owner" reporter:datatype="link"/>
8768                         <field name="create_time" reporter:datatype="timestamp"/>
8769                         <field name="name" reporter:datatype="text"/>
8770                         <field name="data" reporter:datatype="text"/>
8771                         <field name="folder" reporter:datatype="link"/>
8772                         <field name="description" reporter:datatype="text"/>
8773                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8774                 </fields>
8775                 <links>
8776                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8777                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
8778                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
8779                 </links>
8780         </class>
8781         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
8782                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
8783                         <field name="id" reporter:datatype="id" />
8784                         <field name="owner" reporter:datatype="link"/>
8785                         <field name="create_time" reporter:datatype="timestamp"/>
8786                         <field name="template" reporter:datatype="link"/>
8787                         <field name="data" reporter:datatype="text"/>
8788                         <field name="folder" reporter:datatype="link"/>
8789                         <field name="recur" reporter:datatype="bool"/>
8790                         <field name="recurrence" reporter:datatype="interval"/>
8791                         <field name="name" reporter:datatype="text"/>
8792                         <field name="description" reporter:datatype="text"/>
8793                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
8794                 </fields>
8795                 <links>
8796                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8797                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
8798                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
8799                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
8800                 </links>
8801         </class>
8802         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
8803                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
8804                         <field name="id" reporter:datatype="id" />
8805                         <field name="runner" reporter:datatype="link"/>
8806                         <field name="start_time" reporter:datatype="timestamp"/>
8807                         <field name="complete_time" reporter:datatype="timestamp"/>
8808                         <field name="run_time" reporter:datatype="timestamp"/>
8809                         <field name="email" reporter:datatype="text"/>
8810                         <field name="excel_format" reporter:datatype="bool"/>
8811                         <field name="csv_format" reporter:datatype="bool"/>
8812                         <field name="html_format" reporter:datatype="bool"/>
8813                         <field name="error_code" reporter:datatype="int"/>
8814                         <field name="error_text" reporter:datatype="text"/>
8815                         <field name="report" reporter:datatype="link"/>
8816                         <field name="folder" reporter:datatype="link"/>
8817                         <field name="chart_pie" reporter:datatype="bool"/>
8818                         <field name="chart_bar" reporter:datatype="bool"/>
8819                         <field name="chart_line" reporter:datatype="bool"/>
8820                 </fields>
8821                 <links>
8822                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
8823                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
8824                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
8825                 </links>
8826         </class>
8827         <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">
8828                 <fields oils_persist:primary="id">
8829                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8830                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8831                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8832                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8833                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8834                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8835                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8836                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8837                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8838                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8839                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8840                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8841                 </fields>
8842                 <links>
8843                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8844                 </links>
8845                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8846                         <actions>
8847                                 <retrieve />
8848                         </actions>
8849                 </permacrud>
8850         </class>
8851         <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">
8852                 <fields oils_persist:primary="id">
8853                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8854                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8855                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8856                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8857                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8858                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8859                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8860                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8861                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8862                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8863                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8864                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8865                 </fields>
8866                 <links>
8867                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8868                 </links>
8869         </class>
8870         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
8871                 <fields oils_persist:primary="id">
8872                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8873                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
8874                         <field reporter:label="Fingerprint" name="fingerprint" />
8875                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8876                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8877                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8878                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8879                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
8880                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8881                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8882                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8883                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
8884                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
8885                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
8886                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8887                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8888                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
8889                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
8890                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
8891                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
8892                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
8893                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
8894                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8895                 </fields>
8896                 <links>
8897                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
8898                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8899                 </links>
8900         </class>
8901         <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">
8902                 <fields oils_persist:primary="id">
8903                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
8904                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
8905                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
8906                 </fields>
8907                 <links>
8908                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
8909                 </links>
8910         </class>
8911         <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">
8912                 <fields oils_persist:primary="id">
8913                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
8914                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
8915                 </fields>
8916                 <links>
8917                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
8918                 </links>
8919         </class>
8920         <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">
8921                 <fields oils_persist:primary="id">
8922                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
8923                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
8924                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
8925                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
8926                 </fields>
8927                 <links>
8928                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
8929                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
8930                 </links>
8931         </class>
8932         <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">
8933                 <fields oils_persist:primary="xact">
8934                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8935                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
8936                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
8937                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
8938                 </fields>
8939                 <links>
8940                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8941                 </links>
8942         </class>
8943         <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">
8944                 <fields oils_persist:primary="xact">
8945                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8946                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
8947                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
8948                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
8949                 </fields>
8950                 <links>
8951                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8952                 </links>
8953         </class>
8954         <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)">
8955                 <fields oils_persist:primary="id">
8956                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
8957                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
8958                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
8959                 </fields>
8960                 <links>
8961                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
8962                 </links>
8963         </class>
8964         <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">
8965                 <fields oils_persist:primary="id">
8966                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
8967                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
8968                 </fields>
8969                 <links>
8970                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
8971                 </links>
8972         </class>
8973         <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">
8974                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
8975                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
8976                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
8977                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
8978                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
8979                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
8980                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
8981                 </fields>
8982                 <links>
8983                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8984                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
8985                 </links>
8986                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8987                         <actions>
8988                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8989                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8990                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8991                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8992                         </actions>
8993                 </permacrud>
8994         </class>
8995         <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">
8996                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
8997                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
8998                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
8999                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9000                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9001                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9002                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9003                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9004                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9005                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9006                 </fields>
9007                 <links>
9008                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9009                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9010                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9011                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9012                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9013                 </links>
9014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9015                         <actions>
9016                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9017                                         <context link="formula" field="owner"/>
9018                                 </create>
9019                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9020                                         <context link="formula" field="owner"/>
9021                                 </retrieve>
9022                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9023                                         <context link="formula" field="owner"/>
9024                                 </update>
9025                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9026                                         <context link="formula" field="owner"/>
9027                                 </delete>
9028                         </actions>
9029                 </permacrud>
9030         </class>
9031
9032         <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">
9033                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9034                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9035                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9036                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9037                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9038                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9039                 </fields>
9040                 <links>
9041                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9042                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9043                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9044                 </links>
9045                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9046                         <actions>
9047                                 <create permission="CREATE_PURCHASE_ORDER">
9048                                         <context link="formula" field="owner"/>
9049                 </create>
9050                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9051                                         <context link="formula" field="owner"/>
9052                 </retrieve>
9053                                 <update permission="CREATE_PURCHASE_ORDER">
9054                                         <context link="formula" field="owner"/>
9055                 </update>
9056                                 <delete permission="CREATE_PURCHASE_ORDER">
9057                                         <context link="formula" field="owner"/>
9058                 </delete>
9059                         </actions>
9060                 </permacrud>
9061         </class>
9062
9063         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9064                 <fields oils_persist:primary="id">
9065                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9066                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9067                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9068                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9069                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9070                 </fields>
9071                 <links>
9072                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9073                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9074                 </links>
9075         </class>
9076
9077         <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">
9078                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9079                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9080                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9081                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9082                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9083                 </fields>
9084                 <links>
9085                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9086                 </links>
9087                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9088                         <actions>
9089                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9090                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9091                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9092                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9093                         </actions>
9094                 </permacrud>
9095         </class>
9096
9097         <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">
9098                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9099                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9100                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9101                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9102                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9103                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9104                 </fields>
9105                 <links>
9106                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9107                 </links>
9108                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9109                         <actions>
9110                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9111                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9112                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9113                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9114                         </actions>
9115                 </permacrud>
9116         </class>
9117
9118         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9119                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9120                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9121                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9122                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9123                 </fields>
9124                 <links>
9125                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9126                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9127                 </links>
9128         </class>
9129
9130         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9131                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9132                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9133                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9134                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9135                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9136                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9137                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9138                 </fields>
9139                 <links>
9140                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9141                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9142                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9143                 </links>
9144         </class>
9145
9146         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9147                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9148                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9149                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9150                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9151                 </fields>
9152                 <links>
9153                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9154                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9155                 </links>
9156         </class>
9157
9158         <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">
9159                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9160                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9161                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9162                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9163                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9164                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9165                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9166                 </fields>
9167                 <links>
9168                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9169                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9170                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9171                 </links>
9172         </class>
9173
9174         <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">
9175                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9176                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9177                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9178                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9179                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9180                 </fields>
9181                 <links>
9182                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9183                 </links>
9184                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9185             <actions>
9186                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9187                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9188                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9189                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9190             </actions>
9191                 </permacrud>
9192         </class>
9193
9194         <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">
9195                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9196                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9197                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9198                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9199                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9200                 </fields>
9201                 <links>
9202                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9203                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9204                 </links>
9205                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9206                         <actions>
9207                                 <create permission="ADMIN_CLAIM_POLICY">
9208                                         <context link="claim_policy" field="org_unit"/>
9209                 </create>
9210                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9211                                         <context link="claim_policy" field="org_unit"/>
9212                 </retrieve>
9213                                 <update permission="ADMIN_CLAIM_POLICY">
9214                                         <context link="claim_policy" field="org_unit"/>
9215                 </update>
9216                                 <delete permission="ADMIN_CLAIM_POLICY">
9217                                         <context link="claim_policy" field="org_unit"/>
9218                 </delete>
9219                         </actions>
9220                 </permacrud>
9221         </class>
9222
9223     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9224         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9225             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9226             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9227             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9228             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9229             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9230             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9231             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9232             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9233             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9234             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9235             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9236             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9237             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9238             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9239             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9240             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9241         </fields>
9242         <links>
9243             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9244         </links>
9245     </class>
9246
9247     <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">
9248         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
9249             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9250             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9251             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9252             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9253             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9254         </fields>
9255     </class>
9256
9257     <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">
9258         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9259             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9260             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9261             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9262             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9263             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9264             <field reporter:label="City" name="city" reporter:datatype="text"/>
9265             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9266             <field reporter:label="State" name="state" reporter:datatype="text"/>
9267             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9268             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9269             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9270         </fields>
9271     </class>
9272
9273     <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">
9274         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9275             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9276             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9277             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9278             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9279             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9280             <field reporter:label="City" name="city" reporter:datatype="text"/>
9281             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9282             <field reporter:label="State" name="state" reporter:datatype="text"/>
9283             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9284             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9285             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9286         </fields>
9287     </class>
9288
9289     <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">
9290         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9291             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9292             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9293             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9294             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9295             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9296             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9297         </fields>
9298     </class>
9299
9300         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9301                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9302                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9303                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9304                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9305                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9306                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9307                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9308                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9309                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9310                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9311                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9312                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9313                 </fields>
9314                 <links>
9315                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9316                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9317                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9318                 </links>
9319         </class>
9320
9321         <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">
9322                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9323                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9324                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9325                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9326                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9327                 </fields>
9328                 <links>
9329                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9330                 </links>
9331         </class>
9332
9333     <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">
9334         <fields>
9335             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9336             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9337             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9338         </fields>
9339                 <links>
9340                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9341                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9342                 </links>
9343     </class>
9344
9345     <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">
9346         <fields>
9347             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9348             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9349         </fields>
9350                 <links>
9351                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9352                 </links>
9353     </class>
9354
9355     <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">
9356         <fields>
9357             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9358             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9359             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9360         </fields>
9361                 <links>
9362                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9363                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9364                 </links>
9365     </class>
9366
9367     <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">
9368         <fields>
9369             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9370             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
9371         </fields>
9372                 <links>
9373                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9374                 </links>
9375     </class>
9376
9377     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9378                 <oils_persist:source_definition>
9379
9380             SELECT  DISTINCT l.*
9381               FROM  action.unfulfilled_hold_loops l
9382                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9383               WHERE l.count = m.max
9384
9385                 </oils_persist:source_definition>
9386         <fields>
9387             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9388             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9389             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9390         </fields>
9391                 <links>
9392                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9393                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9394                 </links>
9395     </class>
9396
9397         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9398                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9399                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9400                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9401                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9402                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9403                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9404                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9405                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9406                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9407                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9408                 </fields>
9409                 <links>
9410                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9411                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9412                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9413                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9414                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9415                 </links>
9416         </class>
9417
9418         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9419                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9420                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9421                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9422                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9423                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9424                 </fields>
9425                 <links>
9426                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9427                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9428                 </links>
9429         </class>
9430
9431         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9432                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9433                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9434                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9435                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9436                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9437                 </fields>
9438                 <links>
9439                 </links>
9440         </class>
9441
9442         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9443                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9444                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9445                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9446                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9447                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9448                 </fields>
9449                 <links>
9450                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9451                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9452                 </links>
9453         </class>
9454         
9455         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9456                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9457                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9458                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9459                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9460                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9461                 </fields>
9462                 <links>
9463                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9464                 </links>
9465         </class>
9466         
9467         <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">
9468                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9469                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9470                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9471                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9472                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9473                 </fields>
9474                 <links>
9475                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9476                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9477                 </links>
9478         </class>
9479
9480         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9481                 <fields oils_persist:primary="name">
9482                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9483                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9484                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9485                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9486                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9487                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9488                 </fields>
9489                 <links>
9490                 </links>
9491         </class>
9492
9493         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9494                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9495                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9496                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9497                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9498                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9499                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9500                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9501                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9502                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9503                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9504                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9505                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9506                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9507                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9508                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9509                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9510                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9511                 </fields>
9512                 <links>
9513                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9514                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9515                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9516                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9517                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9518                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9519                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9520                 </links>
9521         </class>
9522
9523         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9524                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9525                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9526                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9527                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9528                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9529                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9530                 </fields>
9531                 <links>
9532                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9533                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9534                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9535                 </links>
9536         </class>
9537
9538         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9539                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9540                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9541                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9542                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9543                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9544                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9545                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9546                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9547                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9548                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9549                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9550                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9551                 </fields>
9552                 <links>
9553                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9554                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9555                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9556                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9557                 </links>
9558         </class>
9559
9560         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9561                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9562                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9563                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9564                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9565                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9566                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9567                 </fields>
9568                 <links>
9569                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9570                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9571                 </links>
9572         </class>
9573
9574         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9575                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9576                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9577                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9578                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9579                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9580                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9581                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9582                 </fields>
9583                 <links>
9584                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9585                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9586                 </links>
9587         </class>
9588
9589         <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">
9590                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9591                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9592                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9593                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9594                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9595                 </fields>
9596                 <links>
9597                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9598                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9599                 </links>
9600         </class>
9601
9602         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9603                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9604                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9605                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9606                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9607                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9608                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9609                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9610                 </fields>
9611                 <links>
9612                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9613                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9614                 </links>
9615         </class>
9616
9617         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9618                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9619                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9620                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9621                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9622                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9623                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9624                 </fields>
9625                 <links>
9626                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9627                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9628                 </links>
9629         </class>
9630
9631         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
9632                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9633                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9634                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9635                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9636                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9637                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9638                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9639                 </fields>
9640                 <links>
9641                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9642                 </links>
9643         </class>
9644
9645         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
9646                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9647                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9648                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9649                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9650                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9651                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9652                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9653                 </fields>
9654                 <links>
9655                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9656                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9657                 </links>
9658         </class>
9659
9660         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
9661                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9662                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9663                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9664                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9665                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9666                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9667                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9668                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9669                 </fields>
9670                 <links>
9671                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9672                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9673                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9674                 </links>
9675         </class>
9676
9677         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
9678                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9679                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9680                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9681                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9682                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9683                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9684                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9685                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9686                 </fields>
9687                 <links>
9688                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9689                 </links>
9690         </class>
9691
9692         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
9693                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9694                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9695                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9696                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9697                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9698                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9699                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9700                 </fields>
9701                 <links>
9702                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9703                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9704                 </links>
9705         </class>
9706
9707         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
9708                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9709                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9710                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9711                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9712                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9713                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9714                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9715                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9716                 </fields>
9717                 <links>
9718                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9719                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9720                 </links>
9721         </class>
9722
9723         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
9724                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9725                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9726                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9727                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9728                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9729                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9730                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9731                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9732                 </fields>
9733                 <links>
9734                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9735                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9736                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9737                 </links>
9738         </class>
9739
9740         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
9741                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9742                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9743                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9744                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9745                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9746                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9747                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9748                 </fields>
9749                 <links>
9750                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9751                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9752                 </links>
9753         </class>
9754
9755         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
9756                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9757                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9758                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9759                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9760                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9761                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9762                 </fields>
9763                 <links>
9764                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9765                 </links>
9766         </class>
9767
9768         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
9769                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9770                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9771                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9772                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9773                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9774                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9775                 </fields>
9776                 <links>
9777                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9778                 </links>
9779         </class>
9780
9781         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
9782                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9783                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9784                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9785                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9786                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9787                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9788                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9789                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9790                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9791                 </fields>
9792                 <links>
9793                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9794                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9795                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9796                 </links>
9797         </class>
9798
9799         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
9800                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9801                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9802                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9803                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9804                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9805                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9806                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9807                 </fields>
9808                 <links>
9809                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9810                 </links>
9811         </class>
9812
9813         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
9814                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9815                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9816                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9817                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9818                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9819                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9820                 </fields>
9821                 <links>
9822                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9823                 </links>
9824         </class>
9825
9826         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
9827                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9828                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9829                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9830                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9831                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9832                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9833                 </fields>
9834                 <links>
9835                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9836                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9837                 </links>
9838         </class>
9839
9840         <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">
9841                 <fields oils_persist:primary="id">
9842                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
9843                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
9844                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
9845                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
9846                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
9847                 </fields>
9848                 <links>
9849                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
9850                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9851                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
9852                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
9853                 </links>
9854         </class>
9855
9856         <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">
9857                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
9858                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9859                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
9860                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
9861                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
9862                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9863                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9864                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
9865                 </fields>
9866                 <links/>
9867                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9868                         <actions>
9869                                 <retrieve/>
9870                         </actions>
9871                 </permacrud>
9872         </class>
9873
9874         <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">
9875                 <fields oils_persist:primary="ptype_key">
9876                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
9877                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9878                 </fields>
9879                 <links/>
9880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9881                         <actions>
9882                                 <retrieve/>
9883                         </actions>
9884                 </permacrud>
9885         </class>
9886
9887         <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">
9888                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
9889                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9890                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
9891                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
9892                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9893                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9894                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9895                 </fields>
9896                 <links>
9897                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
9898                 </links>
9899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9900                         <actions>
9901                                 <retrieve/>
9902                         </actions>
9903                 </permacrud>
9904         </class>
9905
9906         <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">
9907                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
9908                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9909                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
9910                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
9911                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9912                 </fields>
9913                 <links>
9914                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
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
9924         id="uvs"
9925         controller="open-ils.cstore open-ils.pcrud"
9926         oils_obj:fieldmapper="url_verify::session"
9927         oils_persist:tablename="url_verify.session"
9928         reporter:label="URL Verification Session"
9929     >
9930         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
9931             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
9932             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9933                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
9934             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9935             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
9936             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9937             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
9938             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
9939             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
9940         </fields>
9941
9942         <links>
9943             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9944             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9945             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
9946             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
9947             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
9948         </links>
9949
9950         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9951             <actions>
9952                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
9953             </actions>
9954         </permacrud>
9955
9956     </class>
9957
9958     <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">
9959         <oils_persist:source_definition>
9960             SELECT
9961                 cbrebi.id AS id,  -- so we can have a pkey in our view
9962                 uvs.id AS session,
9963                 uvs.owning_lib,
9964                 cbrebi.target_biblio_record_entry
9965             FROM url_verify.session uvs
9966             JOIN container.biblio_record_entry_bucket cbreb
9967                 ON (uvs.container = cbreb.id)
9968             JOIN container.biblio_record_entry_bucket_item cbrebi
9969                 ON (cbrebi.bucket = cbreb.id)
9970         </oils_persist:source_definition>
9971         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
9972             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
9973             <field reporter:label="Session" name="session" reporter:datatype="link" />
9974             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
9975             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
9976         </fields>
9977         <links>
9978             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
9979             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
9980             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
9981         </links>
9982         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9983             <actions>
9984                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
9985             </actions>
9986         </permacrud>
9987     </class>
9988
9989     <class
9990         id="uvus"
9991         controller="open-ils.cstore open-ils.pcrud"
9992         oils_obj:fieldmapper="url_verify::url_selector"
9993         oils_persist:tablename="url_verify.url_selector"
9994         reporter:label="URL Verification URL Selector"
9995     >
9996         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
9997             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
9998             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
9999                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10000             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10001         </fields>
10002
10003         <links>
10004             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10005             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10006         </links>
10007
10008         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10009             <actions>
10010                 <create permission="URL_VERIFY">
10011                     <context link="session" field="owning_lib"/>
10012                 </create>
10013                 <retrieve permission="URL_VERIFY">
10014                     <context link="session" field="owning_lib"/>
10015                 </retrieve>
10016                 <update permission="URL_VERIFY">
10017                     <context link="session" field="owning_lib"/>
10018                 </update>
10019                 <delete permission="URL_VERIFY">
10020                     <context link="session" field="owning_lib"/>
10021                 </delete>
10022             </actions>
10023         </permacrud>
10024
10025     </class>
10026
10027     <class
10028         id="uvu"
10029         controller="open-ils.cstore open-ils.pcrud"
10030         oils_obj:fieldmapper="url_verify::url"
10031         oils_persist:tablename="url_verify.url"
10032         reporter:label="URL Verification URL"
10033     >
10034         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10035             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10036                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10037                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10038                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10039                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10040             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10041             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10042             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10043             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10044             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10045             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10046             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10047             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10048             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10049             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10050             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10051             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10052             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10053         </fields>
10054
10055         <links>
10056             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10057             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10058             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10059             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10060             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10061         </links>
10062
10063         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10064             <actions>
10065                 <create permission="URL_VERIFY">
10066                     <context link="session" field="owning_lib"/>
10067                 </create>
10068                 <retrieve permission="URL_VERIFY">
10069                     <context link="session" field="owning_lib"/>
10070                 </retrieve>
10071                 <update permission="URL_VERIFY">
10072                     <context link="session" field="owning_lib"/>
10073                 </update>
10074                 <delete permission="URL_VERIFY">
10075                     <context link="session" field="owning_lib"/>
10076                 </delete>
10077             </actions>
10078         </permacrud>
10079
10080     </class>
10081
10082     <class
10083         id="uvva"
10084         controller="open-ils.cstore open-ils.pcrud"
10085         oils_obj:fieldmapper="url_verify::verification_attempt"
10086         oils_persist:tablename="url_verify.verification_attempt"
10087         reporter:label="URL Verification Attempt"
10088     >
10089         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10090             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10091                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10092                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10093             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10094             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10095         </fields>
10096
10097         <links>
10098             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10099             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10100         </links>
10101
10102         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10103             <actions>
10104                 <create permission="URL_VERIFY">
10105                     <context link="session" field="owning_lib"/>
10106                 </create>
10107                 <retrieve permission="URL_VERIFY">
10108                     <context link="session" field="owning_lib"/>
10109                 </retrieve>
10110                 <update permission="URL_VERIFY">
10111                     <context link="session" field="owning_lib"/>
10112                 </update>
10113                 <delete permission="URL_VERIFY">
10114                     <context link="session" field="owning_lib"/>
10115                 </delete>
10116             </actions>
10117         </permacrud>
10118
10119     </class>
10120
10121     <class
10122         id="uvuv"
10123         controller="open-ils.cstore open-ils.pcrud"
10124         oils_obj:fieldmapper="url_verify::url_verification"
10125         oils_persist:tablename="url_verify.url_verification"
10126         reporter:label="URL Verification"
10127     >
10128         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10129             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10130                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10131                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10132             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10133             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10134             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10135             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10136                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10137         </fields>
10138
10139         <links>
10140             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10141             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10142             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10143         </links>
10144
10145         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10146             <actions>
10147                 <create permission="URL_VERIFY">
10148                     <context link="attempt" jump="session" field="owning_lib"/>
10149                 </create>
10150                 <retrieve permission="URL_VERIFY">
10151                     <context link="attempt" jump="session" field="owning_lib"/>
10152                 </retrieve>
10153                 <update permission="URL_VERIFY">
10154                     <context link="attempt" jump="session" field="owning_lib"/>
10155                 </update>
10156                 <delete permission="URL_VERIFY">
10157                     <context link="attempt" jump="session" field="owning_lib"/>
10158                 </delete>
10159             </actions>
10160         </permacrud>
10161
10162     </class>
10163
10164         <class
10165                 id="cfdi"
10166                 controller="open-ils.cstore open-ils.pcrud"
10167                 oils_obj:fieldmapper="config::filter_dialog_interface"
10168                 oils_persist:tablename="config.filter_dialog_interface"
10169                 reporter:label="FilterDialog Interface">
10170                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10171                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10172                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10173                 </fields>
10174                 <links>
10175                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10176                 </links>
10177                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10178                         <actions>
10179                                 <retrieve />
10180                         </actions>
10181                 </permacrud>
10182         </class>
10183
10184         <class
10185                 id="cfdfs"
10186                 controller="open-ils.cstore open-ils.pcrud"
10187                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10188                 oils_persist:tablename="config.filter_dialog_filter_set"
10189                 reporter:label="FilterDialog Filter Set">
10190                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10191                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10192                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10193                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10194                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10195                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10196                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10197                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10198                 </fields>
10199                 <links>
10200                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10201                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10202                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10203                 </links>
10204                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10205                         <actions>
10206                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10207                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10208                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10209                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10210                         </actions>
10211                 </permacrud>
10212
10213         </class>
10214
10215         <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">
10216                 <fields oils_persist:primary="code">
10217                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10218                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10219                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10220                 </fields>
10221                 <links/>
10222                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10223                         <actions>
10224                                 <retrieve/>
10225                         </actions>
10226                 </permacrud>
10227         </class>
10228
10229         <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">
10230                 <oils_persist:source_definition>
10231
10232             SELECT  b.id,
10233                     MAX(dcp.edit_date) AS last_delete_date
10234              FROM   biblio.record_entry b
10235                     JOIN asset.call_number cn ON (cn.record = b.id)
10236                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10237              WHERE  NOT b.deleted
10238              GROUP BY b.id
10239              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10240
10241                 </oils_persist:source_definition>
10242                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10243                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10244                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10245                 </fields>
10246                 <links>
10247                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10248                 </links>
10249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10250                         <actions>
10251                                 <retrieve/>
10252                         </actions>
10253                 </permacrud>
10254         </class>
10255
10256         <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">
10257                 <oils_persist:source_definition>
10258
10259             -- -- 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.
10260             -- -- 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
10261             -- -- may not.
10262             -- SELECT
10263             --     bre.id AS "bib_id",
10264             --     COALESCE( z.copy_count, 0 ) AS "copy_count",
10265             --     COALESCE( z.hold_count, 0 ) AS "hold_count",
10266             --     COALESCE( z.copy_hold_ratio, 0 ) AS "hold_copy_ratio"
10267             -- FROM (
10268                 SELECT
10269                     y.bre AS "id",
10270                     COALESCE( x.copy_count, 0 ) AS "copy_count",
10271                     y.hold_count AS "hold_count",
10272                     (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"
10273                 FROM (
10274                         SELECT
10275                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS "bre",
10276                             COUNT(*) AS "hold_count"
10277                         FROM action.hold_request h
10278                         WHERE
10279                             cancel_time IS NULL
10280                             AND fulfillment_time IS NULL
10281                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10282                         GROUP BY 1
10283                     )y LEFT JOIN (
10284                         SELECT 
10285                             (SELECT id
10286                                 FROM biblio.record_entry 
10287                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
10288                             ) AS "bre", 
10289                             COUNT(*) AS "copy_count"
10290                         FROM asset.copy
10291                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10292                         WHERE copy.holdable 
10293                             AND NOT copy.deleted 
10294                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10295                         GROUP BY 1
10296                     )x ON x.bre = y.bre
10297                 -- )z RIGHT JOIN (
10298                 --     SELECT id
10299                 --     FROM biblio.record_entry
10300                 --     WHERE NOT deleted
10301                 -- )bre ON (z.bib_id = bre.id)
10302                 
10303
10304                 </oils_persist:source_definition>
10305                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10306                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10307                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10308                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10309                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10310                 </fields>
10311                 <links>
10312                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10313                 </links>
10314                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10315                         <actions>
10316                                 <retrieve/>
10317                         </actions>
10318                 </permacrud>
10319         </class>
10320
10321         <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">
10322                 <oils_persist:source_definition>
10323             SELECT *,
10324                 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,
10325                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10326             FROM
10327                 (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
10328                     FROM
10329                         action.hold_request ahr
10330                         JOIN reporter.hold_request_record rhrr USING (id)
10331                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10332                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10333                     WHERE
10334                         ahr.cancel_time IS NULL
10335                         AND ahr.fulfillment_time IS NULL
10336                     GROUP BY bib_record, pickup_lib
10337                 )x
10338                 JOIN
10339                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10340                     FROM
10341                         action.hold_request ahr
10342                         JOIN reporter.hold_request_record rhrr USING (id)
10343                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10344                     WHERE
10345                         ahr.cancel_time IS NULL
10346                         AND ahr.fulfillment_time IS NULL
10347                     GROUP BY bib_record
10348                 )y
10349                 USING (id)
10350                 </oils_persist:source_definition>
10351                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10352                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10353                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10354                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10355                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10356                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10357                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10358                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10359                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10360                 </fields>
10361                 <links>
10362                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10363                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10364                 </links>
10365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10366                         <actions>
10367                                 <retrieve/>
10368                         </actions>
10369                 </permacrud>
10370         </class>
10371
10372         <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">
10373                 <oils_persist:source_definition>
10374             SELECT
10375                 ac.id,
10376                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10377                 MAX(actac.xact_start) AS last_circ
10378             FROM asset.copy ac
10379                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10380             GROUP BY ac.id
10381
10382             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10383             --SELECT
10384             --    ac.id,
10385             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10386             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10387             --FROM asset.copy ac
10388             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10389             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10390             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10391                 </oils_persist:source_definition>
10392                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10393                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10394                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10395                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10396                 </fields>
10397                 <links>
10398                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10399                 </links>
10400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10401                         <actions>
10402                                 <retrieve/>
10403                         </actions>
10404                 </permacrud>
10405         </class>
10406
10407         <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">
10408                 <fields oils_persist:primary="id">
10409                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10410                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10411                 </fields>
10412                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10413                         <actions>
10414                                 <retrieve/>
10415                         </actions>
10416                 </permacrud>
10417         </class>
10418
10419         <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">
10420                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10421                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10422                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10423                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10424                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10425                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10426                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10427                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10428                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10429                 </fields>
10430                 <links>
10431                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10432                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10433                 </links>
10434                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10435                         <actions>
10436                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10437                                 <retrieve/>
10438                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10439                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10440                         </actions>
10441                 </permacrud>
10442         </class>
10443
10444         <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">
10445                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10446                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10447                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10448                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10449                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10450                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10451                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10452                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10453                 </fields>
10454                 <links>
10455                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10456                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10457                 </links>
10458                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10459                         <actions>
10460                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10461                                 <retrieve/>
10462                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10463                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10464                         </actions>
10465                 </permacrud>
10466         </class>
10467
10468
10469         <!-- ********************************************************************************************************************* -->
10470         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10471         <!-- ********************************************************************************************************************* -->
10472         <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">
10473                 <fields oils_persist:primary="id">
10474                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10475                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10476                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10477                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10478                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10479                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10480                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10481                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10482                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10483                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10484                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10485                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10486                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10487                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10488                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10489                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10490                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10491                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10492                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10493                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10494                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10495                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10496                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10497                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10498                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10499                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10500                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10501                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10502                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10503                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10504                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10505                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10506                 </fields>
10507                 <links>
10508                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10509                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10510                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10511                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10512                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10513                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10514                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10515                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10516                 </links>
10517         </class>
10518
10519         <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">
10520                 <fields oils_persist:primary="id">
10521                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10522                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10523                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10524                 </fields>
10525                 <links>
10526                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10527                 </links>
10528         </class>
10529
10530         <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">
10531                 <fields oils_persist:primary="id">
10532                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10533                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10534                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10535                 </fields>
10536                 <links>
10537                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10538                 </links>
10539         </class>
10540
10541         <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">
10542                 <fields oils_persist:primary="id">
10543                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10544
10545                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10546                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10547                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10548
10549                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10550                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10551                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10552
10553                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10554                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10555
10556                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10557                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10558                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10559
10560                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10561                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10562
10563                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10564                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10565                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10566
10567                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10568                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10569                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10570
10571                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10572                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
10573                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
10574                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
10575
10576                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
10577                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
10578
10579                 </fields>
10580                 <links>
10581                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
10582                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10583                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
10584                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
10585                 </links>
10586         </class>
10587
10588         <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">
10589                 <oils_persist:source_definition>
10590
10591             SELECT
10592                 po.ordering_agency AS ordering_agency,
10593                 po.id AS purchase_order,
10594                 li.id AS lineitem,
10595                 lid.id AS lineitem_detail,
10596                 cpa.id AS claim_policy_action
10597             FROM
10598                 acq.lineitem_detail lid
10599                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
10600                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
10601                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
10602                 JOIN acq.claim_policy_action cpa ON (
10603                     cpa.claim_policy = cp.id
10604
10605                     -- we only care about claim policy actions whose claim
10606                     -- interval we'd reached or exceeded
10607                     AND (NOW() - cpa.action_interval) &gt; po.order_date
10608
10609                     -- filter out all claim policy actions where claim events
10610                     -- have occurred on or after the action's action_interval
10611                     AND NOT EXISTS (
10612                         SELECT 1
10613                         FROM
10614                             acq.claim_event evt
10615                             JOIN acq.claim claim ON (
10616                                 claim.id = evt.claim
10617                                 AND claim.lineitem_detail = lid.id
10618                             )
10619                         WHERE
10620                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
10621                     )
10622                 )
10623             WHERE
10624                 lid.cancel_reason IS NULL
10625                 AND li.cancel_reason IS NULL -- belt/suspenders
10626                 AND po.cancel_reason IS NULL -- belt/suspenders
10627                 AND lid.recv_time IS NULL
10628                 AND po.state = 'on-order'
10629             ORDER BY 1, 2, 3, 4, 5
10630
10631                 </oils_persist:source_definition>
10632                 <fields>
10633                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10634                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10635                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10636                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
10637                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
10638                 </fields>
10639                 <links>
10640                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10641                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10642                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10643                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
10644                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
10645                 </links>
10646         </class>
10647         <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">
10648                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10649                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10650                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10651                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10652                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10653                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10654                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10655                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10656                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10657                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10658                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10659                 </fields>
10660                 <links>
10661                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10662                 </links>
10663     </class>
10664         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
10665                 <oils_persist:source_definition>
10666             SELECT * FROM acq.lineitem_summary 
10667                                 WHERE item_count > (invoice_count + cancel_count)
10668         </oils_persist:source_definition>
10669                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10670                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10671                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10672                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10673                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10674                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10675                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10676                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10677                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10678                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10679                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10680                 </fields>
10681                 <links>
10682                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10683                 </links>
10684     </class>
10685         <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">
10686                 <oils_persist:source_definition>
10687
10688                         SELECT  t.*
10689                           FROM  action.transit_copy t
10690                                 JOIN actor.org_unit AS s ON (t.source = s.id)
10691                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
10692                           WHERE s.parent_ou &lt;&gt; d.parent_ou
10693
10694                 </oils_persist:source_definition>
10695                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
10696                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
10697                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
10698                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
10699                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
10700                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
10701                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
10702                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
10703                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
10704                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
10705                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
10706                 </fields>
10707                 <links>
10708                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
10709                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
10710                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
10711                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
10712                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10713                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
10714                 </links>
10715         </class>
10716
10717     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
10718                 <oils_persist:source_definition>
10719
10720         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
10721                 SELECT
10722                         cp.id as copy,
10723                         COUNT(circ.id),
10724                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10725                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10726                 FROM
10727                         asset.copy cp
10728                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
10729                 GROUP BY 1, 3, 4
10730                 UNION ALL
10731                 SELECT
10732                         cp.id as copy,
10733                         COUNT(circ.id),
10734                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10735                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10736                 FROM
10737                         asset.copy cp
10738                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
10739                 GROUP BY 1, 3, 4
10740                 UNION ALL
10741                 SELECT
10742                         id as copy,
10743                         circ_count,
10744                         -1 AS year,
10745                         false as is_renewal
10746                 FROM
10747                         extend_reporter.legacy_circ_count
10748         )x GROUP BY 1, 3, 4
10749
10750                 </oils_persist:source_definition>
10751         <fields>
10752             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
10753             <field reporter:label="Count" name="count" reporter:datatype="int"/>
10754             <field reporter:label="Year" name="year" reporter:datatype="int"/>
10755             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
10756         </fields>
10757                 <links>
10758                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
10759                 </links>
10760                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10761                         <actions>
10762                                 <retrieve/>
10763                         </actions>
10764                 </permacrud>
10765     </class>
10766
10767         <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">
10768                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
10769                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
10770                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
10771                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
10772                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
10773                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
10774                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
10775                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
10776                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
10777                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
10778                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
10779                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
10780                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
10781                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
10782                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
10783                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
10784                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
10785                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
10786                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
10787                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
10788                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
10789                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
10790                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
10791                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
10792                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
10793                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
10794                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
10795                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
10796                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
10797                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
10798                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
10799                 </fields>
10800                 <links>
10801                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
10802                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
10803                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
10804                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10805                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
10806                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10807                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10808                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
10809                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
10810                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
10811                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
10812                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
10813                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
10814                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
10815                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
10816                 </links>
10817         </class>
10818
10819     <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">
10820         <fields oils_persist:primary="id">
10821             <field reporter:label="Title" name="title" reporter:datatype="text"/>
10822             <field reporter:label="Author" name="author" reporter:datatype="text"/>
10823             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
10824             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
10825             <field reporter:label="Price" name="price" reporter:datatype="money"/>
10826             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10827             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
10828             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
10829             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10830             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
10831             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10832             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
10833             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="text"/>
10834             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="text"/>
10835             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10836             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10837             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
10838             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
10839             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
10840             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
10841             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
10842             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
10843             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10844             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
10845             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
10846             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
10847             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
10848             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
10849             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
10850             <field reporter:label="Status" name="status" reporter:datatype="link"/>
10851             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
10852             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
10853             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
10854             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
10855         </fields>
10856         <links>
10857             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10858             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10859             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10860             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10861             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
10862             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
10863         </links>
10864     </class>
10865
10866     <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">
10867         <fields oils_persist:primary="id">
10868             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10869             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10870             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10871             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10872         </fields>
10873         <links>
10874             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10875             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10876         </links>
10877     </class>
10878
10879     <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">
10880         <fields oils_persist:primary="owning_lib">
10881             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10882             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10883             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10884         </fields>
10885         <links>
10886             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10887         </links>
10888     </class>
10889
10890     <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">
10891         <fields oils_persist:primary="id">
10892             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10893             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10894             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10895             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10896             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10897         </fields>
10898         <links>
10899             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10900             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10901             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10902         </links>
10903     </class>
10904
10905     <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">
10906         <fields oils_persist:primary="circ_lib">
10907             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10908             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10909             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10910             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10911         </fields>
10912         <links>
10913             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10914             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10915         </links>
10916     </class>
10917
10918     <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">
10919         <fields oils_persist:primary="id">
10920             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10921             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10922             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10923             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10924             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10925         </fields>
10926         <links>
10927             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10928             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10929             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10930         </links>
10931     </class>
10932
10933     <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">
10934         <fields oils_persist:primary="home_ou">
10935             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10936             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10937             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10938             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10939         </fields>
10940         <links>
10941             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10942             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10943         </links>
10944     </class>
10945         <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">
10946                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
10947                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
10948                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
10949                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
10950                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10951                 </fields>
10952                 <links>
10953                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10954                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
10955                 </links>
10956                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10957                         <actions>
10958                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10959                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
10960                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10961                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10962                         </actions>
10963                 </permacrud>
10964         </class>
10965         <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">
10966                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
10967                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
10968                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10969                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
10970                 </fields>
10971                 <links>
10972                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10973                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
10974                         </links>
10975                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10976                 <actions>
10977                                 <create permission="ADMIN_ACQ_FUND_TAG">
10978                                         <context link="tag" field="owner"/>
10979                                 </create>
10980                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10981                                         <context link="tag" field="owner"/>
10982                                 </retrieve>
10983                                 <update permission="ADMIN_ACQ_FUND_TAG">
10984                                         <context link="tag" field="owner"/>
10985                                 </update>
10986                                 <delete permission="ADMIN_ACQ_FUND_TAG">
10987                                         <context link="tag" field="owner"/>
10988                                 </delete>
10989                         </actions>
10990                 </permacrud>
10991         </class>
10992         <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">
10993                 <oils_persist:source_definition><![CDATA[
10994                 SELECT
10995                         poi.purchase_order AS purchase_order,
10996                         ii.invoice AS invoice,
10997                         NULL AS lineitem,
10998                         poi.id AS po_item,
10999                         NULL AS picklist
11000                 FROM
11001                         acq.po_item poi
11002                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11003                 UNION SELECT
11004                         jub.purchase_order AS purchase_order,
11005                         ie.invoice AS invoice,
11006                         jub.id AS lineitem,
11007                         NULL AS po_item,
11008                         jub.picklist AS picklist
11009                 FROM
11010                         acq.lineitem jub
11011                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11012                 UNION SELECT
11013                         ii.purchase_order AS purchase_order,
11014                         ii.invoice AS invoice,
11015                         NULL AS lineitem,
11016                         NULL AS po_item,
11017                         NULL AS picklist
11018                 FROM
11019                         acq.invoice_item ii
11020                 WHERE ii.po_item IS NULL
11021                 UNION SELECT
11022                         ie.purchase_order AS purchase_order,
11023                         ie.invoice AS invoice,
11024                         NULL AS lineitem,
11025                         NULL AS po_item,
11026                         NULL AS picklist
11027                 FROM
11028                         acq.invoice_entry ie
11029                 WHERE ie.lineitem IS NULL
11030                 UNION SELECT
11031                         NULL AS purchase_order,
11032                         NULL AS invoice,
11033                         jub.id AS lineitem,
11034                         NULL AS po_item,
11035                         jub.picklist AS picklist
11036                 FROM
11037                         acq.lineitem jub
11038                 WHERE jub.purchase_order IS NULL
11039                 ]]></oils_persist:source_definition>
11040                 <fields>
11041                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11042                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11043                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11044                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11045                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11046                 </fields>
11047                 <links>
11048                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11049                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11050                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11051                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11052                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11053                 </links>
11054         </class>
11055         <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">
11056                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11057                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11058                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11059                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11060                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11061                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11062                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11063                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11064                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11065                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11066                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11067                 </fields>
11068                 <links>
11069                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11070                 </links>
11071                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11072                         <actions>
11073                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11074                                 <retrieve/>
11075                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11076                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11077                         </actions>
11078                 </permacrud>
11079         </class>
11080
11081         <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">
11082                 <fields oils_persist:primary="date_applied" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11083                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11084                         <field name="date_applied" reporter:datatype="timestamp"/>
11085                         <field name="org" reporter:datatype="org_unit"/>
11086                         <field name="original_value" reporter:datatype="text"/>
11087                         <field name="new_value" reporter:datatype="text"/>
11088                         <field name="field_name" reporter:datatype="link"/>
11089                 </fields>
11090                 <links>
11091                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11092                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11093                 </links>
11094                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11095                         <actions>
11096                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11097                                 <retrieve/>
11098                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11099                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11100                         </actions>
11101                 </permacrud>
11102         </class>
11103         <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">
11104                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11105                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11106                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11107                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11108                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11109                 </fields>
11110                 <links>
11111                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11112                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11113                 </links>
11114         </class>
11115         <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">
11116                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11117                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11118                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11119                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11120                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11121                 </fields>
11122                 <links>
11123                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11124                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11125                 </links>
11126         </class>
11127         <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">
11128                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11129                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11130                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11131                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11132                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11133                 </fields>
11134                 <links>
11135                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11136                 </links>
11137                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11138                         <actions>
11139                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11140                                 <retrieve/>
11141                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11142                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11143                         </actions>
11144                 </permacrud>
11145         </class>
11146         <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">
11147                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11148                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11149                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11150                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11151                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11152                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11153                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11154                 </fields>
11155                 <links>
11156                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11157                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
11158                 </links>
11159                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11160                         <actions>
11161                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11162                                 <retrieve/>
11163                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11164                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11165                         </actions>
11166                 </permacrud>
11167         </class>
11168
11169         <!-- ********************************************************************************************************************* -->
11170
11171 </IDL>
11172
11173 <!--
11174     vim:noet:ts=4:sw=4:
11175 -->