]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1252786: Add Workstation link to Aged and Active Circulations reports source.
[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="Workstation" name="workstation" reporter:datatype="link"/>
3999                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4000                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4001                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4002                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4003                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4004                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4005                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4006                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4007                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4008                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4009                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4010                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4011                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4012                 </fields>
4013                 <links>
4014                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4015                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4016                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4017                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4018                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4019                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4020                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4021                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4022                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4023                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4024                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4025                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4026                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4027                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4028                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4029                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4030                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4031                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4032                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4033                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4034                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4035                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4036                 </links>
4037         </class>
4038         <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">
4039                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4040                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4041                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4042                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4043                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4044                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4045                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4046                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4047                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4048                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4049                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4050                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4051                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4052                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4053                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4054                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4055                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4056                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4057                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4058                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4059                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4060                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4061                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4062                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4063                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4064                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
4065                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4066                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4067                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4068                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4069                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4070                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4071                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4072                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4073                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4074                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4075                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4076                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4077                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4078                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4079                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4080                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4081                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4082                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4083                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4084                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4085                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4086                 </fields>
4087                 <links>
4088                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4089                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4090                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4091                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4092                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4093                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4094                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4095                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4096                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4097                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4098                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4099                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4100                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4101                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4102                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4103                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4104                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4105                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4106                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4107                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4108                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4109                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4110                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4111                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4112                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4113                 </links>
4114         </class>
4115
4116         <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">
4117                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4118                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4119                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4120                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4121                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4122                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4123                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4124                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4125                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4126                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4127                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4128                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4129                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4130                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4131                 </fields>
4132                 <links>
4133                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4134                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4135                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4136                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4137                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4138                 </links>
4139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4140                         <actions>
4141                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4142                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4143                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4144                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4145                         </actions>
4146                 </permacrud>
4147         </class>
4148
4149         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4150                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4151                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4152                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4153                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4154                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4155                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4156                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4157                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4158                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4159                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4160                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4161                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4162                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4163                 </fields>
4164                 <links>
4165                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4166                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4167                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4168                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4169                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4170                 </links>
4171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4172                         <actions>
4173                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4174                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4175                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4176                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4177                         </actions>
4178                 </permacrud>
4179         </class>
4180         
4181         <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">
4182                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4183                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4184                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4185                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4186                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4187                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4188                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4189                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4190                 </fields>
4191                 <links>
4192                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4193                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4194                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4195                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4196                 </links>
4197                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4198                         <actions>
4199                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4200                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4201                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4202                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4203                         </actions>
4204                 </permacrud>
4205         </class>
4206         
4207         <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">
4208                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4209                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4210                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4211                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4212                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4213                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4214                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4215                 </fields>
4216                 <links>
4217                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4218                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4219                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4220                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4221                 </links>
4222                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4223                         <actions>
4224                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4225                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4226                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4227                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4228                         </actions>
4229                 </permacrud>
4230         </class>
4231         
4232         <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">
4233                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4234                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4235                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4236                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4237                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4238                 </fields>
4239                 <links>
4240                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4241                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4242                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4243                 </links>
4244                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4245                         <actions>
4246                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4247                     <context link="resource" field="owner" />
4248                 </create>
4249                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4250                     <context link="resource" field="owner" />
4251                 </retrieve>
4252                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4253                     <context link="resource" field="owner" />
4254                 </update>
4255                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4256                     <context link="resource" field="owner" />
4257                 </delete>
4258                         </actions>
4259                 </permacrud>
4260         </class>
4261         
4262         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4263                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4264                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4265                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4266                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4267                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4268                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4269                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4270                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4271                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4272                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4273                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4274                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4275                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4276                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4277                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4278                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4279                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4280                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4281                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4282                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4283                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4284                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4285                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4286                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4287                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4288                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4289                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4290                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4291                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4292                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4293                 </fields>
4294                 <links>
4295                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4296                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4297                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4298                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4299                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4300                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4301                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4302                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4303                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4304                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4305                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4306                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4307                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4308                 </links>
4309                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4310                         <actions>
4311                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4312                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4313                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4314                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4315                         </actions>
4316                 </permacrud>
4317         </class>
4318         
4319         <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">
4320                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4321                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4322                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4323                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4324                 </fields>
4325                 <links>
4326                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4327                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4328                 </links>
4329                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4330                         <actions>
4331                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4332                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4333                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4334                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4335                         </actions>
4336                 </permacrud>
4337         </class>
4338
4339         <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">
4340                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4341                         <field name="bucket" reporter:datatype="link"/>
4342                         <field name="id" reporter:datatype="id" />
4343                         <field name="target_call_number" reporter:datatype="link" />
4344                         <field name="create_time" reporter:datatype="timestamp" />
4345                         <field name="pos" reporter:datatype="int" />
4346                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4347                 </fields>
4348                 <links>
4349                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4350                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4351             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4352                 </links>
4353         </class>
4354         <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">
4355                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4356                         <field name="id" reporter:datatype="id" />
4357                         <field name="item" reporter:datatype="link"/>
4358                         <field name="note" reporter:datatype="text" />
4359                 </fields>
4360                 <links>
4361                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4362                 </links>
4363         </class>
4364         <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">
4365                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4366                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4367                         <field name="btype" reporter:datatype="text"/>
4368                         <field name="id" reporter:datatype="id" />
4369                         <field name="name" reporter:datatype="text"/>
4370                         <field name="description" reporter:datatype="text"/>
4371                         <field name="owner" reporter:datatype="link"/>
4372                         <field name="pub" reporter:datatype="bool"/>
4373                         <field name="create_time" reporter:datatype="timestamp" />
4374                 </fields>
4375                 <links>
4376                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4377                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4378                 </links>
4379         </class>
4380         <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">
4381                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4382                         <field name="id" reporter:datatype="id" />
4383                         <field name="bucket" reporter:datatype="link"/>
4384                         <field name="note" reporter:datatype="text" />
4385                 </fields>
4386                 <links>
4387                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4388                 </links>
4389         </class>
4390         <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">
4391                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4392                         <field name="hold" reporter:datatype="link"/>
4393                         <field name="id" reporter:datatype="id" />
4394                         <field name="target_copy" reporter:datatype="link"/>
4395                         <field name="proximity" reporter:datatype="number"/>
4396                 </fields>
4397                 <links>
4398                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4399                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4400                 </links>
4401         </class>
4402         <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">
4403                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4404                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4405                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4406                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4407                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4408                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4409                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4410                 </fields>
4411                 <links>
4412                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4413                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4414                 </links>
4415         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4416             <actions>
4417                 <create permission="CREATE_HOLD_NOTIFICATION">
4418                                         <context link="hold" jump="usr" field="home_ou" />
4419                                 </create>
4420                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4421                                         <context link="hold" jump="usr" field="home_ou" />
4422                                 </retrieve>
4423                 <update permission="CREATE_HOLD_NOTIFICATION">
4424                                         <context link="hold" jump="usr" field="home_ou" />
4425                                 </update>
4426                 <delete permission="CREATE_HOLD_NOTIFICATION">
4427                                         <context link="hold" jump="usr" field="home_ou" />
4428                                 </delete>
4429             </actions>
4430         </permacrud>
4431         </class>
4432         <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">
4433                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4434                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4435                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4436                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4437                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4438                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4439                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4440                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4441                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4442                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4443                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4444                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4445                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4446                 </fields>
4447                 <links>
4448                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4449                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4450                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4451                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4452                 </links>
4453         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4454             <actions>
4455                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4456                 <retrieve/>
4457                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4458                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4459             </actions>
4460         </permacrud>
4461         </class>
4462         <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">
4463                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4464                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4465                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4466                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4467                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4468             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4469             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4470             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4471                 </fields>
4472                 <links>
4473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4474                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4475                 </links>
4476         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4477             <actions>
4478                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4479                 <retrieve/>
4480                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4481                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4482             </actions>
4483         </permacrud>
4484         </class>
4485         <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">
4486                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4487                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4488             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4489             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4490                 </fields>
4491                 <links>
4492                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4493                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4494                 </links>
4495         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4496             <actions>
4497                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4498                                         <context link="lgroup" field="owner" />
4499                 </create>
4500                 <retrieve/>
4501                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4502                                         <context link="lgroup" field="owner" />
4503                 </update>
4504                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4505                                         <context link="lgroup" field="owner" />
4506                 </delete>
4507             </actions>
4508         </permacrud>
4509         </class>
4510
4511     <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">
4512         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4513             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4514             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4515             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4516             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4517         </fields>
4518         <links>
4519             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4520             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4521         </links>
4522         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4523             <actions>
4524                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4525                 <retrieve/>
4526                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4527                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4528             </actions>
4529         </permacrud>
4530     </class>
4531
4532         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4533                 <fields>
4534                         <field name="sre_id" oils_persist:virtual="true" />
4535                         <field name="location" oils_persist:virtual="true" />
4536                         <field name="owning_lib" oils_persist:virtual="true" />
4537                         <field name="basic_holdings" oils_persist:virtual="true" />
4538                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4539                         <field name="supplement_holdings" oils_persist:virtual="true" />
4540                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4541                         <field name="index_holdings" oils_persist:virtual="true" />
4542                         <field name="index_holdings_add" oils_persist:virtual="true" />
4543                         <field name="online" oils_persist:virtual="true" />
4544                         <field name="missing" oils_persist:virtual="true" />
4545                         <field name="incomplete" oils_persist:virtual="true" />
4546                 </fields>
4547         </class>
4548
4549         <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">
4550                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4551                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4552                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4553                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4554                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4555                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4556                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4557                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4558                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4559                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4560                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4561                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4562                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4563                 </fields>
4564                 <links>
4565                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4566                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4567                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4568                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4569                 </links>
4570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4571                         <actions>
4572                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4573                                 <retrieve/>
4574                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4575                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4576                         </actions>
4577                 </permacrud>
4578         </class>
4579
4580         <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">
4581                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4582                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4583                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4584                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4585                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4586                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4587                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4588                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4589                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4590                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4591                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4592                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4593                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4594                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4595                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4596                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4597                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4598                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4599                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4600                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4601                 </fields>
4602                 <links>
4603                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4604                 </links>
4605                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4606                         <actions>
4607                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4608                                         <context link="subscription" field="owning_lib" />
4609                                 </create>
4610                                 <retrieve />
4611                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4612                                         <context link="subscription" field="owning_lib" />
4613                                 </update>
4614                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4615                                         <context link="subscription" field="owning_lib" />
4616                                 </delete>
4617                         </actions>
4618                 </permacrud>
4619         </class>
4620
4621         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4622                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4623                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4624                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4625                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4626                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4627                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4628                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4629                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4630                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4631                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4632                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4633                 </fields>
4634                 <links>
4635                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4636                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4637                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4638                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4639                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4640                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4641                 </links>
4642                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4643                         <actions>
4644                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4645                                 <retrieve />
4646                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4647                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4648                         </actions>
4649                 </permacrud>
4650         </class>
4651
4652         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4653                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4654                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4655                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4656                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4657                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4658                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4659                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4660                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4661                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4662                 </fields>
4663                 <links>
4664                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4665                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4666                 </links>
4667         </class>
4668
4669         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4670                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4671                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4672                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4673                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4674                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4675                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4676                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4677                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4678                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4679                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4680                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4681                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4682                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4683                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
4684                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
4685                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4686                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4687                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4688                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4689                 </fields>
4690                 <links>
4691                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
4692                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4693                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
4694                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
4695                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
4696                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
4697                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
4698                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
4699                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
4700                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
4701                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
4702                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
4703                 </links>
4704                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4705                         <actions>
4706                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4707                                 <retrieve />
4708                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4709                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
4710                         </actions>
4711                 </permacrud>
4712         </class>
4713
4714         <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">
4715                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
4716                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4717                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4718                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4719                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4720                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4721                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4722                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4723                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4724                 </fields>
4725                 <links>
4726                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4727                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4728                 </links>
4729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4730                         <actions>
4731                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
4732                                         <context link="distribution" field="holding_lib" />
4733                                 </create>
4734                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
4735                                         <context link="distribution" field="holding_lib" />
4736                                 </retrieve>
4737                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
4738                                         <context link="distribution" field="holding_lib" />
4739                                 </update>
4740                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
4741                                         <context link="distribution" field="holding_lib" />
4742                                 </delete>
4743                         </actions>
4744                 </permacrud>
4745         </class>
4746
4747         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
4748                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
4749                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4750                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
4751                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
4752                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4753                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
4754                 </fields>
4755                 <links>
4756                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4757                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
4758                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
4759                 </links>
4760                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4761                         <actions>
4762                                 <create permission="ADMIN_SERIAL_STREAM">
4763                                         <context link="distribution" field="holding_lib" />
4764                                 </create>
4765                                 <retrieve />
4766                                 <update permission="ADMIN_SERIAL_STREAM">
4767                                         <context link="distribution" field="holding_lib" />
4768                                 </update>
4769                                 <delete permission="ADMIN_SERIAL_STREAM">
4770                                         <context link="distribution" field="holding_lib" />
4771                                 </delete>
4772                         </actions>
4773                 </permacrud>
4774         </class>
4775
4776         <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">
4777                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
4778                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4779                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4780                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4781                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
4782                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
4783                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
4784                 </fields>
4785                 <links>
4786                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4787                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
4788                 </links>
4789                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4790                         <actions>
4791                                 <create permission="ADMIN_SERIAL_STREAM">
4792                                         <context link="stream" jump="distribution" field="holding_lib" />
4793                                 </create>
4794                                 <retrieve permission="RECEIVE_SERIAL">
4795                                         <context link="stream" jump="distribution" field="holding_lib" />
4796                                 </retrieve>
4797                                 <update permission="ADMIN_SERIAL_STREAM">
4798                                         <context link="stream" jump="distribution" field="holding_lib" />
4799                                 </update>
4800                                 <delete permission="ADMIN_SERIAL_STREAM">
4801                                         <context link="stream" jump="distribution" field="holding_lib" />
4802                                 </delete>
4803                         </actions>
4804                 </permacrud>
4805         </class>
4806
4807         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
4808                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
4809                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4810                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4811                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4812                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4813                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4814                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4815                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
4816                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4817                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
4818                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
4819                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
4820                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
4821                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
4822                 </fields>
4823                 <links>
4824                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4825                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4826                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4827                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
4828                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
4829                 </links>
4830                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4831                         <actions>
4832                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
4833                                         <context link="subscription" field="owning_lib" />
4834                                 </create>
4835                                 <retrieve/>
4836                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
4837                                         <context link="subscription" field="owning_lib" />
4838                                 </update>
4839                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
4840                                         <context link="subscription" field="owning_lib" />
4841                                 </delete>
4842                         </actions>
4843                 </permacrud>
4844         </class>
4845
4846         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
4847                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
4848                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4849                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
4850                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
4851                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4852                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
4853                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
4854                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4855                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
4856                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
4857                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
4858                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4859                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
4860                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
4861                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4862                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
4863                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4864                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
4865                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
4866                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
4867                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
4868                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
4869                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
4870                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
4871                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
4872                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
4873                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
4874                         <field reporter:label="Price" name="price" reporter:datatype="money" />
4875                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
4876                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
4877                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
4878                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
4879                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
4880                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
4881                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
4882                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
4883                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
4884                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4885                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4886                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4887                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
4888                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
4889                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4890                 </fields>
4891                 <links>
4892                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
4893                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4894                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4895                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4896                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4897                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
4898                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4899                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
4900                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
4901                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
4902                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
4903                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
4904                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
4905                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
4906                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
4907                 </links>
4908                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4909                         <actions>
4910                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4911                                 <retrieve/>
4912                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4913                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
4914                         </actions>
4915                 </permacrud>
4916         </class>
4917
4918         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
4919                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
4920                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4921                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4922                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4923                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4924                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
4925                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
4926                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
4927                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
4928                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
4929                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
4930                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
4931                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
4932                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4933                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
4934                 </fields>
4935                 <links>
4936                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4937                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4938                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
4939                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
4940                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
4941                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
4942                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
4943                 </links>
4944                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4945                         <actions>
4946                                 <create permission="ADMIN_SERIAL_ITEM">
4947                                         <context link="stream" jump="distribution" field="holding_lib" />
4948                                 </create>
4949                                 <retrieve permission="ADMIN_SERIAL_ITEM">
4950                                         <context link="stream" jump="distribution" field="holding_lib" />
4951                                 </retrieve>
4952                                 <update permission="ADMIN_SERIAL_ITEM">
4953                                         <context link="stream" jump="distribution" field="holding_lib" />
4954                                 </update>
4955                                 <delete permission="ADMIN_SERIAL_ITEM">
4956                                         <context link="stream" jump="distribution" field="holding_lib" />
4957                                 </delete>
4958                         </actions>
4959                 </permacrud>
4960         </class>
4961
4962         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
4963                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
4964                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4965                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
4966                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4967                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4968                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4969                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4970                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4971                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4972                 </fields>
4973                 <links>
4974                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
4975                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4976                 </links>
4977                 <!-- Not available via PCRUD at this time -->
4978         </class>
4979         <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">
4980                 <fields>
4981                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
4982                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
4983                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
4984                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
4985                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
4986                 </fields>
4987                 <links>
4988                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
4989                 </links>
4990         </class>
4991         <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">
4992                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
4993                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4994                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
4995                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
4996                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
4997                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
4998                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
4999                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5000                 </fields>
5001                 <links>
5002                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5003                 </links>
5004         </class>
5005         <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">
5006                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5007                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5008                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5009                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5010                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5011                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5012                 </fields>
5013                 <links>
5014                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5015                 </links>
5016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5017                         <actions>
5018                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5019                                         <context link="distribution" field="holding_lib" />
5020                                 </create>
5021                                 <retrieve/>
5022                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5023                                         <context link="distribution" field="holding_lib" />
5024                                 </update>
5025                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5026                                         <context link="distribution" field="holding_lib" />
5027                                 </delete>
5028                         </actions>
5029                 </permacrud>
5030         </class>
5031
5032         <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">
5033                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5034                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5035                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5036                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5037                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5038                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5039                 </fields>
5040                 <links>
5041                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5042                 </links>
5043                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5044                         <actions>
5045                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5046                                         <context link="distribution" field="holding_lib" />
5047                                 </create>
5048                                 <retrieve/>
5049                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5050                                         <context link="distribution" field="holding_lib" />
5051                                 </update>
5052                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5053                                         <context link="distribution" field="holding_lib" />
5054                                 </delete>
5055                         </actions>
5056                 </permacrud>
5057         </class>
5058
5059         <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">
5060                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5061                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5062                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5063                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5064                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5065                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5066                 </fields>
5067                 <links>
5068                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5069                 </links>
5070                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5071                         <actions>
5072                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5073                                         <context link="distribution" field="holding_lib" />
5074                                 </create>
5075                                 <retrieve/>
5076                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5077                                         <context link="distribution" field="holding_lib" />
5078                                 </update>
5079                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5080                                         <context link="distribution" field="holding_lib" />
5081                                 </delete>
5082                         </actions>
5083                 </permacrud>
5084         </class>
5085
5086         <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">
5087                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5088                         <field name="id" reporter:datatype="id" />
5089                         <field name="owning_copy" reporter:datatype="link"/>
5090                         <field name="stat_cat" reporter:datatype="link"/>
5091                         <field name="stat_cat_entry" reporter:datatype="link"/>
5092                 </fields>
5093                 <links>
5094                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5095                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5096                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5097                 </links>
5098         </class>
5099         <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">
5100                 <fields oils_persist:primary="code">
5101                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5102                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5103                 </fields>
5104                 <links/>
5105         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5106             <actions>
5107                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5108                 <retrieve/>
5109                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5110                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5111             </actions>
5112         </permacrud>
5113         </class>
5114         <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">
5115                 <fields oils_persist:primary="code">
5116                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5117                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5118                 </fields>
5119                 <links/>
5120         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5121             <actions>
5122                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5123                 <retrieve/>
5124                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5125                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5126             </actions>
5127         </permacrud>
5128         </class>
5129         <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">
5130                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5131                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5132                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5133                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5134                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5135                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5136                 </fields>
5137                 <links>
5138             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5139         </links>
5140         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5141             <actions>
5142                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5143                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5144                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5145                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5146             </actions>
5147         </permacrud>
5148         </class>
5149         <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">
5150                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5151                         <field name="id" reporter:datatype="id" />
5152                         <field name="name" reporter:datatype="text"/>
5153                 </fields>
5154                 <links/>
5155         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5156             <actions>
5157                 <create permission="CREATE_LASSO" global_required="true"/>
5158                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5159                 <update permission="UPDATE_LASSO" global_required="true"/>
5160                 <delete permission="DELETE_LASSO" global_required="true"/>
5161             </actions>
5162         </permacrud>
5163         </class>
5164         <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">
5165                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5166                         <field name="id" reporter:datatype="id" />
5167                         <field name="lasso" reporter:datatype="link"/>
5168                         <field name="org_unit" reporter:datatype="org_unit"/>
5169                 </fields>
5170                 <links>
5171                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5172                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5173                 </links>
5174         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5175             <actions>
5176                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5177                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5178                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5179                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5180             </actions>
5181         </permacrud>
5182         </class>
5183         <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">
5184                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5185                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5186                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5187                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5188                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5189                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5190                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5191                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5192                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5193                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5194                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5195                 </fields>
5196                 <links>
5197                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5198                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5199                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5200                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5201                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5202                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5203                 </links>
5204         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5205             <actions>
5206                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5207                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5208                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5209                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5210             </actions>
5211         </permacrud>
5212         </class>
5213         <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">
5214                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5215                         <field name="id" reporter:datatype="id" />
5216                         <field name="from_org" reporter:datatype="org_unit"/>
5217                         <field name="to_org" reporter:datatype="org_unit"/>
5218                         <field name="prox" reporter:datatype="int" />
5219                 </fields>
5220                 <links>
5221                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5222                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5223                 </links>
5224         </class>
5225         <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">
5226                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5227                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5228                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5229                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5230                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5231                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5232                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5233                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5234                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5235                 </fields>
5236                 <links/>
5237         </class>
5238         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5239                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5240                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5241                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5242                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5243                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5244                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5245                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5246                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5247                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5248                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5249                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5250                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5251                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5252                 </fields>
5253                 <links>
5254                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5255                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5256                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5257                 </links>
5258         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5259             <actions>
5260                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5261                 <retrieve/>
5262                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5263                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5264             </actions>
5265         </permacrud>
5266         </class>
5267         <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">
5268                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5269                         <field name="address_type"  reporter:datatype="text"/>
5270                         <field name="city"  reporter:datatype="text"/>
5271                         <field name="country"  reporter:datatype="text"/>
5272                         <field name="county"  reporter:datatype="text"/>
5273                         <field name="id" reporter:datatype="id" />
5274                         <field name="org_unit" reporter:datatype="org_unit"/>
5275                         <field name="post_code"  reporter:datatype="text"/>
5276                         <field name="state"  reporter:datatype="text"/>
5277                         <field name="street1"  reporter:datatype="text"/>
5278                         <field name="street2"  reporter:datatype="text"/>
5279                         <field name="valid" reporter:datatype="bool"/>
5280                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5281                 </fields>
5282                 <links>
5283                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5284                 </links>
5285         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5286             <actions>
5287                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5288                 <retrieve/>
5289                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5290                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5291             </actions>
5292         </permacrud>
5293         </class>
5294         <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">
5295                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5296                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5297                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5298                         <field name="query_text" reporter:datatype="text"/>
5299                 </fields>
5300         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5301             <actions>
5302                 <retrieve/>
5303             </actions>
5304         </permacrud>
5305         </class>
5306
5307         <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">
5308                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5309                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5310                         <field name="owner" reporter:datatype="org_unit"/>
5311                         <field name="code" reporter:datatype="text"/>
5312                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5313                         <field name="create_date" reporter:datatype="timestamp"/>
5314                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5315                 </fields>
5316                 <links>
5317                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5318                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5319                 </links>
5320         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5321             <actions>
5322                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5323                 <retrieve/>
5324                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5325                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5326             </actions>
5327         </permacrud>
5328         </class>
5329         <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">
5330                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5331                         <field name="id" reporter:datatype="id"/>
5332                         <field name="grp" reporter:datatype="link"/>
5333                         <field name="pos" reporter:datatype="int"/>
5334                         <field name="query" reporter:datatype="link"/>
5335                 </fields>
5336                 <links>
5337                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5338                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5339                 </links>
5340         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5341             <actions>
5342                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5343                     <context link="grp" field="owner"/>
5344                 </create>
5345                 <retrieve/>
5346                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5347                     <context link="grp" field="owner"/>
5348                 </update>
5349                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5350                     <context link="grp" field="owner"/>
5351                 </delete>
5352             </actions>
5353         </permacrud>
5354         </class>
5355
5356         <!-- A note: Please update alhr and ahopl when updating ahr -->
5357         <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">
5358                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5359                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5360                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5361                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5362                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5363                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5364                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5365                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5366                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5367                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5368                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5369                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5370                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5371                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5372                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5373                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5374                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5375                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5376                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5377                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5378                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5379                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5380                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5381                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5382                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5383                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5384                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5385                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5386                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5387                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5388                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5389                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5390                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5391                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5392                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5393                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5394                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5395                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5396                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5397                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5398                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5399                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5400                 </fields>
5401                 <links>
5402                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5403                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5404                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5405                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5406                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5407                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5408                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5409                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5410                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5411                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5412                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5413                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5414                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5415                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5416                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5417                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5418                 </links>
5419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5420                         <actions>
5421                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5422                         </actions>
5423                 </permacrud>
5424         </class>
5425         <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">
5426                 <oils_persist:source_definition><![CDATA[
5427                 SELECT
5428                         ahr.*,
5429                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5430                                 copy_location_order_position,
5431                         CASE WHEN au.alias IS NOT NULL THEN
5432                                 au.alias
5433                         ELSE
5434                                 au.first_given_name
5435                         END AS usr_alias_or_first_given_name,
5436                         au.first_given_name AS usr_first_given_name,
5437                         au.second_given_name AS usr_second_given_name,
5438                         au.family_name AS usr_family_name,
5439                         au.prefix AS usr_prefix,
5440                         au.suffix AS usr_suffix,
5441                         au.alias AS usr_alias,
5442                         CASE WHEN au.alias IS NOT NULL THEN
5443                                 au.alias
5444                         ELSE
5445                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5446                                         COALESCE(au.family_name, ''),
5447                                         COALESCE(au.suffix, ''),
5448                                         ', ',
5449                                         COALESCE(au.prefix, ''),
5450                                         COALESCE(au.first_given_name, ''),
5451                                         COALESCE(au.second_given_name, '')
5452                                 ], ' '), E'\\s+,', ',')
5453                         END AS usr_alias_or_display_name,
5454                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5455                                 COALESCE(au.family_name, ''),
5456                                 COALESCE(au.suffix, ''),
5457                                 ', ',
5458                                 COALESCE(au.prefix, ''),
5459                                 COALESCE(au.first_given_name, ''),
5460                                 COALESCE(au.second_given_name, '')
5461                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5462                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5463                                 AS call_number_label,
5464                         siss.label AS issuance_label,
5465                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5466                         ahcm_1.copy_count AS potential_copies
5467                 FROM action.hold_request ahr
5468                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5469                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5470                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5471                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5472                 JOIN actor.usr au ON (au.id = ahr.usr)
5473                 JOIN (
5474                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5475                         FROM asset.copy_location
5476                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5477                 LEFT JOIN actor.usr_standing_penalty ausp 
5478                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5479                 LEFT JOIN config.standing_penalty csp
5480                         ON (
5481                                 csp.id = ausp.standing_penalty AND 
5482                                 csp.block_list LIKE '%CAPTURE%' AND (
5483                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5484                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5485                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5486                                         )
5487                                 )
5488                         )
5489                 JOIN (
5490                         SELECT COUNT(target_copy) AS copy_count, hold
5491                         FROM action.hold_copy_map
5492                         GROUP BY 2
5493                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5494                 LEFT JOIN serial.issuance siss
5495                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5496                 LEFT JOIN asset.copy_location_order acplo
5497                         ON (acp.location = acplo.location AND
5498                                 acp.circ_lib = acplo.org)
5499                 WHERE
5500                         ahr.capture_time IS NULL AND
5501                         ahr.cancel_time IS NULL AND
5502                         csp.id IS NULL AND
5503                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5504                         acp.status IN (0,7)
5505                 ]]></oils_persist:source_definition>
5506                 <fields oils_persist:primary="id">
5507                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5508                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5509                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5510                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5511                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5512                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5513                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5514                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5515                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5516                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5517                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5518                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5519                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5520                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5521                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5522                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5523                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5524                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5525                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5526                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5527                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5528                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5529                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5530                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5531                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5532                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5533                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5534                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5535                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5536                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5537                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5538                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5539                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5540                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5541                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5542                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5543                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5544                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5545                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5546                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5547                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5548                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5549                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5550                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5551                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5552                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5553                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5554                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5555                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5556                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5557                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5558                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5559                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5560                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5561                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5562                 </fields>
5563                 <links>
5564                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5565                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5566                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5567                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5568                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5569                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5570                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5571                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5572                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5573                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5574                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5575                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5576                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5577                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5578                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5579                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5580                 </links>
5581                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5582                         <actions>
5583                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5584                         </actions>
5585                 </permacrud>
5586         </class>
5587         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5588                 <oils_persist:source_definition>
5589                         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)
5590                 </oils_persist:source_definition>
5591                 <fields oils_persist:primary="id">
5592                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5593                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5594                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5595                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5596                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5597                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5598                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5599                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5600                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5601                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5602                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5603                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5604                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5605                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5606                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5607                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5608                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5609                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5610                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5611                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5612                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5613                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5614                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5615                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5616                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5617                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5618                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5619                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5620                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5621                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5622                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5623                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5624                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5625                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5626                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5627                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5628                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5629                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5630                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5631                 </fields>
5632                 <links>
5633                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5634                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5635                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5636                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5637                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5638                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5639                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5640                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5641                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5642                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5643                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5644                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5645                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5646                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5647                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5648                 </links>
5649         </class>
5650
5651         <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">
5652                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5653                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5654                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5655                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5656                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5657                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5658                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5659                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5660                 </fields>
5661                 <links>
5662                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5663                 </links>
5664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5665                         <actions>
5666                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5667                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5668                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5669                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5670                         </actions>
5671                 </permacrud>
5672         </class>
5673         <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">
5674                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5675                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5676                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5677                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5678                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5679                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5680                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5681                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5682                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5683                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5684                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5685                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5686                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5687                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5688                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5689                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5690                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5691                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5692                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5693                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5694                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5695                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5696                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5697                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5698                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5699                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5700                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5701                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5702                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5703                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5704                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5705                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5706                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5707                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5708                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5709                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5710                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5711                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5712                 </fields>
5713                 <links>
5714                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5715                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5716                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5717                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5718                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5719                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5720                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5721                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5722                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5723                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5724                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5725                 </links>
5726                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5727                         <actions>
5728                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5729                         </actions>
5730                 </permacrud>
5731         </class>
5732         <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">
5733                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5734                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5735                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5736                         <field reporter:label="Currently Targeted Copy" name="current_copy" />
5737                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5738                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5739                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5740                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5741                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5742                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5743                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5744                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5745                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5746                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5747                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5748                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5749                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5750                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5751                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5752                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5753                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5754                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5755                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5756                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5757                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5758                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5759                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5760                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5761                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5762                         <field reporter:label="Thaw Date (if frozen)" name="thaw_date" reporter:datatype="timestamp"/>
5763                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5764                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5765                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5766                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5767                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5768                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5769                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5770                 </fields>
5771                 <links>
5772                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5773                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5774                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5775                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5776                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5777                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5778                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5779                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5780                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5781                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5782                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5783                 </links>
5784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5785                         <actions>
5786                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5787                         </actions>
5788                 </permacrud>
5789         </class>
5790
5791         <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">
5792                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
5793                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
5794                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
5795                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
5796                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
5797                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
5798                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
5799                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5800                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
5801                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
5802                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
5803                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
5804                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
5805                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5806                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
5807                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
5808                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
5809                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5810                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
5811                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
5812                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
5813                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
5814                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
5815                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
5816                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
5817                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
5818                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
5819                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5820                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5821                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5822                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
5823                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
5824                 </fields>
5825                 <links>
5826                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
5827                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
5828                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
5829                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
5830                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
5831                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
5832                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
5833                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
5834                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
5835                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
5836                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
5837                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
5838                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
5839                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
5840                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
5841                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
5842                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
5843                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
5844                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
5845                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
5846                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
5847                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
5848                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
5849                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
5850                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
5851                 </links>
5852         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5853             <actions>
5854                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
5855                 <retrieve />
5856                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
5857                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
5858             </actions>
5859         </permacrud>
5860         </class>
5861         <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">
5862                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
5863                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5864                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
5865                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
5866                 </fields>
5867                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5868                         <actions>
5869                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5870                                 <retrieve/>
5871                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5872                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5873                         </actions>
5874                 </permacrud>
5875         </class>
5876         <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">
5877                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
5878                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5879                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
5880                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
5881                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
5882                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
5883                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
5884                 </fields>
5885                 <links>
5886                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
5887                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5888                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
5889                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
5890                 </links>
5891                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5892                         <actions>
5893                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5894                                 <retrieve/>
5895                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5896                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
5897                         </actions>
5898                 </permacrud>
5899         </class>
5900         <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">
5901                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
5902                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5903                         <field name="btype" reporter:datatype="text"/>
5904                         <field name="id" reporter:datatype="id" />
5905                         <field name="name"  reporter:datatype="text"/>
5906                         <field name="description" reporter:datatype="text"/>
5907                         <field name="owner" reporter:datatype="link"/>
5908                         <field name="pub" reporter:datatype="bool"/>
5909                         <field name="create_time" reporter:datatype="timestamp" />
5910                 </fields>
5911                 <links>
5912                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5913                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
5914                 </links>
5915         </class>
5916         <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">
5917                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
5918                         <field name="id" reporter:datatype="id" />
5919                         <field name="bucket" reporter:datatype="link"/>
5920                         <field name="note" reporter:datatype="text" />
5921                 </fields>
5922                 <links>
5923                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5924                 </links>
5925         </class>
5926         <class id="asc" controller="open-ils.cstore" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
5927                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
5928                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5929                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5930                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5931                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5932                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5933                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5934                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5935                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5936                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5937                 </fields>
5938                 <links>
5939                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5940                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
5941                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
5942                 </links>
5943         </class>
5944         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
5945                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
5946                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
5947                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5948                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
5949                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5950                 </fields>
5951                 <links>
5952                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5953                 </links>
5954                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5955                         <actions>
5956                                 <retrieve permission="VIEW_USER">
5957                                         <context link="usr" field="home_ou" />
5958                                 </retrieve>
5959                         </actions>
5960                 </permacrud>
5961         </class>
5962     <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">
5963         <fields oils_persist:primary="field">
5964             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
5965             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
5966             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
5967         </fields>
5968         <links/>
5969         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5970             <actions>
5971                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
5972                 <retrieve />
5973                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
5974                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
5975             </actions>
5976         </permacrud>
5977     </class>
5978         <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">
5979                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
5980                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5981                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5982                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5983                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
5984                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
5985                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5986                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
5987                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
5988                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
5989                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
5990                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
5991                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
5992                 </fields>
5993                 <links>
5994                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5995                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
5996                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
5997                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
5998                 </links>
5999         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6000             <actions>
6001                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6002                 <retrieve />
6003                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6004                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6005             </actions>
6006         </permacrud>
6007         </class>
6008         <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">
6009                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6010                         <field name="field" reporter:datatype="link"/>
6011                         <field name="id" reporter:datatype="id" />
6012                         <field name="source" reporter:datatype="link"/>
6013                         <field name="value"  reporter:datatype="text"/>
6014                 </fields>
6015                 <links>
6016                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6017                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6018                 </links>
6019         </class>
6020         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6021                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6022                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6023                         <field name="btype" reporter:datatype="text"/>
6024                         <field name="id" reporter:datatype="id" />
6025                         <field name="name"  reporter:datatype="text"/>
6026                         <field name="description" reporter:datatype="text"/>
6027                         <field name="owner" reporter:datatype="link"/>
6028                         <field name="pub" reporter:datatype="bool"/>
6029                         <field name="create_time" reporter:datatype="timestamp" />
6030                 </fields>
6031                 <links>
6032                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6033                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6034                 </links>
6035         </class>
6036         <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">
6037                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6038                         <field name="id" reporter:datatype="id" />
6039                         <field name="bucket" reporter:datatype="link"/>
6040                         <field name="note" reporter:datatype="text" />
6041                 </fields>
6042                 <links>
6043                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6044                 </links>
6045         </class>
6046         <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">
6047                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6048                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6049                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6050                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6051                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6052                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6053                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6054                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6055                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6056                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6057                 </fields>
6058                 <links>
6059                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6060                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6061                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6062                 </links>
6063         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6064             <actions>
6065                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6066                     <context link="xact" jump="usr" field="home_ou"/>
6067                 </retrieve>
6068                         </actions>
6069                 </permacrud>
6070         </class>
6071         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6072                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6073                         <field name="id" reporter:datatype="id" />
6074                         <field name="ind1" />
6075                         <field name="ind2" />
6076                         <field name="record" />
6077                         <field name="subfield" />
6078                         <field name="tag" />
6079                         <field name="value" />
6080                 </fields>
6081                 <links>
6082                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6083                 </links>
6084         </class>
6085         <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">
6086                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6087                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6088                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6089                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6090                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6091                 </fields>
6092                 <links>
6093                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6094                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6095                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6096                 </links>
6097         </class>
6098         <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">
6099                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6100                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6101                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6102                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6103                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6104                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6105                 </fields>
6106                 <links>
6107                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6108                 </links>
6109         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6110             <actions>
6111                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6112                 <retrieve/>
6113                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6114                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6115             </actions>
6116         </permacrud>
6117
6118         </class>
6119         <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">
6120                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6121                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6122                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6123                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6124                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6125                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6126                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6127                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6128                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6129                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6130                 </fields>
6131                 <links>
6132                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6133                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6134                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6135                 </links>
6136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6137             <actions>
6138                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6139                 <retrieve/>
6140                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6141                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6142             </actions>
6143         </permacrud>
6144         </class>
6145         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6146                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6147                         <field name="create_date" reporter:datatype="timestamp"/>
6148                         <field name="creator" reporter:datatype="link"/>
6149                         <field name="edit_date" reporter:datatype="timestamp"/>
6150                         <field name="editor" reporter:datatype="link"/>
6151                         <field name="id" reporter:datatype="id" />
6152                         <field name="pub" reporter:datatype="bool"/>
6153                         <field name="record" reporter:datatype="link"/>
6154                         <field name="value"  reporter:datatype="text"/>
6155                 </fields>
6156                 <links>
6157                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6158                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6159                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6160                 </links>
6161         </class>
6162         <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">
6163                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6164                         <field name="balance_owed" reporter:datatype="money" />
6165                         <field name="total_owed" reporter:datatype="money" />
6166                         <field name="total_paid" reporter:datatype="money" />
6167                         <field name="usr" reporter:datatype="link"/>
6168                 </fields>
6169                 <links>
6170                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6171                 </links>
6172         </class>
6173         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6174                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6175                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6176                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6177                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6178                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6179                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6180                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6181                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6182                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6183                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6184                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6185                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6186                 </fields>
6187                 <links>
6188                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6189                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6190                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6191                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6192                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6193                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6194                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6195                 </links>
6196         </class>
6197         <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">
6198                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6199                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6200                         <field name="quality" reporter:datatype="int" />
6201                         <field name="source" reporter:datatype="text"/>
6202                         <field name="transcendant" reporter:datatype="bool"/>
6203                         <field name="can_have_copies" reporter:datatype="bool"/>
6204                 </fields>
6205                 <links/>
6206         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6207             <actions>
6208                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6209                 <retrieve/>
6210                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6211                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6212             </actions>
6213         </permacrud>
6214         </class>
6215         <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">
6216                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6217                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6218                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6219                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6220                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6221                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6222                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6223                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6224                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6225                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6226                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6227                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6228                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6229                 </fields>
6230                 <links>
6231                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6232                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6233                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6234                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6235                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6236                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6237                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6238                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6239                 </links>
6240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6241                         <actions>
6242                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6243                                         <context link="usr" field="home_ou" />
6244                                 </retrieve>
6245                         </actions>
6246                 </permacrud>
6247         </class>
6248         <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">
6249                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6250                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6251                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6252                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6253                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6254                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6255                 </fields>
6256                 <links>
6257                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6258                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6259                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6260                 </links>
6261         </class>
6262         <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">
6263                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6264                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6265                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6266                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6267                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6268                 </fields>
6269                 <links>
6270                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6271                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6272                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6273                 </links>
6274         </class>
6275         <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">
6276                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6277                         <field name="bucket" reporter:datatype="link"/>
6278                         <field name="id" reporter:datatype="id" />
6279                         <field name="target_user" reporter:datatype="link"/>
6280                         <field name="create_time" reporter:datatype="timestamp" />
6281                         <field name="pos" reporter:datatype="int" />
6282                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6283                 </fields>
6284                 <links>
6285                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6286                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6287             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6288                 </links>
6289         </class>
6290         <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">
6291                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6292                         <field name="id" reporter:datatype="id" />
6293                         <field name="item" reporter:datatype="link"/>
6294                         <field name="note" reporter:datatype="text" />
6295                 </fields>
6296                 <links>
6297                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6298                 </links>
6299         </class>
6300         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6301                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6302                         <field name="balance_owed" reporter:datatype="money" />
6303                         <field name="total_owed" reporter:datatype="money" />
6304                         <field name="total_paid" reporter:datatype="money" />
6305                         <field name="usr" reporter:datatype="link"/>
6306                 </fields>
6307                 <links>
6308                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6309                 </links>
6310         </class>
6311         <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">
6312                 <fields oils_persist:primary="code" oils_persist:sequence="">
6313                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6314                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6315                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6316                 </fields>
6317                 <links/>
6318         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6319             <actions>
6320                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6321                 <retrieve/>
6322                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6323                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6324             </actions>
6325         </permacrud>
6326         </class>
6327         <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">
6328                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6329                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6330                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6331                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6332                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6333                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6334                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6335                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6336                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6337                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6338                 </fields>
6339                 <links>
6340                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6341                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6342                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6343                 </links>
6344         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6345             <actions>
6346                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6347                     <context link="xact" jump="usr" field="home_ou"/>
6348                 </retrieve>
6349                         </actions>
6350                 </permacrud>
6351         </class>
6352         <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">
6353                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6354                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6355                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6356                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6357                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6358                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6359                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6360                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6361                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6362                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6363                 </fields>
6364                 <links>
6365                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6366                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6367                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6368                 </links>
6369         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6370             <actions>
6371                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6372                     <context link="xact" jump="usr" field="home_ou"/>
6373                 </retrieve>
6374                         </actions>
6375                 </permacrud>
6376         </class>
6377         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6378                 <fields oils_persist:primary="id" oils_persist:sequence="">
6379                         <field name="checkin_lib" reporter:datatype="link"/>
6380                         <field name="checkin_staff" reporter:datatype="link"/>
6381                         <field name="checkin_time" reporter:datatype="timestamp"/>
6382                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6383                         <field name="circ_staff" reporter:datatype="link"/>
6384                         <field name="desk_renewal" reporter:datatype="bool"/>
6385                         <field name="due_date" reporter:datatype="timestamp"/>
6386                         <field name="duration" reporter:datatype="interval"/>
6387                         <field name="duration_rule" reporter:datatype="link"/>
6388                         <field name="fine_interval" reporter:datatype="interval"/>
6389                         <field name="id" reporter:datatype="id" />
6390                         <field name="max_fine" reporter:datatype="money" />
6391                         <field name="max_fine_rule" reporter:datatype="link"/>
6392                         <field name="opac_renewal" reporter:datatype="bool"/>
6393                         <field name="phone_renewal" reporter:datatype="bool"/>
6394                         <field name="recurring_fine" reporter:datatype="money" />
6395                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6396                         <field name="renewal_remaining" reporter:datatype="int" />
6397             <field name="grace_period" reporter:datatype="interval" />
6398                         <field name="stop_fines" reporter:datatype="text"/>
6399                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6400                         <field name="target_copy" reporter:datatype="link"/>
6401                         <field name="usr" reporter:datatype="link"/>
6402                         <field name="xact_finish" reporter:datatype="timestamp" />
6403                         <field name="xact_start" reporter:datatype="timestamp" />
6404                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6405                 </fields>
6406                 <links>
6407                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6408                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6409                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6410                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6411                 </links>
6412         </class>
6413         <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">
6414                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6415                         <field name="field" reporter:datatype="link"/>
6416                         <field name="id" reporter:datatype="id" />
6417                         <field name="source" reporter:datatype="link"/>
6418                         <field name="value" reporter:datatype="text"/>
6419                 </fields>
6420                 <links>
6421                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6422                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6423                 </links>
6424         </class>
6425         <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">
6426                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6427                         <field name="high" reporter:datatype="money" />
6428                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6429                         <field name="low" reporter:datatype="money" />
6430                         <field name="name" reporter:datatype="text"/>
6431                         <field name="normal" reporter:datatype="money" />
6432                         <field name="recurrence_interval" reporter:datatype="interval"/>
6433             <field name="grace_period" reporter:datatype="interval" />
6434                 </fields>
6435                 <links/>
6436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6437             <actions>
6438                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6439                 <retrieve/>
6440                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6441                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6442             </actions>
6443         </permacrud>
6444         </class>
6445         <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">
6446                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6447                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6448                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6449                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6450                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6451                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6452                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6453                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6454                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6455                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6456                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6457                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6458                 </fields>
6459                 <links>
6460                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6461                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6462                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6463                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6464                 </links>
6465         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6466             <actions>
6467                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6468                     <context link="xact" jump="usr" field="home_ou"/>
6469                 </retrieve>
6470                         </actions>
6471                 </permacrud>
6472         </class>
6473         <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">
6474                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6475                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6476                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6477                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6478                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6479                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6480                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6481                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6482                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6483                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6484                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6485                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6486                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6487                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6488                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6489                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6490                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6491                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6492                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6493                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6494                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6495                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6496                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6497                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6498                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6499                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6500                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6501                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6502                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6503                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6504                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6505                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6506                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6507                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6508                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6509                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6510                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6511                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6512                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6513                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6514                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6515                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6516                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6517                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6518                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6519                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6520                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6521                 </fields>
6522                 <links>
6523                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6524                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6525                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6526                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6527                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6528                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6529                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6530                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6531                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6532                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6533                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6534                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6535                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
6536                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
6537                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6538                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6539                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6540                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6541                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6542                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6543                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6544                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6545                 </links>
6546         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6547             <actions>
6548                 <create permission="CREATE_COPY">
6549                     <context link="call_number" field="owning_lib"/>
6550                 </create>
6551                 <retrieve/>
6552                 <update permission="UPDATE_COPY">
6553                     <context link="call_number" field="owning_lib"/>
6554                 </update>
6555                 <delete permission="DELETE_COPY">
6556                     <context link="call_number" field="owning_lib"/>
6557                 </delete>
6558             </actions>
6559         </permacrud>
6560         </class>
6561
6562         <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">
6563                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6564                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6565                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6566                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6567                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6568                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6569                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6570                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6571                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6572                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6573                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6574                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6575                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6576                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6577                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6578                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6579                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6580                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6581                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6582                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6583                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6584                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6585                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6586                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6587                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6588                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6589                 </fields>
6590                 <links>
6591                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6592                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6593                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6594                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6595                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6596                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6597                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6598                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6599                 </links>
6600                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6601                         <actions>
6602                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6603                                 <retrieve />
6604                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6605                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6606                         </actions>
6607                 </permacrud>
6608         </class>
6609
6610         <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">
6611                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6612                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6613                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6614                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6615                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6616                 </fields>
6617                 <links/>
6618         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6619             <actions>
6620                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6621                 <retrieve/>
6622                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6623                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6624             </actions>
6625         </permacrud>
6626         </class>
6627         <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">
6628                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6629                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6630                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6631                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6632                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6633                 </fields>
6634                 <links/>
6635         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6636             <actions>
6637                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6638                 <retrieve/>
6639                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6640                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6641             </actions>
6642         </permacrud>
6643         </class>
6644         <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">
6645                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6646                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6647                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6648                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6649                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6650                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6651                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6652                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6653                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6654                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6655                 </fields>
6656                 <links>
6657                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6658                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6659                 </links>
6660         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6661             <actions>
6662                 <create permission="CREATE_PERM" global_required="true"/>
6663                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6664                 <update permission="UPDATE_PERM" global_required="true"/>
6665                 <delete permission="DELETE_PERM" global_required="true"/>
6666             </actions>
6667         </permacrud>
6668         </class>
6669         <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">
6670                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6671                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6672                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
6673                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
6674                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
6675                 </fields>
6676                 <links>
6677                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
6678                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
6679                 </links>
6680         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6681             <actions>
6682                 <create permission="ADMIN_SURVEY">
6683                     <context link="question" jump="survey" field="owner"/>
6684                 </create>
6685                 <retrieve/>
6686                 <update permission="ADMIN_SURVEY">
6687                     <context link="question" jump="survey" field="owner"/>
6688                 </update>
6689                 <delete permission="ADMIN_SURVEY">
6690                     <context link="question" jump="survey" field="owner"/>
6691                 </delete>
6692             </actions>
6693         </permacrud>
6694         </class>
6695         <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">
6696                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
6697                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6698                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
6699                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
6700                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
6701                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
6702                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
6703                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
6704                 </fields>
6705                 <links>
6706                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
6707                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
6708                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
6709                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6710                 </links>
6711         </class>
6712         <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">
6713                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6714                         <field name="balance_owed" reporter:datatype="money" />
6715                         <field name="total_owed" reporter:datatype="money" />
6716                         <field name="total_paid" reporter:datatype="money" />
6717                         <field name="usr" reporter:datatype="link"/>
6718                 </fields>
6719                 <links>
6720                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6721                 </links>
6722         </class>
6723         <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">
6724                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
6725                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
6726                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
6727                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
6728                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
6729                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
6730                 </fields>
6731                 <links>
6732                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6733                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6734                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6735                 </links>
6736         </class>
6737         <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">
6738                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
6739                         <field name="field" reporter:datatype="link"/>
6740                         <field name="id" reporter:datatype="id" />
6741                         <field name="source" reporter:datatype="link"/>
6742                         <field name="value" reporter:datatype="text"/>
6743                 </fields>
6744                 <links>
6745                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6746                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6747                 </links>
6748         </class>
6749         <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">
6750                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
6751                         <field name="field" reporter:datatype="link"/>
6752                         <field name="id" reporter:datatype="id" />
6753                         <field name="source" reporter:datatype="link"/>
6754                         <field name="value" reporter:datatype="text"/>
6755                 </fields>
6756                 <links>
6757                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6758                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6759                 </links>
6760         </class>
6761         <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">
6762                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
6763                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6764                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
6765                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
6766                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
6767                 </fields>
6768                 <links>
6769                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
6770                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6771                 </links>
6772         </class>
6773         <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">
6774                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
6775                         <field name="depth" reporter:datatype="int" />
6776                         <field name="grantable" reporter:datatype="bool"/>
6777                         <field name="grp" reporter:datatype="link"/>
6778                         <field name="id" reporter:datatype="id" />
6779                         <field name="perm" reporter:datatype="link"/>
6780                 </fields>
6781                 <links>
6782                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
6783                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6784                 </links>
6785         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6786             <actions>
6787                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
6788                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
6789                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
6790                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
6791             </actions>
6792         </permacrud>
6793         </class>
6794         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
6795                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
6796                         <field name="items" oils_persist:virtual="true" />
6797                         <field name="btype" reporter:datatype="text"/>
6798                         <field name="id" reporter:datatype="id" />
6799                         <field name="name" reporter:datatype="text"/>
6800                         <field name="description" reporter:datatype="text"/>
6801                         <field name="owner" reporter:datatype="link"/>
6802                         <field name="pub" reporter:datatype="bool"/>
6803                         <field name="create_time" reporter:datatype="timestamp" />
6804                 </fields>
6805                 <links>
6806                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6807                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
6808                 </links>
6809         </class>
6810         <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">
6811                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
6812                         <field name="id" reporter:datatype="id" />
6813                         <field name="bucket" reporter:datatype="link"/>
6814                         <field name="note" reporter:datatype="text" />
6815                 </fields>
6816                 <links>
6817                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
6818                 </links>
6819         </class>
6820         <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">
6821                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
6822                         <field name="id" reporter:datatype="int" />
6823                         <field name="usr" reporter:datatype="link"/>
6824                         <field name="work_ou" reporter:datatype="link"/>
6825                 </fields>
6826                 <links>
6827                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6828                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
6829                 </links>
6830         </class>
6831         <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">
6832                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
6833                         <field name="depth" reporter:datatype="int"/>
6834                         <field name="grantable" reporter:datatype="bool"/>
6835                         <field name="id" reporter:datatype="id" />
6836                         <field name="perm" reporter:datatype="link"/>
6837                         <field name="usr" reporter:datatype="link"/>
6838                 </fields>
6839                 <links>
6840                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6841                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6842                 </links>
6843         </class>
6844         <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">
6845                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
6846                         <field name="object_id" reporter:datatype="text"/>
6847                         <field name="grantable" reporter:datatype="bool"/>
6848                         <field name="id" reporter:datatype="id" />
6849                         <field name="perm" reporter:datatype="link"/>
6850                         <field name="usr" reporter:datatype="link"/>
6851                         <field name="object_type" reporter:datatype="text"/>
6852                 </fields>
6853                 <links>
6854                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6855                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
6856                 </links>
6857         </class>
6858         <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">
6859                 <fields oils_persist:primary="id" oils_persist:sequence="">
6860                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6861                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6862                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6863                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6864                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6865                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6866                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6867                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6868                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6869                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6870                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6871                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6872                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6873                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6874                 </fields>
6875                 <links>
6876                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6877                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6878                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6879                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6880                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6881                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6882                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6883                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6884                 </links>
6885         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6886             <actions>
6887                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6888                     <context link="xact" jump="usr" field="home_ou"/>
6889                 </retrieve>
6890                         </actions>
6891                 </permacrud>
6892         </class>
6893         <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">
6894                 <fields oils_persist:primary="id" oils_persist:sequence="">
6895                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6896                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6897                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6898                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6899                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6900                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6901                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6902                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6903                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6904                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6905                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6906                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6907                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6908                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6909                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6910                 </fields>
6911                 <links>
6912                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6913                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6914                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6915                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6916                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6917                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6918                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6919                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6920                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6921                 </links>
6922         </class>
6923         <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">
6924                 <fields oils_persist:primary="id" oils_persist:sequence="">
6925                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6926                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6927                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6928                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6929                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6930                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6931                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6932                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6933                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6934                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6935                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6936                 </fields>
6937                 <links>
6938                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
6939                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
6940                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
6941                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
6942                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6943                 </links>
6944         </class>
6945         <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">
6946                 <fields oils_persist:primary="id" oils_persist:sequence="">
6947                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6948                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6949                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6950                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
6951                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
6952                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
6953                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
6954                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
6955                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
6956                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6957                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6958                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
6959                 </fields>
6960                 <links>
6961                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
6962                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
6963                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
6964                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6965                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6966                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6967                 </links>
6968         </class>
6969         <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">
6970                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
6971                         <field name="bucket" reporter:datatype="link"/>
6972                         <field name="id" reporter:datatype="id" />
6973                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
6974                         <field name="create_time" reporter:datatype="timestamp" />
6975                         <field name="pos" reporter:datatype="int" />
6976                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6977                 </fields>
6978                 <links>
6979                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
6980                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
6981             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
6982                 </links>
6983         </class>
6984         <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">
6985                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
6986                         <field name="id" reporter:datatype="id" />
6987                         <field name="item" reporter:datatype="link"/>
6988                         <field name="note" reporter:datatype="text" />
6989                 </fields>
6990                 <links>
6991                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
6992                 </links>
6993         </class>
6994         <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">
6995                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
6996                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
6997                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6998                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6999                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7000                 </fields>
7001                 <links>
7002                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7003                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7004                 </links>
7005         </class>
7006     <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">
7007         <fields oils_persist:primary="field">
7008             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7009             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7010             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7011         </fields>
7012         <links/>
7013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7014             <actions>
7015                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7016                 <retrieve />
7017                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7018                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7019             </actions>
7020         </permacrud>
7021     </class>
7022         <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">
7023                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7024                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7025                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7026                 </fields>
7027                 <links/>
7028         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7029             <actions>
7030                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7031                 <retrieve/>
7032                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7033                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7034             </actions>
7035         </permacrud>
7036         </class>
7037
7038
7039         <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">
7040                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7041                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7042                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7043                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7044                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7045                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7046                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7047                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7048                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7049                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7050                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7051                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7052                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7053                 </fields>
7054                 <links>
7055                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7056                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7057                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7058                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7059                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7060                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7061                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7062                 </links>
7063         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7064             <actions>
7065                 <create permission="TRANSIT_COPY">
7066                     <context link="target_copy" field="owner"/>
7067                 </create>
7068                 <retrieve/>
7069                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7070                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7071             </actions>
7072         </permacrud>
7073         </class>
7074         <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">
7075                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7076                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7077                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7078                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7079                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7080                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7081                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7082                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7083                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7084                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7085                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7086                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7087                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7088                 </fields>
7089                 <links>
7090                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7091                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7092                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7093                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7094                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7095                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7096                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7097                 </links>
7098         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7099             <actions>
7100                 <create permission="TRANSIT_COPY" context_field="owner">
7101                     <context link="target_copy" field="circ_lib"/>
7102                 </create>
7103                 <retrieve/>
7104                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7105                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7106             </actions>
7107         </permacrud>
7108         </class>
7109         <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">
7110                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7111                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7112                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7113                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7114                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7115                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7116                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7117                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7118                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7119                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7120                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7121                 </fields>
7122                 <links>
7123                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7124                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7125                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7126                 </links>
7127         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7128             <actions>
7129                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7130                     <context link="xact" jump="usr" field="home_ou"/>
7131                 </retrieve>
7132                         </actions>
7133                 </permacrud>
7134         </class>
7135         <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">
7136                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7137                         <field name="grp" />
7138                         <field name="id" reporter:datatype="id" />
7139                         <field name="usr" />
7140                 </fields>
7141                 <links>
7142                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7143                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7144                 </links>
7145         </class>
7146         <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">
7147                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7148                         <field name="id" reporter:datatype="id" />
7149                         <field name="fq_field" reporter:datatype="text"/>
7150                         <field name="identity_value" reporter:datatype="text"/>
7151                         <field name="translation" reporter:datatype="text"/>
7152                         <field name="string" reporter:datatype="text"/>
7153                 </fields>
7154                 <links>
7155                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7156                 </links>
7157         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7158             <actions>
7159                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7160                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7161                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7162                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7163             </actions>
7164         </permacrud>
7165         </class>
7166         <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">
7167                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7168                         <field name="id" reporter:datatype="id" />
7169                         <field name="fm_class" reporter:datatype="text"/>
7170                         <field name="field" reporter:datatype="text"/>
7171                         <field name="owner" reporter:datatype="org_unit"/>
7172                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7173                 </fields>
7174                 <links>
7175                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7176                 </links>
7177         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7178             <actions>
7179                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7180                 <retrieve/>
7181                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7182                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7183             </actions>
7184         </permacrud>
7185         </class>
7186         <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">
7187                 <fields oils_persist:primary="code">
7188                         <field name="code" reporter:datatype="id" />
7189                         <field name="marc_code" reporter:datatype="text"/>
7190                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7191                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7192                 </fields>
7193                 <links/>
7194         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7195             <actions>
7196                 <create permission="CREATE_LOCALE" global_required="true"/>
7197                 <retrieve/>
7198                 <update permission="UPDATE_LOCALE" global_required="true"/>
7199                 <delete permission="DELETE_LOCALE" global_required="true"/>
7200             </actions>
7201         </permacrud>
7202         </class>
7203         <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">
7204                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7205                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7206                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7207                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7208             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7209                 </fields>
7210                 <links>
7211                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7212                 </links>
7213         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7214             <actions>
7215                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7216                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7217                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7218                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7219             </actions>
7220         </permacrud>
7221         </class>
7222
7223         <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">
7224                 <fields oils_persist:primary="id">
7225                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7226                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7227                 </fields>
7228                 <links/>
7229         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7230             <actions>
7231                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7232                 <retrieve/>
7233                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7234                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7235             </actions>
7236         </permacrud>
7237         </class>
7238
7239         <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">
7240                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7241                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7242                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7243                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7244                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7245                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7246                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7247                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7248                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7249                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7250                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7251                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7252                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7253                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7254                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7255                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7256                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7257                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7258                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7259                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7260                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7261                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7262                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7263                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7264                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7265                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7266                 </fields>
7267                 <links>
7268                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7269                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7270                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7271                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7272                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7273                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7274                 </links>
7275         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7276             <actions>
7277                 <create permission="user_request.create">
7278                     <context link="usr" field="home_ou"/>
7279                                 </create>
7280                 <retrieve permission="user_request.view">
7281                     <context link="usr" field="home_ou"/>
7282                                 </retrieve>
7283                 <update permission="user_request.update">
7284                     <context link="usr" field="home_ou"/>
7285                                 </update>
7286                 <delete permission="user_request.delete">
7287                     <context link="usr" field="home_ou"/>
7288                                 </delete>
7289             </actions>
7290         </permacrud>
7291         </class>
7292
7293         <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">
7294                 <fields oils_persist:primary="code">
7295                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7296                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7297                 </fields>
7298                 <links/>
7299         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7300             <actions>
7301                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7302                 <retrieve/>
7303                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7304                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7305             </actions>
7306         </permacrud>
7307         </class>
7308
7309         <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">
7310                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7311                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7312                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7313                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7314                         <field reporter:label="Ratio" name="ratio" />
7315                 </fields>
7316                 <links>
7317                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7318                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7319                 </links>
7320                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7321                         <actions>
7322                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7323                                 <retrieve/>
7324                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7325                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7326                         </actions>
7327                 </permacrud>
7328         </class>
7329
7330         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7331                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7332                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7333                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7334                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7335                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7336                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7337                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7338                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7339                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7340                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7341                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7342                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7343                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7344                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7345                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7346                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7347                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7348                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7349                 </fields>
7350                 <links>
7351                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7352                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7353             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7354             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7355             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7356                 </links>
7357         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7358             <actions>
7359                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7360                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7361                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7362                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7363             </actions>
7364         </permacrud>
7365         </class>
7366
7367         <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">
7368                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7369                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7370                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7371                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7372                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7373                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7374                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7375                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7376                 </fields>
7377                 <links>
7378                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7379                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7380                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7381                 </links>
7382         </class>
7383
7384         <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">
7385                 <fields oils_persist:primary="code">
7386                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7387                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7388                 </fields>
7389                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7390             <actions>
7391                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7392                 <retrieve/>
7393                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7394                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7395             </actions>
7396                 </permacrud>
7397         </class>
7398
7399         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7400                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7401                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7402                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7403                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7404                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7405                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7406                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7407                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7408                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7409                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7410                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7411                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7412                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7413                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7414                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7415                 </fields>
7416                 <links>
7417                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7418                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7419                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7420                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7421                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7422                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7423                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7424                 </links>
7425         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7426             <actions>
7427                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7428                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7429                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7430                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7431             </actions>
7432         </permacrud>
7433         </class>
7434
7435         <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">
7436                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7437                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7438                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7439                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7440                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7441                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7442                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7443                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7444                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7445                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7446                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7447                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7448                 </fields>
7449                 <links>
7450                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7451                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7452                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7453                 </links>
7454         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7455             <actions>
7456                 <create   permission="ADMIN_INVOICE">
7457                                         <context link="invoice" field="receiver"/>
7458                                 </create>
7459                 <retrieve permission="ADMIN_INVOICE">
7460                                         <context link="invoice" field="receiver"/>
7461                                 </retrieve>
7462                 <update   permission="ADMIN_INVOICE">
7463                                         <context link="invoice" field="receiver"/>
7464                                 </update>
7465                                 <delete   permission="ADMIN_INVOICE">
7466                                         <context link="invoice" field="receiver"/>
7467                                 </delete>
7468             </actions>
7469         </permacrud>
7470         </class>
7471
7472         <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">
7473                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7474                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7475                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7476                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7477                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7478                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7479                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7480                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7481                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7482                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7483                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7484                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7485                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7486                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7487                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7488                 </fields>
7489                 <links>
7490                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7491                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7492                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7493                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7494                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7495                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7496                 </links>
7497         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7498             <actions>
7499                 <create   permission="ADMIN_INVOICE">
7500                                         <context link="invoice" field="receiver"/>
7501                                 </create>
7502                 <retrieve permission="ADMIN_INVOICE">
7503                                         <context link="invoice" field="receiver"/>
7504                                 </retrieve>
7505                 <update   permission="ADMIN_INVOICE">
7506                                         <context link="invoice" field="receiver"/>
7507                                 </update>
7508                                 <delete   permission="ADMIN_INVOICE">
7509                                         <context link="invoice" field="receiver"/>
7510                                 </delete>
7511             </actions>
7512         </permacrud>
7513         </class>
7514
7515         <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">
7516                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7517                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7518                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7519                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7520                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7521                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7522                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7523                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7524                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7525                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7526                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7527                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7528                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7529                 </fields>
7530                 <links>
7531                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7532                 </links>
7533         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7534             <actions>
7535                 <create permission="ADMIN_PROVIDER">
7536                     <context link="provider" field="owner"/>
7537                 </create>
7538                 <retrieve permission="ADMIN_PROVIDER">
7539                     <context link="provider" field="owner"/>
7540                 </retrieve>
7541                 <update permission="ADMIN_PROVIDER">
7542                     <context link="provider" field="owner"/>
7543                 </update>
7544                 <delete permission="ADMIN_PROVIDER">
7545                     <context link="provider" field="owner"/>
7546                 </delete>
7547             </actions>
7548         </permacrud>
7549         </class>
7550
7551         <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">
7552                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7553                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7554                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7555                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7556                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7557                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7558                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7559         </fields>
7560                 <links>
7561                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7562                 </links>
7563         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7564             <actions>
7565                 <create permission="ADMIN_PROVIDER">
7566                     <context link="provider" field="owner"/>
7567                 </create>
7568                 <retrieve permission="ADMIN_PROVIDER">
7569                     <context link="provider" field="owner"/>
7570                 </retrieve>
7571                 <update permission="ADMIN_PROVIDER">
7572                     <context link="provider" field="owner"/>
7573                 </update>
7574                 <delete permission="ADMIN_PROVIDER">
7575                     <context link="provider" field="owner"/>
7576                 </delete>
7577             </actions>
7578         </permacrud>
7579     </class>
7580         <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">
7581                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7582                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7583                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7584                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7585                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7586                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7587                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7588                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7589                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7590                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7591                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7592                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7593                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7594                 </fields>
7595                 <links>
7596                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7597                 </links>
7598         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7599             <actions>
7600                 <create permission="ADMIN_PROVIDER">
7601                     <context link="contact" jump='provider' field="owner"/>
7602                 </create>
7603                 <retrieve permission="ADMIN_PROVIDER">
7604                     <context link="contact" jump='provider' field="owner"/>
7605                 </retrieve>
7606                 <update permission="ADMIN_PROVIDER">
7607                     <context link="contact" jump='provider' field="owner"/>
7608                 </update>
7609                 <delete permission="ADMIN_PROVIDER">
7610                     <context link="contact" jump='provider' field="owner"/>
7611                 </delete>
7612             </actions>
7613         </permacrud>
7614         </class>
7615
7616         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7617                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7618                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7619                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7620                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7621                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7622                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7623                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7624                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7625                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7626                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7627                 </fields>
7628                 <links>
7629                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7630                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7631                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7632                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7633                 </links>
7634         </class>
7635
7636         <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">
7637                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7638                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7639                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7640                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7641                 </fields>
7642                 <links>
7643             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7644                 </links>
7645                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7646                         <actions>
7647                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7648                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7649                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7650                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7651                         </actions>
7652                 </permacrud>
7653         </class>
7654
7655         <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">
7656                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
7657                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
7658                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
7659                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
7660                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
7661                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
7662                 </fields>
7663                 <links>
7664                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7665                 </links>
7666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7667                         <actions>
7668                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7669                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7670                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7671                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7672                         </actions>
7673                 </permacrud>
7674         </class>
7675
7676         <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">
7677                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
7678                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7679                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7680                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7681                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7682                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7683                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7684                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7685                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
7686                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7687                 </fields>
7688                 <links>
7689                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7690                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7691             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
7692             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
7693                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
7694                 </links>
7695         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7696             <actions>
7697                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7698                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
7699                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7700                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
7701             </actions>
7702         </permacrud>
7703         </class>
7704
7705         <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">
7706                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
7707                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
7708                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
7709                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7710                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7711                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
7712                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
7713                 </fields>
7714                 <links>
7715                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7716                 </links>
7717                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7718                         <actions>
7719                                 <create permission="ADMIN_FUNDING_SOURCE">
7720                     <context link="funding_source" field="owner"/>
7721                 </create>
7722                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
7723                     <context link="funding_source" field="owner"/>
7724                 </retrieve>
7725                                 <update permission="ADMIN_FUNDING_SOURCE">
7726                     <context link="funding_source" field="owner"/>
7727                 </update>
7728                                 <delete permission="ADMIN_FUNDING_SOURCE">
7729                     <context link="funding_source" field="owner"/>
7730                 </delete>
7731                         </actions>
7732                 </permacrud>
7733         </class>
7734
7735         <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">
7736                 <fields oils_persist:primary="id">
7737                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
7738                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
7739                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
7740                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
7741                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
7742                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7743                 </fields>
7744                 <links>
7745                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7746                 </links>
7747         </class>
7748
7749         <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">
7750                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
7751                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
7752                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7753                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
7754                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
7755                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7756                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
7757                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
7758                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
7759                 </fields>
7760                 <links>
7761                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7762                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7763                 </links>
7764                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7765                         <actions>
7766                                 <create permission="ADMIN_ACQ_FUND">
7767                     <context link="fund" field="org"/>
7768                 </create>
7769                                 <retrieve permission="ADMIN_ACQ_FUND">
7770                     <context link="fund" field="org"/>
7771                 </retrieve>
7772                                 <update permission="ADMIN_ACQ_FUND">
7773                     <context link="fund" field="org"/>
7774                 </update>
7775                                 <delete permission="ADMIN_ACQ_FUND">
7776                     <context link="fund" field="org"/>
7777                 </delete>
7778                         </actions>
7779                 </permacrud>
7780         </class>
7781
7782         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
7783                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
7784                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7785                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
7786                         <field reporter:label="Name" name="name" reporter:datatype="text" />
7787                         <field reporter:label="Year" name="year" reporter:datatype="int" />
7788                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
7789                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7790                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
7791                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
7792                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7793                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
7794                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
7795                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
7796                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
7797                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
7798                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7799                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
7800                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
7801                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
7802                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
7803                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7804                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
7805                 </fields>
7806                 <links>
7807                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
7808                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7809             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
7810             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
7811             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
7812             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
7813             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
7814             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
7815             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
7816             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
7817             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
7818                 </links>
7819         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
7820             <actions>
7821                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
7822                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
7823                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
7824                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
7825             </actions>
7826         </permacrud>
7827         </class>
7828
7829         <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">
7830                 <fields oils_persist:primary="fund">
7831                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7832                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7833                 </fields>
7834                 <links>
7835                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7836                 </links>
7837         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7838             <actions>
7839                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7840                                         <context link="fund" field="org" />
7841                 </retrieve>
7842             </actions>
7843         </permacrud>
7844         </class>
7845
7846         <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">
7847                 <fields oils_persist:primary="fund">
7848                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7849                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
7850                 </fields>
7851                 <links>
7852                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7853                 </links>
7854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7855             <actions>
7856                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7857                                         <context link="fund" field="org" />
7858                 </retrieve>
7859             </actions>
7860         </permacrud>
7861         </class>
7862
7863         <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">
7864                 <fields oils_persist:primary="fund">
7865                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7866                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
7867                 </fields>
7868                 <links>
7869                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7870                 </links>
7871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7872             <actions>
7873                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7874                                         <context link="fund" field="org" />
7875                 </retrieve>
7876             </actions>
7877         </permacrud>
7878         </class>
7879
7880         <class id="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">
7881                 <fields oils_persist:primary="fund">
7882                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7883                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7884                 </fields>
7885                 <links>
7886                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7887                 </links>
7888         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7889             <actions>
7890                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7891                                         <context link="fund" field="org" />
7892                 </retrieve>
7893             </actions>
7894         </permacrud>
7895         </class>
7896
7897         <class id="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">
7898                 <fields oils_persist:primary="fund">
7899                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7900                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
7901                 </fields>
7902                 <links>
7903                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7904                 </links>
7905         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7906             <actions>
7907                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
7908                                         <context link="fund" field="org" />
7909                 </retrieve>
7910             </actions>
7911         </permacrud>
7912         </class>
7913
7914    <class id="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">
7915         <fields oils_persist:primary="fund">
7916             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7917             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
7918         </fields>
7919         <links>
7920             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7921         </links>
7922     </class>
7923
7924    <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">
7925         <fields oils_persist:primary="fund">
7926             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7927             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
7928         </fields>
7929         <links>
7930             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7931         </links>
7932     </class>
7933
7934    <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">
7935         <fields oils_persist:primary="fund">
7936             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7937             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
7938         </fields>
7939         <links>
7940             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7941         </links>
7942     </class>
7943
7944    <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">
7945         <fields oils_persist:primary="fund">
7946             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7947             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
7948         </fields>
7949         <links>
7950             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7951         </links>
7952     </class>
7953
7954    <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">
7955         <fields oils_persist:primary="fund">
7956             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7957             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
7958         </fields>
7959         <links>
7960             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7961         </links>
7962     </class>
7963
7964         <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">
7965                 <fields oils_persist:primary="funding_source">
7966                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7967                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
7968                 </fields>
7969                 <links>
7970                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7971                 </links>
7972         </class>
7973
7974         <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">
7975                 <fields oils_persist:primary="funding_source">
7976                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7977                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
7978                 </fields>
7979                 <links>
7980                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7981                 </links>
7982         </class>
7983
7984         <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">
7985                 <fields oils_persist:primary="funding_source">
7986                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
7987                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
7988                 </fields>
7989                 <links>
7990                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
7991                 </links>
7992         </class>
7993
7994         <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">
7995                 <fields oils_persist:primary="fund">
7996                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
7997                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
7998                 </fields>
7999                 <links>
8000                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8001                 </links>
8002         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8003             <actions>
8004                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8005                                         <context link="fund" field="org" />
8006                 </retrieve>
8007             </actions>
8008         </permacrud>
8009     </class>
8010     <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">
8011         <oils_persist:source_definition><![CDATA[
8012             SELECT
8013                 acqf.*,
8014                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8015                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8016                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8017                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8018             FROM
8019                 acq.fund acqf
8020                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8021                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8022                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8023                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8024         ]]></oils_persist:source_definition>
8025         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8026             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8027             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8028             <field reporter:label="Name" name="name" reporter:datatype="text" />
8029             <field reporter:label="Year" name="year" reporter:datatype="int" />
8030             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8031             <field reporter:label="Code" name="code" reporter:datatype="text" />
8032             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8033             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8034             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8035             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8036             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8037
8038             <!-- non fund-native fields -->
8039             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8040             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8041             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8042             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8043         </fields>
8044         <links>
8045             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8046             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8047             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8048         </links>
8049         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8050             <actions>
8051                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8052             </actions>
8053         </permacrud>
8054         </class>
8055         <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">
8056                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8057                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8058                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8059                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8060                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8061                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8062                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8063                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8064                 </fields>
8065                 <links>
8066                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8067                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8068                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8069                 </links>
8070                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8071                         <actions>
8072                                 <create permission="ADMIN_ACQ_FUND">
8073                     <context link="fund" field="org"/>
8074                 </create>
8075                                 <retrieve permission="ADMIN_ACQ_FUND">
8076                     <context link="fund" field="org"/>
8077                 </retrieve>
8078                                 <update permission="ADMIN_ACQ_FUND">
8079                     <context link="fund" field="org"/>
8080                 </update>
8081                                 <delete permission="ADMIN_ACQ_FUND">
8082                     <context link="fund" field="org"/>
8083                 </delete>
8084                         </actions>
8085                 </permacrud>
8086         </class>
8087
8088     <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">
8089         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8090             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8091             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8092             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8093             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8094             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8095             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8096             <field reporter:label="Note" name="note" reporter:datatype="text" />
8097             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8098         </fields>
8099         <links>
8100             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8101             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8102             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8103         </links>
8104                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8105                         <actions>
8106                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8107                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8108                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8109                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8110                         </actions>
8111                 </permacrud>
8112     </class>
8113
8114         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8115                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8116                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8117                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8118                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8119                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8120                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8121                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8122                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8123                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8124                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8125                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8126                 </fields>
8127                 <links>
8128                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8129                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8130                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8131                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8132                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8133                 </links>
8134                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8135                         <actions>
8136                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8137                         </actions>
8138                 </permacrud>
8139         </class>
8140
8141         <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">
8142                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8143                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8144                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8145                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8146                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8147                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8148                 </fields>
8149                 <links>
8150                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8151                 </links>
8152                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8153                         <actions>
8154                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8155                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8156                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8157                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8158                         </actions>
8159                 </permacrud>
8160         </class>
8161
8162         <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">
8163                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8164                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8165                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8166                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8167                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8168                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8169                         <field reporter:label="State" name="state" reporter:datatype="text" />
8170                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8171                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8172                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8173                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8174                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8175                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8176                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8177                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8178                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8179                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8180                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8181                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8182                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8183                 </fields>
8184                 <links>
8185                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8186                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8187                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8188                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8189                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8190                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8191                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8192                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8193                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8194                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8195                 </links>
8196                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8197                         <actions>
8198                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8199                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8200                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8201                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8202                         </actions>
8203                 </permacrud>
8204         </class>
8205
8206         <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">
8207                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8208                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8209                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8210                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8211                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8212                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8213                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8214                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8215                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8216                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8217                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8218                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8219                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8220                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8221                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8222                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8223                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8224                 </fields>
8225                 <links>
8226                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8227                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8228                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8229                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8230                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8231                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8232                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8233                 </links>
8234                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8235             <actions>
8236                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8237             </actions>
8238                 </permacrud>
8239         </class>
8240
8241         <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">
8242                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8243                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8244                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8245                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8246                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8247                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8248                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8249                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8250                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8251                 </fields>
8252                 <links>
8253                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8254                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8255                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8256                 </links>
8257                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8258             <actions>
8259                 <create permission="CREATE_PURCHASE_ORDER">
8260                     <context link="purchase_order" field="ordering_agency"/>
8261                 </create>
8262                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8263                     <context link="purchase_order" field="ordering_agency"/>
8264                 </retrieve>
8265                 <update permission="CREATE_PURCHASE_ORDER">
8266                     <context link="purchase_order" field="ordering_agency"/>
8267                 </update>
8268                 <delete permission="CREATE_PURCHASE_ORDER">
8269                     <context link="purchase_order" field="ordering_agency"/>
8270                 </delete>
8271             </actions>
8272                 </permacrud>
8273         </class>
8274
8275         <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">
8276                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8277                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8278                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8279                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8280                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8281                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8282                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8283                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8284                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8285                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8286                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8287                 </fields>
8288                 <links>
8289                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8290                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8291                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8292                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8293                 </links>
8294                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8295             <actions>
8296                 <create permission="CREATE_PURCHASE_ORDER">
8297                     <context link="purchase_order" field="ordering_agency"/>
8298                 </create>
8299                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8300                     <context link="purchase_order" field="ordering_agency"/>
8301                 </retrieve>
8302                 <update permission="CREATE_PURCHASE_ORDER">
8303                     <context link="purchase_order" field="ordering_agency"/>
8304                 </update>
8305                 <delete permission="CREATE_PURCHASE_ORDER">
8306                     <context link="purchase_order" field="ordering_agency"/>
8307                 </delete>
8308             </actions>
8309                 </permacrud>
8310         </class>
8311
8312         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8313                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8314                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8315                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8316                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8317                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8318                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8319                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8320                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8321                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8322                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8323                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8324                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8325                         <field reporter:label="State" name="state" reporter:datatype="text" />
8326                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8327                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8328                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8329                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8330                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8331                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8332                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8333                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8334                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8335                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8336                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8337                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8338                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8339                 </fields>
8340                 <links>
8341                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8342                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8343                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8344                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8345                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8346                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8347                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8348                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8349                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8350                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8351                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8352                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8353                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8354                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8355                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8356                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8357                 </links>
8358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8359                         <actions>
8360                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8361                                         <context link="purchase_order" field="ordering_agency"/>
8362                                         <context link="picklist" field="org_unit"/>
8363                                 </retrieve>
8364                         </actions>
8365                 </permacrud>
8366         </class>
8367
8368         <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">
8369                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8370                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8371                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8372                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8373                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8374                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8375                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8376                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8377                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8378                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8379                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8380                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8381                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8382                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8383                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8384                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8385                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8386                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8387                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8388                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8389                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8390                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8391                 </fields>
8392                 <links>
8393                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8394                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8395                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8396                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8397                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8398                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8399                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8400                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8401                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8402                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8403                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8404                 </links>
8405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8406                         <actions>
8407                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8408                                         <context link="purchase_order" field="ordering_agency"/>
8409                                         <context link="picklist" field="org_unit"/>
8410                                 </retrieve>
8411                         </actions>
8412                 </permacrud>
8413         </class>
8414
8415         <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">
8416                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8417                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8418                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8419                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8420                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8421                 </fields>
8422                 <links>
8423                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8424                 </links>
8425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8426                         <actions>
8427                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8428                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8429                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8430                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8431                         </actions>
8432                 </permacrud>
8433         </class>
8434
8435         <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">
8436                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8437                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8438                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8439                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8440                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8441                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8442                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8443                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8444                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8445                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8446                 </fields>
8447                 <links>
8448                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8449                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8450                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8451                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8452                 </links>
8453         </class>
8454
8455         <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">
8456                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8457                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8458                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8459                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8460                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8461                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8462                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8463                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8464                 </fields>
8465                 <links>
8466                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8467                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8468                 </links>
8469         </class>
8470
8471         <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">
8472                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8473                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8474                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8475                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8476                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8477                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8478                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8479                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8480                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8481                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8482                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8483                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8484                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8485                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8486                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8487                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8488                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8489                 </fields>
8490                 <links>
8491                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8492                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8493                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8494                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8495                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8496                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8497                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8498                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8499                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8500                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8501                 </links>
8502         </class>
8503
8504         <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">
8505                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8506                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8507                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8508                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8509                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8510                 </fields>
8511                 <links/>
8512                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8513                         <actions>
8514                                 <retrieve />
8515                         </actions>
8516                 </permacrud>
8517         </class>
8518
8519         <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">
8520                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8521                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8522                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8523                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8524                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8525                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8526             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8527                 </fields>
8528                 <links/>
8529         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8530             <actions>
8531                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8532                 <retrieve />
8533                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8534                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8535             </actions>
8536         </permacrud>
8537         </class>
8538
8539         <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">
8540                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8541                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8542                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8543                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8544                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8545                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8546                 </fields>
8547                 <links/>
8548         </class>
8549         <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">
8550                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8551                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8552                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8553                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8554                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8555                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8556                 </fields>
8557                 <links>
8558                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8559                 </links>
8560         </class>
8561
8562         <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">
8563             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8564                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8565                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8566                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8567                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8568                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8569                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8570         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8571
8572             </fields>
8573             <links>
8574                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8575             </links>
8576             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8577                 <actions>
8578                     <create permission="ADMIN_PROVIDER">
8579                         <context link="provider" field="owner"/>
8580                     </create>
8581                     <retrieve permission="ADMIN_PROVIDER">
8582                         <context link="provider" field="owner"/>
8583                     </retrieve>
8584                     <update permission="ADMIN_PROVIDER">
8585                         <context link="provider" field="owner"/>
8586                     </update>
8587                     <delete permission="ADMIN_PROVIDER">
8588                         <context link="provider" field="owner"/>
8589                     </delete>
8590                 </actions>
8591             </permacrud>
8592         </class>
8593         
8594         <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">
8595             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8596                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8597                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8598                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8599                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8600             </fields>
8601             <links>
8602                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8603             </links>
8604             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8605                 <actions>
8606                     <create permission="ADMIN_PROVIDER">
8607                         <context link="provider" field="owner"/>
8608                     </create>
8609                     <retrieve permission="ADMIN_PROVIDER">
8610                         <context link="provider" field="owner"/>
8611                     </retrieve>
8612                     <update permission="ADMIN_PROVIDER">
8613                         <context link="provider" field="owner"/>
8614                     </update>
8615                     <delete permission="ADMIN_PROVIDER">
8616                         <context link="provider" field="owner"/>
8617                     </delete>
8618                 </actions>
8619             </permacrud>
8620         </class>
8621         
8622         <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">
8623             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8624                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8625                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8626                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8627                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8628                 </fields>
8629                 <links/>
8630         </class>
8631
8632         <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">
8633                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8634                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8635                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8636                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8637                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8638                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8639                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8640                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8641                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8642                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8643                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8644                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8645                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8646                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8647                 </fields>
8648                 <links>
8649                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8650                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8651                 </links>
8652         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8653             <actions>
8654                 <create permission="ADMIN_PROVIDER">
8655                     <context link="provider" field="owner"/>
8656                 </create>
8657                 <retrieve permission="ADMIN_PROVIDER">
8658                     <context link="provider" field="owner"/>
8659                 </retrieve>
8660                 <update permission="ADMIN_PROVIDER">
8661                     <context link="provider" field="owner"/>
8662                 </update>
8663                 <delete permission="ADMIN_PROVIDER">
8664                     <context link="provider" field="owner"/>
8665                 </delete>
8666             </actions>
8667         </permacrud>
8668         </class>
8669
8670         <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">
8671                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
8672                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
8673                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
8674                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
8675                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
8676                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
8677                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
8678                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
8679                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
8680                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
8681                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
8682                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
8683                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
8684                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
8685                 </fields>
8686                 <links>
8687                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
8688                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8689                 </links>
8690         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8691             <actions>
8692                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8693                     <context link="account" jump="provider" field="owner"/>
8694                 </retrieve>
8695                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8696                     <context link="account" jump="provider" field="owner"/>
8697                 </update>
8698                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
8699                     <context link="account" jump="provider" field="owner"/>
8700                 </delete>
8701             </actions>
8702         </permacrud>
8703         </class>
8704
8705
8706         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
8707                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
8708                         <field name="id" reporter:datatype="id" />
8709                         <field name="parent" reporter:datatype="link"/>
8710                         <field name="owner" reporter:datatype="link"/>
8711                         <field name="create_time" reporter:datatype="timestamp"/>
8712                         <field name="name" reporter:datatype="text"/>
8713                         <field name="shared" reporter:datatype="bool"/>
8714                         <field name="share_with" reporter:datatype="link"/>
8715                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8716                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
8717                 </fields>
8718                 <links>
8719                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8720                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
8721                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
8722                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8723                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
8724                 </links>
8725         </class>
8726         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
8727                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
8728                         <field name="id" reporter:datatype="id" />
8729                         <field name="parent" reporter:datatype="link"/>
8730                         <field name="owner" reporter:datatype="link"/>
8731                         <field name="create_time" reporter:datatype="timestamp"/>
8732                         <field name="name" reporter:datatype="text"/>
8733                         <field name="shared" reporter:datatype="bool"/>
8734                         <field name="share_with" reporter:datatype="link"/>
8735                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8736                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
8737                 </fields>
8738                 <links>
8739                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8740                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
8741                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
8742                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8743                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
8744                 </links>
8745         </class>
8746         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
8747                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
8748                         <field name="id" reporter:datatype="id" />
8749                         <field name="parent" reporter:datatype="link"/>
8750                         <field name="owner" reporter:datatype="link"/>
8751                         <field name="create_time" reporter:datatype="timestamp"/>
8752                         <field name="name" reporter:datatype="text"/>
8753                         <field name="shared" reporter:datatype="bool"/>
8754                         <field name="share_with" reporter:datatype="link"/>
8755                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8756                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8757                 </fields>
8758                 <links>
8759                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8760                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
8761                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
8762                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
8763                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
8764                 </links>
8765         </class>
8766         <class id="rt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
8767                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
8768                         <field name="id" reporter:datatype="id" />
8769                         <field name="owner" reporter:datatype="link"/>
8770                         <field name="create_time" reporter:datatype="timestamp"/>
8771                         <field name="name" reporter:datatype="text"/>
8772                         <field name="data" reporter:datatype="text"/>
8773                         <field name="folder" reporter:datatype="link"/>
8774                         <field name="description" reporter:datatype="text"/>
8775                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
8776                 </fields>
8777                 <links>
8778                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8779                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
8780                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
8781                 </links>
8782         </class>
8783         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
8784                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
8785                         <field name="id" reporter:datatype="id" />
8786                         <field name="owner" reporter:datatype="link"/>
8787                         <field name="create_time" reporter:datatype="timestamp"/>
8788                         <field name="template" reporter:datatype="link"/>
8789                         <field name="data" reporter:datatype="text"/>
8790                         <field name="folder" reporter:datatype="link"/>
8791                         <field name="recur" reporter:datatype="bool"/>
8792                         <field name="recurrence" reporter:datatype="interval"/>
8793                         <field name="name" reporter:datatype="text"/>
8794                         <field name="description" reporter:datatype="text"/>
8795                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
8796                 </fields>
8797                 <links>
8798                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8799                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
8800                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
8801                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
8802                 </links>
8803         </class>
8804         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
8805                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
8806                         <field name="id" reporter:datatype="id" />
8807                         <field name="runner" reporter:datatype="link"/>
8808                         <field name="start_time" reporter:datatype="timestamp"/>
8809                         <field name="complete_time" reporter:datatype="timestamp"/>
8810                         <field name="run_time" reporter:datatype="timestamp"/>
8811                         <field name="email" reporter:datatype="text"/>
8812                         <field name="excel_format" reporter:datatype="bool"/>
8813                         <field name="csv_format" reporter:datatype="bool"/>
8814                         <field name="html_format" reporter:datatype="bool"/>
8815                         <field name="error_code" reporter:datatype="int"/>
8816                         <field name="error_text" reporter:datatype="text"/>
8817                         <field name="report" reporter:datatype="link"/>
8818                         <field name="folder" reporter:datatype="link"/>
8819                         <field name="chart_pie" reporter:datatype="bool"/>
8820                         <field name="chart_bar" reporter:datatype="bool"/>
8821                         <field name="chart_line" reporter:datatype="bool"/>
8822                 </fields>
8823                 <links>
8824                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
8825                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
8826                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
8827                 </links>
8828         </class>
8829         <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">
8830                 <fields oils_persist:primary="id">
8831                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8832                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8833                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8834                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8835                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8836                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8837                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8838                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8839                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8840                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8841                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8842                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8843                 </fields>
8844                 <links>
8845                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8846                 </links>
8847                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8848                         <actions>
8849                                 <retrieve />
8850                         </actions>
8851                 </permacrud>
8852         </class>
8853         <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">
8854                 <fields oils_persist:primary="id">
8855                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8856                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
8857                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8858                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8859                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8860                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8861                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8862                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8863                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8864                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8865                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8866                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8867                 </fields>
8868                 <links>
8869                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8870                 </links>
8871         </class>
8872         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
8873                 <fields oils_persist:primary="id">
8874                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8875                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
8876                         <field reporter:label="Fingerprint" name="fingerprint" />
8877                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
8878                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
8879                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
8880                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
8881                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
8882                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
8883                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
8884                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
8885                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
8886                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
8887                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
8888                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
8889                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
8890                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
8891                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
8892                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
8893                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
8894                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
8895                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
8896                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
8897                 </fields>
8898                 <links>
8899                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
8900                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
8901                 </links>
8902         </class>
8903         <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">
8904                 <fields oils_persist:primary="id">
8905                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
8906                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
8907                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
8908                 </fields>
8909                 <links>
8910                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
8911                 </links>
8912         </class>
8913         <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">
8914                 <fields oils_persist:primary="id">
8915                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
8916                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
8917                 </fields>
8918                 <links>
8919                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
8920                 </links>
8921         </class>
8922         <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">
8923                 <fields oils_persist:primary="id">
8924                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
8925                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
8926                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
8927                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
8928                 </fields>
8929                 <links>
8930                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
8931                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
8932                 </links>
8933         </class>
8934         <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">
8935                 <fields oils_persist:primary="xact">
8936                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8937                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
8938                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
8939                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
8940                 </fields>
8941                 <links>
8942                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8943                 </links>
8944         </class>
8945         <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">
8946                 <fields oils_persist:primary="xact">
8947                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
8948                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
8949                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
8950                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
8951                 </fields>
8952                 <links>
8953                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
8954                 </links>
8955         </class>
8956         <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)">
8957                 <fields oils_persist:primary="id">
8958                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
8959                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
8960                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
8961                 </fields>
8962                 <links>
8963                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
8964                 </links>
8965         </class>
8966         <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">
8967                 <fields oils_persist:primary="id">
8968                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
8969                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
8970                 </fields>
8971                 <links>
8972                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
8973                 </links>
8974         </class>
8975         <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">
8976                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
8977                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
8978                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
8979                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
8980                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
8981                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
8982                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
8983                 </fields>
8984                 <links>
8985                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8986                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
8987                 </links>
8988                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8989                         <actions>
8990                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8991                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8992                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8993                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
8994                         </actions>
8995                 </permacrud>
8996         </class>
8997         <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">
8998                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
8999                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9000                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9001                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9002                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9003                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9004                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9005                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9006                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9007                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9008                 </fields>
9009                 <links>
9010                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9011                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9012                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9013                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9014                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9015                 </links>
9016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9017                         <actions>
9018                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9019                                         <context link="formula" field="owner"/>
9020                                 </create>
9021                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9022                                         <context link="formula" field="owner"/>
9023                                 </retrieve>
9024                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9025                                         <context link="formula" field="owner"/>
9026                                 </update>
9027                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9028                                         <context link="formula" field="owner"/>
9029                                 </delete>
9030                         </actions>
9031                 </permacrud>
9032         </class>
9033
9034         <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">
9035                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9036                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9037                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9038                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9039                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9040                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9041                 </fields>
9042                 <links>
9043                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9044                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9045                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9046                 </links>
9047                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9048                         <actions>
9049                                 <create permission="CREATE_PURCHASE_ORDER">
9050                                         <context link="formula" field="owner"/>
9051                 </create>
9052                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9053                                         <context link="formula" field="owner"/>
9054                 </retrieve>
9055                                 <update permission="CREATE_PURCHASE_ORDER">
9056                                         <context link="formula" field="owner"/>
9057                 </update>
9058                                 <delete permission="CREATE_PURCHASE_ORDER">
9059                                         <context link="formula" field="owner"/>
9060                 </delete>
9061                         </actions>
9062                 </permacrud>
9063         </class>
9064
9065         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9066                 <fields oils_persist:primary="id">
9067                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9068                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9069                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9070                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9071                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9072                 </fields>
9073                 <links>
9074                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9075                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9076                 </links>
9077         </class>
9078
9079         <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">
9080                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9081                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9082                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9083                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9084                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9085                 </fields>
9086                 <links>
9087                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9088                 </links>
9089                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9090                         <actions>
9091                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9092                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9093                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9094                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9095                         </actions>
9096                 </permacrud>
9097         </class>
9098
9099         <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">
9100                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9101                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9102                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9103                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9104                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9105                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9106                 </fields>
9107                 <links>
9108                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9109                 </links>
9110                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9111                         <actions>
9112                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9113                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9114                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9115                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9116                         </actions>
9117                 </permacrud>
9118         </class>
9119
9120         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9121                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9122                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9123                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9124                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9125                 </fields>
9126                 <links>
9127                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9128                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9129                 </links>
9130         </class>
9131
9132         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9133                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9134                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9135                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9136                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9137                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9138                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9139                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9140                 </fields>
9141                 <links>
9142                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9143                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9144                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9145                 </links>
9146         </class>
9147
9148         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9149                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9150                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9151                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9152                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9153                 </fields>
9154                 <links>
9155                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9156                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9157                 </links>
9158         </class>
9159
9160         <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">
9161                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9162                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9163                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9164                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9165                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9166                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9167                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9168                 </fields>
9169                 <links>
9170                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9171                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9172                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9173                 </links>
9174         </class>
9175
9176         <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">
9177                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9178                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9179                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9180                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9181                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9182                 </fields>
9183                 <links>
9184                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9185                 </links>
9186                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9187             <actions>
9188                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9189                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9190                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9191                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9192             </actions>
9193                 </permacrud>
9194         </class>
9195
9196         <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">
9197                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9198                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9199                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9200                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9201                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9202                 </fields>
9203                 <links>
9204                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9205                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9206                 </links>
9207                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9208                         <actions>
9209                                 <create permission="ADMIN_CLAIM_POLICY">
9210                                         <context link="claim_policy" field="org_unit"/>
9211                 </create>
9212                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9213                                         <context link="claim_policy" field="org_unit"/>
9214                 </retrieve>
9215                                 <update permission="ADMIN_CLAIM_POLICY">
9216                                         <context link="claim_policy" field="org_unit"/>
9217                 </update>
9218                                 <delete permission="ADMIN_CLAIM_POLICY">
9219                                         <context link="claim_policy" field="org_unit"/>
9220                 </delete>
9221                         </actions>
9222                 </permacrud>
9223         </class>
9224
9225     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9226         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9227             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9228             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9229             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9230             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9231             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9232             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9233             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9234             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9235             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9236             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9237             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9238             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9239             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9240             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9241             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9242             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9243         </fields>
9244         <links>
9245             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9246         </links>
9247     </class>
9248
9249     <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">
9250         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
9251             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9252             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9253             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9254             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9255             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9256         </fields>
9257     </class>
9258
9259     <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">
9260         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9261             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9262             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9263             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9264             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9265             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9266             <field reporter:label="City" name="city" reporter:datatype="text"/>
9267             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9268             <field reporter:label="State" name="state" reporter:datatype="text"/>
9269             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9270             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9271             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9272         </fields>
9273     </class>
9274
9275     <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">
9276         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9277             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9278             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9279             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9280             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9281             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9282             <field reporter:label="City" name="city" reporter:datatype="text"/>
9283             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9284             <field reporter:label="State" name="state" reporter:datatype="text"/>
9285             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9286             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9287             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9288         </fields>
9289     </class>
9290
9291     <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">
9292         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9293             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9294             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9295             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9296             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9297             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9298             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9299         </fields>
9300     </class>
9301
9302         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9303                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9304                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9305                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9306                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9307                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9308                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9309                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9310                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9311                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9312                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9313                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9314                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9315                 </fields>
9316                 <links>
9317                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9318                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9319                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9320                 </links>
9321         </class>
9322
9323         <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">
9324                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9325                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9326                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9327                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9328                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9329                 </fields>
9330                 <links>
9331                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9332                 </links>
9333         </class>
9334
9335     <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">
9336         <fields>
9337             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9338             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9339             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9340         </fields>
9341                 <links>
9342                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9343                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9344                 </links>
9345     </class>
9346
9347     <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">
9348         <fields>
9349             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9350             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9351         </fields>
9352                 <links>
9353                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9354                 </links>
9355     </class>
9356
9357     <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">
9358         <fields>
9359             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9360             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9361             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9362         </fields>
9363                 <links>
9364                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9365                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9366                 </links>
9367     </class>
9368
9369     <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">
9370         <fields>
9371             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9372             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
9373         </fields>
9374                 <links>
9375                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9376                 </links>
9377     </class>
9378
9379     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9380                 <oils_persist:source_definition>
9381
9382             SELECT  DISTINCT l.*
9383               FROM  action.unfulfilled_hold_loops l
9384                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9385               WHERE l.count = m.max
9386
9387                 </oils_persist:source_definition>
9388         <fields>
9389             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9390             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9391             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9392         </fields>
9393                 <links>
9394                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9395                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9396                 </links>
9397     </class>
9398
9399         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9400                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9401                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9402                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9403                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9404                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9405                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9406                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9407                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9408                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9409                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9410                 </fields>
9411                 <links>
9412                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9413                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9414                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9415                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9416                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9417                 </links>
9418         </class>
9419
9420         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9421                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9422                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9423                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9424                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9425                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9426                 </fields>
9427                 <links>
9428                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9429                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9430                 </links>
9431         </class>
9432
9433         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9434                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9435                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9436                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9437                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9438                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9439                 </fields>
9440                 <links>
9441                 </links>
9442         </class>
9443
9444         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9445                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9446                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9447                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9448                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9449                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9450                 </fields>
9451                 <links>
9452                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9453                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9454                 </links>
9455         </class>
9456         
9457         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9458                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9459                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9460                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9461                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9462                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9463                 </fields>
9464                 <links>
9465                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9466                 </links>
9467         </class>
9468         
9469         <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">
9470                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9471                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9472                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9473                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9474                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9475                 </fields>
9476                 <links>
9477                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9478                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9479                 </links>
9480         </class>
9481
9482         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9483                 <fields oils_persist:primary="name">
9484                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9485                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9486                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9487                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9488                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9489                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9490                 </fields>
9491                 <links>
9492                 </links>
9493         </class>
9494
9495         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9496                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9497                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9498                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9499                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9500                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9501                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9502                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9503                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9504                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9505                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9506                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9507                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9508                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9509                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9510                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9511                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9512                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9513                 </fields>
9514                 <links>
9515                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9516                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9517                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9518                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9519                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9520                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9521                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9522                 </links>
9523         </class>
9524
9525         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9526                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9527                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9528                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9529                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9530                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9531                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9532                 </fields>
9533                 <links>
9534                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9535                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9536                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9537                 </links>
9538         </class>
9539
9540         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9541                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9542                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9543                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9544                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9545                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9546                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9547                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9548                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9549                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9550                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9551                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9552                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9553                 </fields>
9554                 <links>
9555                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9556                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9557                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9558                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9559                 </links>
9560         </class>
9561
9562         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9563                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9564                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9565                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9566                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9567                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9568                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9569                 </fields>
9570                 <links>
9571                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9572                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9573                 </links>
9574         </class>
9575
9576         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9577                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9578                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9579                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9580                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9581                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9582                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9583                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9584                 </fields>
9585                 <links>
9586                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9587                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9588                 </links>
9589         </class>
9590
9591         <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">
9592                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9593                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9594                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9595                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9596                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9597                 </fields>
9598                 <links>
9599                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9600                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9601                 </links>
9602         </class>
9603
9604         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9605                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9606                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9607                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9608                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9609                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9610                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9611                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9612                 </fields>
9613                 <links>
9614                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9615                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9616                 </links>
9617         </class>
9618
9619         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9620                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9621                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9622                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9623                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9624                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9625                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9626                 </fields>
9627                 <links>
9628                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9629                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9630                 </links>
9631         </class>
9632
9633         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
9634                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9635                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9636                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9637                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9638                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9639                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9640                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9641                 </fields>
9642                 <links>
9643                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9644                 </links>
9645         </class>
9646
9647         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
9648                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9649                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9650                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9651                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9652                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9653                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9654                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9655                 </fields>
9656                 <links>
9657                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9658                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9659                 </links>
9660         </class>
9661
9662         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
9663                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9664                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9665                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9666                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9667                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9668                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9669                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9670                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9671                 </fields>
9672                 <links>
9673                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9674                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9675                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9676                 </links>
9677         </class>
9678
9679         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
9680                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9681                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9682                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9683                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9684                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9685                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9686                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9687                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9688                 </fields>
9689                 <links>
9690                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9691                 </links>
9692         </class>
9693
9694         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
9695                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9696                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9697                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9698                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9699                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9700                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9701                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9702                 </fields>
9703                 <links>
9704                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9705                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9706                 </links>
9707         </class>
9708
9709         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
9710                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9711                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9712                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9713                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9714                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9715                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9716                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9717                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9718                 </fields>
9719                 <links>
9720                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9721                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9722                 </links>
9723         </class>
9724
9725         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
9726                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9727                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9728                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9729                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9730                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9731                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9732                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9733                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9734                 </fields>
9735                 <links>
9736                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9737                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9738                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9739                 </links>
9740         </class>
9741
9742         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
9743                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9744                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9745                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9746                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9747                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9748                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9749                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9750                 </fields>
9751                 <links>
9752                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9753                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9754                 </links>
9755         </class>
9756
9757         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
9758                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9759                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9760                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9761                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9762                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9763                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9764                 </fields>
9765                 <links>
9766                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9767                 </links>
9768         </class>
9769
9770         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
9771                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9772                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9773                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9774                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9775                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9776                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9777                 </fields>
9778                 <links>
9779                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9780                 </links>
9781         </class>
9782
9783         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
9784                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9785                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9786                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9787                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9788                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9789                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9790                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9791                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9792                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9793                 </fields>
9794                 <links>
9795                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9796                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9797                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9798                 </links>
9799         </class>
9800
9801         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
9802                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9803                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9804                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9805                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9806                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9807                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9808                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9809                 </fields>
9810                 <links>
9811                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9812                 </links>
9813         </class>
9814
9815         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
9816                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9817                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9818                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9819                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9820                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9821                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9822                 </fields>
9823                 <links>
9824                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9825                 </links>
9826         </class>
9827
9828         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
9829                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9830                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9831                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9832                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9833                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9834                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9835                 </fields>
9836                 <links>
9837                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9838                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9839                 </links>
9840         </class>
9841
9842         <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">
9843                 <fields oils_persist:primary="id">
9844                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
9845                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
9846                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
9847                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
9848                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
9849                 </fields>
9850                 <links>
9851                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
9852                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9853                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
9854                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
9855                 </links>
9856         </class>
9857
9858         <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">
9859                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
9860                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9861                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
9862                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
9863                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
9864                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9865                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9866                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
9867                 </fields>
9868                 <links/>
9869                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9870                         <actions>
9871                                 <retrieve/>
9872                         </actions>
9873                 </permacrud>
9874         </class>
9875
9876         <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">
9877                 <fields oils_persist:primary="ptype_key">
9878                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
9879                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9880                 </fields>
9881                 <links/>
9882                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9883                         <actions>
9884                                 <retrieve/>
9885                         </actions>
9886                 </permacrud>
9887         </class>
9888
9889         <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">
9890                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
9891                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9892                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
9893                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
9894                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
9895                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
9896                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9897                 </fields>
9898                 <links>
9899                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
9900                 </links>
9901                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9902                         <actions>
9903                                 <retrieve/>
9904                         </actions>
9905                 </permacrud>
9906         </class>
9907
9908         <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">
9909                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
9910                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9911                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
9912                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
9913                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
9914                 </fields>
9915                 <links>
9916                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
9917                 </links>
9918                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9919                         <actions>
9920                                 <retrieve/>
9921                         </actions>
9922                 </permacrud>
9923         </class>
9924
9925     <class
9926         id="uvs"
9927         controller="open-ils.cstore open-ils.pcrud"
9928         oils_obj:fieldmapper="url_verify::session"
9929         oils_persist:tablename="url_verify.session"
9930         reporter:label="URL Verification Session"
9931     >
9932         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
9933             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
9934             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9935                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
9936             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9937             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
9938             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9939             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
9940             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
9941             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
9942         </fields>
9943
9944         <links>
9945             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9946             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9947             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
9948             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
9949             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
9950         </links>
9951
9952         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9953             <actions>
9954                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
9955             </actions>
9956         </permacrud>
9957
9958     </class>
9959
9960     <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">
9961         <oils_persist:source_definition>
9962             SELECT
9963                 cbrebi.id AS id,  -- so we can have a pkey in our view
9964                 uvs.id AS session,
9965                 uvs.owning_lib,
9966                 cbrebi.target_biblio_record_entry
9967             FROM url_verify.session uvs
9968             JOIN container.biblio_record_entry_bucket cbreb
9969                 ON (uvs.container = cbreb.id)
9970             JOIN container.biblio_record_entry_bucket_item cbrebi
9971                 ON (cbrebi.bucket = cbreb.id)
9972         </oils_persist:source_definition>
9973         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
9974             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
9975             <field reporter:label="Session" name="session" reporter:datatype="link" />
9976             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
9977             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
9978         </fields>
9979         <links>
9980             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
9981             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
9982             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
9983         </links>
9984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9985             <actions>
9986                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
9987             </actions>
9988         </permacrud>
9989     </class>
9990
9991     <class
9992         id="uvus"
9993         controller="open-ils.cstore open-ils.pcrud"
9994         oils_obj:fieldmapper="url_verify::url_selector"
9995         oils_persist:tablename="url_verify.url_selector"
9996         reporter:label="URL Verification URL Selector"
9997     >
9998         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
9999             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10000             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10001                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10002             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10003         </fields>
10004
10005         <links>
10006             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10007             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10008         </links>
10009
10010         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10011             <actions>
10012                 <create permission="URL_VERIFY">
10013                     <context link="session" field="owning_lib"/>
10014                 </create>
10015                 <retrieve permission="URL_VERIFY">
10016                     <context link="session" field="owning_lib"/>
10017                 </retrieve>
10018                 <update permission="URL_VERIFY">
10019                     <context link="session" field="owning_lib"/>
10020                 </update>
10021                 <delete permission="URL_VERIFY">
10022                     <context link="session" field="owning_lib"/>
10023                 </delete>
10024             </actions>
10025         </permacrud>
10026
10027     </class>
10028
10029     <class
10030         id="uvu"
10031         controller="open-ils.cstore open-ils.pcrud"
10032         oils_obj:fieldmapper="url_verify::url"
10033         oils_persist:tablename="url_verify.url"
10034         reporter:label="URL Verification URL"
10035     >
10036         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10037             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10038                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10039                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10040                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10041                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10042             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10043             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10044             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10045             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10046             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10047             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10048             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10049             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10050             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10051             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10052             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10053             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10054             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10055         </fields>
10056
10057         <links>
10058             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10059             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10060             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10061             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10062             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10063         </links>
10064
10065         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10066             <actions>
10067                 <create permission="URL_VERIFY">
10068                     <context link="session" field="owning_lib"/>
10069                 </create>
10070                 <retrieve permission="URL_VERIFY">
10071                     <context link="session" field="owning_lib"/>
10072                 </retrieve>
10073                 <update permission="URL_VERIFY">
10074                     <context link="session" field="owning_lib"/>
10075                 </update>
10076                 <delete permission="URL_VERIFY">
10077                     <context link="session" field="owning_lib"/>
10078                 </delete>
10079             </actions>
10080         </permacrud>
10081
10082     </class>
10083
10084     <class
10085         id="uvva"
10086         controller="open-ils.cstore open-ils.pcrud"
10087         oils_obj:fieldmapper="url_verify::verification_attempt"
10088         oils_persist:tablename="url_verify.verification_attempt"
10089         reporter:label="URL Verification Attempt"
10090     >
10091         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10092             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10093                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10094                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10095             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10096             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10097         </fields>
10098
10099         <links>
10100             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10101             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10102         </links>
10103
10104         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10105             <actions>
10106                 <create permission="URL_VERIFY">
10107                     <context link="session" field="owning_lib"/>
10108                 </create>
10109                 <retrieve permission="URL_VERIFY">
10110                     <context link="session" field="owning_lib"/>
10111                 </retrieve>
10112                 <update permission="URL_VERIFY">
10113                     <context link="session" field="owning_lib"/>
10114                 </update>
10115                 <delete permission="URL_VERIFY">
10116                     <context link="session" field="owning_lib"/>
10117                 </delete>
10118             </actions>
10119         </permacrud>
10120
10121     </class>
10122
10123     <class
10124         id="uvuv"
10125         controller="open-ils.cstore open-ils.pcrud"
10126         oils_obj:fieldmapper="url_verify::url_verification"
10127         oils_persist:tablename="url_verify.url_verification"
10128         reporter:label="URL Verification"
10129     >
10130         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10131             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10132                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10133                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10134             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10135             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10136             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10137             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10138                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10139         </fields>
10140
10141         <links>
10142             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10143             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10144             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10145         </links>
10146
10147         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10148             <actions>
10149                 <create permission="URL_VERIFY">
10150                     <context link="attempt" jump="session" field="owning_lib"/>
10151                 </create>
10152                 <retrieve permission="URL_VERIFY">
10153                     <context link="attempt" jump="session" field="owning_lib"/>
10154                 </retrieve>
10155                 <update permission="URL_VERIFY">
10156                     <context link="attempt" jump="session" field="owning_lib"/>
10157                 </update>
10158                 <delete permission="URL_VERIFY">
10159                     <context link="attempt" jump="session" field="owning_lib"/>
10160                 </delete>
10161             </actions>
10162         </permacrud>
10163
10164     </class>
10165
10166         <class
10167                 id="cfdi"
10168                 controller="open-ils.cstore open-ils.pcrud"
10169                 oils_obj:fieldmapper="config::filter_dialog_interface"
10170                 oils_persist:tablename="config.filter_dialog_interface"
10171                 reporter:label="FilterDialog Interface">
10172                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10173                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10174                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10175                 </fields>
10176                 <links>
10177                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10178                 </links>
10179                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10180                         <actions>
10181                                 <retrieve />
10182                         </actions>
10183                 </permacrud>
10184         </class>
10185
10186         <class
10187                 id="cfdfs"
10188                 controller="open-ils.cstore open-ils.pcrud"
10189                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10190                 oils_persist:tablename="config.filter_dialog_filter_set"
10191                 reporter:label="FilterDialog Filter Set">
10192                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10193                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10194                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10195                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10196                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10197                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10198                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10199                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10200                 </fields>
10201                 <links>
10202                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10203                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10204                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10205                 </links>
10206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10207                         <actions>
10208                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10209                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10210                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10211                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10212                         </actions>
10213                 </permacrud>
10214
10215         </class>
10216
10217         <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">
10218                 <fields oils_persist:primary="code">
10219                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10220                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10221                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10222                 </fields>
10223                 <links/>
10224                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10225                         <actions>
10226                                 <retrieve/>
10227                         </actions>
10228                 </permacrud>
10229         </class>
10230
10231         <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">
10232                 <oils_persist:source_definition>
10233
10234             SELECT  b.id,
10235                     MAX(dcp.edit_date) AS last_delete_date
10236              FROM   biblio.record_entry b
10237                     JOIN asset.call_number cn ON (cn.record = b.id)
10238                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10239              WHERE  NOT b.deleted
10240              GROUP BY b.id
10241              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10242
10243                 </oils_persist:source_definition>
10244                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10245                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10246                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10247                 </fields>
10248                 <links>
10249                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10250                 </links>
10251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10252                         <actions>
10253                                 <retrieve/>
10254                         </actions>
10255                 </permacrud>
10256         </class>
10257
10258         <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">
10259                 <oils_persist:source_definition>
10260
10261             -- -- 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.
10262             -- -- 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
10263             -- -- may not.
10264             -- SELECT
10265             --     bre.id AS "bib_id",
10266             --     COALESCE( z.copy_count, 0 ) AS "copy_count",
10267             --     COALESCE( z.hold_count, 0 ) AS "hold_count",
10268             --     COALESCE( z.copy_hold_ratio, 0 ) AS "hold_copy_ratio"
10269             -- FROM (
10270                 SELECT
10271                     y.bre AS "id",
10272                     COALESCE( x.copy_count, 0 ) AS "copy_count",
10273                     y.hold_count AS "hold_count",
10274                     (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"
10275                 FROM (
10276                         SELECT
10277                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS "bre",
10278                             COUNT(*) AS "hold_count"
10279                         FROM action.hold_request h
10280                         WHERE
10281                             cancel_time IS NULL
10282                             AND fulfillment_time IS NULL
10283                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10284                         GROUP BY 1
10285                     )y LEFT JOIN (
10286                         SELECT 
10287                             (SELECT id
10288                                 FROM biblio.record_entry 
10289                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
10290                             ) AS "bre", 
10291                             COUNT(*) AS "copy_count"
10292                         FROM asset.copy
10293                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10294                         WHERE copy.holdable 
10295                             AND NOT copy.deleted 
10296                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10297                         GROUP BY 1
10298                     )x ON x.bre = y.bre
10299                 -- )z RIGHT JOIN (
10300                 --     SELECT id
10301                 --     FROM biblio.record_entry
10302                 --     WHERE NOT deleted
10303                 -- )bre ON (z.bib_id = bre.id)
10304                 
10305
10306                 </oils_persist:source_definition>
10307                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10308                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10309                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10310                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10311                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10312                 </fields>
10313                 <links>
10314                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10315                 </links>
10316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10317                         <actions>
10318                                 <retrieve/>
10319                         </actions>
10320                 </permacrud>
10321         </class>
10322
10323         <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">
10324                 <oils_persist:source_definition>
10325             SELECT *,
10326                 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,
10327                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10328             FROM
10329                 (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
10330                     FROM
10331                         action.hold_request ahr
10332                         JOIN reporter.hold_request_record rhrr USING (id)
10333                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10334                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10335                     WHERE
10336                         ahr.cancel_time IS NULL
10337                         AND ahr.fulfillment_time IS NULL
10338                     GROUP BY bib_record, pickup_lib
10339                 )x
10340                 JOIN
10341                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10342                     FROM
10343                         action.hold_request ahr
10344                         JOIN reporter.hold_request_record rhrr USING (id)
10345                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10346                     WHERE
10347                         ahr.cancel_time IS NULL
10348                         AND ahr.fulfillment_time IS NULL
10349                     GROUP BY bib_record
10350                 )y
10351                 USING (id)
10352                 </oils_persist:source_definition>
10353                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10354                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10355                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10356                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10357                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10358                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10359                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10360                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10361                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10362                 </fields>
10363                 <links>
10364                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10365                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10366                 </links>
10367                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10368                         <actions>
10369                                 <retrieve/>
10370                         </actions>
10371                 </permacrud>
10372         </class>
10373
10374         <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">
10375                 <oils_persist:source_definition>
10376             SELECT
10377                 ac.id,
10378                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10379                 MAX(actac.xact_start) AS last_circ
10380             FROM asset.copy ac
10381                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10382             GROUP BY ac.id
10383
10384             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10385             --SELECT
10386             --    ac.id,
10387             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10388             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10389             --FROM asset.copy ac
10390             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10391             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10392             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10393                 </oils_persist:source_definition>
10394                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10395                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10396                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10397                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10398                 </fields>
10399                 <links>
10400                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10401                 </links>
10402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10403                         <actions>
10404                                 <retrieve/>
10405                         </actions>
10406                 </permacrud>
10407         </class>
10408
10409         <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">
10410                 <fields oils_persist:primary="id">
10411                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10412                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10413                 </fields>
10414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10415                         <actions>
10416                                 <retrieve/>
10417                         </actions>
10418                 </permacrud>
10419         </class>
10420
10421         <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">
10422                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10423                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10424                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10425                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10426                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10427                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10428                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10429                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10430                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10431                 </fields>
10432                 <links>
10433                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10434                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10435                 </links>
10436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10437                         <actions>
10438                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10439                                 <retrieve/>
10440                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10441                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10442                         </actions>
10443                 </permacrud>
10444         </class>
10445
10446         <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">
10447                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10448                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10449                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10450                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10451                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10452                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10453                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10454                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10455                 </fields>
10456                 <links>
10457                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10458                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10459                 </links>
10460                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10461                         <actions>
10462                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10463                                 <retrieve/>
10464                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10465                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10466                         </actions>
10467                 </permacrud>
10468         </class>
10469
10470
10471         <!-- ********************************************************************************************************************* -->
10472         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10473         <!-- ********************************************************************************************************************* -->
10474         <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">
10475                 <fields oils_persist:primary="id">
10476                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10477                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10478                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10479                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10480                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10481                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10482                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10483                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10484                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10485                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10486                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10487                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10488                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10489                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10490                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10491                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10492                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10493                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10494                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10495                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10496                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10497                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10498                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10499                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10500                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10501                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10502                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10503                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10504                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10505                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10506                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10507                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10508                 </fields>
10509                 <links>
10510                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10511                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10512                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10513                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10514                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10515                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10516                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10517                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10518                 </links>
10519         </class>
10520
10521         <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">
10522                 <fields oils_persist:primary="id">
10523                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10524                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10525                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10526                 </fields>
10527                 <links>
10528                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10529                 </links>
10530         </class>
10531
10532         <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">
10533                 <fields oils_persist:primary="id">
10534                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10535                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10536                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10537                 </fields>
10538                 <links>
10539                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10540                 </links>
10541         </class>
10542
10543         <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">
10544                 <fields oils_persist:primary="id">
10545                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10546
10547                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10548                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10549                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10550
10551                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10552                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10553                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10554
10555                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10556                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10557
10558                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10559                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10560                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10561
10562                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10563                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10564
10565                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10566                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10567                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10568
10569                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10570                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10571                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10572
10573                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10574                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
10575                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
10576                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
10577
10578                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
10579                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
10580
10581                 </fields>
10582                 <links>
10583                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
10584                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10585                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
10586                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
10587                 </links>
10588         </class>
10589
10590         <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">
10591                 <oils_persist:source_definition>
10592
10593             SELECT
10594                 po.ordering_agency AS ordering_agency,
10595                 po.id AS purchase_order,
10596                 li.id AS lineitem,
10597                 lid.id AS lineitem_detail,
10598                 cpa.id AS claim_policy_action
10599             FROM
10600                 acq.lineitem_detail lid
10601                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
10602                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
10603                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
10604                 JOIN acq.claim_policy_action cpa ON (
10605                     cpa.claim_policy = cp.id
10606
10607                     -- we only care about claim policy actions whose claim
10608                     -- interval we'd reached or exceeded
10609                     AND (NOW() - cpa.action_interval) &gt; po.order_date
10610
10611                     -- filter out all claim policy actions where claim events
10612                     -- have occurred on or after the action's action_interval
10613                     AND NOT EXISTS (
10614                         SELECT 1
10615                         FROM
10616                             acq.claim_event evt
10617                             JOIN acq.claim claim ON (
10618                                 claim.id = evt.claim
10619                                 AND claim.lineitem_detail = lid.id
10620                             )
10621                         WHERE
10622                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
10623                     )
10624                 )
10625             WHERE
10626                 lid.cancel_reason IS NULL
10627                 AND li.cancel_reason IS NULL -- belt/suspenders
10628                 AND po.cancel_reason IS NULL -- belt/suspenders
10629                 AND lid.recv_time IS NULL
10630                 AND po.state = 'on-order'
10631             ORDER BY 1, 2, 3, 4, 5
10632
10633                 </oils_persist:source_definition>
10634                 <fields>
10635                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10636                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10637                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10638                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
10639                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
10640                 </fields>
10641                 <links>
10642                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10643                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10644                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10645                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
10646                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
10647                 </links>
10648         </class>
10649         <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">
10650                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10651                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10652                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10653                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10654                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10655                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10656                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10657                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10658                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10659                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10660                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10661                 </fields>
10662                 <links>
10663                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10664                 </links>
10665     </class>
10666         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
10667                 <oils_persist:source_definition>
10668             SELECT * FROM acq.lineitem_summary 
10669                                 WHERE item_count > (invoice_count + cancel_count)
10670         </oils_persist:source_definition>
10671                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
10672                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
10673                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
10674                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
10675                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
10676                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
10677                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
10678                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
10679                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
10680                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
10681                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
10682                 </fields>
10683                 <links>
10684                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10685                 </links>
10686     </class>
10687         <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">
10688                 <oils_persist:source_definition>
10689
10690                         SELECT  t.*
10691                           FROM  action.transit_copy t
10692                                 JOIN actor.org_unit AS s ON (t.source = s.id)
10693                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
10694                           WHERE s.parent_ou &lt;&gt; d.parent_ou
10695
10696                 </oils_persist:source_definition>
10697                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
10698                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
10699                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
10700                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
10701                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
10702                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
10703                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
10704                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
10705                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
10706                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
10707                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
10708                 </fields>
10709                 <links>
10710                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
10711                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
10712                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
10713                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
10714                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10715                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
10716                 </links>
10717         </class>
10718
10719     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
10720                 <oils_persist:source_definition>
10721
10722         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
10723                 SELECT
10724                         cp.id as copy,
10725                         COUNT(circ.id),
10726                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10727                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10728                 FROM
10729                         asset.copy cp
10730                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
10731                 GROUP BY 1, 3, 4
10732                 UNION ALL
10733                 SELECT
10734                         cp.id as copy,
10735                         COUNT(circ.id),
10736                         EXTRACT(YEAR FROM circ.xact_start) AS year,
10737                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
10738                 FROM
10739                         asset.copy cp
10740                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
10741                 GROUP BY 1, 3, 4
10742                 UNION ALL
10743                 SELECT
10744                         id as copy,
10745                         circ_count,
10746                         -1 AS year,
10747                         false as is_renewal
10748                 FROM
10749                         extend_reporter.legacy_circ_count
10750         )x GROUP BY 1, 3, 4
10751
10752                 </oils_persist:source_definition>
10753         <fields>
10754             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
10755             <field reporter:label="Count" name="count" reporter:datatype="int"/>
10756             <field reporter:label="Year" name="year" reporter:datatype="int"/>
10757             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
10758         </fields>
10759                 <links>
10760                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
10761                 </links>
10762                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10763                         <actions>
10764                                 <retrieve/>
10765                         </actions>
10766                 </permacrud>
10767     </class>
10768
10769         <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">
10770                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
10771                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
10772                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
10773                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
10774                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
10775                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
10776                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
10777                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
10778                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
10779                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
10780                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
10781                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
10782                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
10783                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
10784                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
10785                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
10786                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
10787                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
10788                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
10789                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
10790                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
10791                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
10792                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
10793                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
10794                         <field reporter:label="Check Out Date/Time" name="xact_start" reporter:datatype="timestamp" />
10795                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
10796                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
10797                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
10798                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
10799                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
10800                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
10801                 </fields>
10802                 <links>
10803                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
10804                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
10805                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
10806                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
10807                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
10808                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10809                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10810                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
10811                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
10812                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
10813                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
10814                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
10815                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
10816                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
10817                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
10818                 </links>
10819         </class>
10820
10821     <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">
10822         <fields oils_persist:primary="id">
10823             <field reporter:label="Title" name="title" reporter:datatype="text"/>
10824             <field reporter:label="Author" name="author" reporter:datatype="text"/>
10825             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
10826             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
10827             <field reporter:label="Price" name="price" reporter:datatype="money"/>
10828             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10829             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
10830             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
10831             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10832             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
10833             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10834             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
10835             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="text"/>
10836             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="text"/>
10837             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10838             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10839             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
10840             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
10841             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
10842             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
10843             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
10844             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
10845             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10846             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
10847             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
10848             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
10849             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
10850             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
10851             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
10852             <field reporter:label="Status" name="status" reporter:datatype="link"/>
10853             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
10854             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
10855             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
10856             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
10857         </fields>
10858         <links>
10859             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10860             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10861             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10862             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10863             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
10864             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
10865         </links>
10866     </class>
10867
10868     <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">
10869         <fields oils_persist:primary="id">
10870             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10871             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10872             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10873             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10874         </fields>
10875         <links>
10876             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10877             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10878         </links>
10879     </class>
10880
10881     <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">
10882         <fields oils_persist:primary="owning_lib">
10883             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10884             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10885             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10886         </fields>
10887         <links>
10888             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10889         </links>
10890     </class>
10891
10892     <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">
10893         <fields oils_persist:primary="id">
10894             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10895             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10896             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10897             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10898             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10899         </fields>
10900         <links>
10901             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10902             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10903             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10904         </links>
10905     </class>
10906
10907     <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">
10908         <fields oils_persist:primary="circ_lib">
10909             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
10910             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10911             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10912             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10913         </fields>
10914         <links>
10915             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10916             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10917         </links>
10918     </class>
10919
10920     <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">
10921         <fields oils_persist:primary="id">
10922             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
10923             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10924             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10925             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
10926             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
10927         </fields>
10928         <links>
10929             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10930             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10931             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10932         </links>
10933     </class>
10934
10935     <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">
10936         <fields oils_persist:primary="home_ou">
10937             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
10938             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10939             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
10940             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
10941         </fields>
10942         <links>
10943             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10944             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
10945         </links>
10946     </class>
10947         <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">
10948                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
10949                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
10950                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
10951                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
10952                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10953                 </fields>
10954                 <links>
10955                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10956                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
10957                 </links>
10958                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10959                         <actions>
10960                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10961                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
10962                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10963                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
10964                         </actions>
10965                 </permacrud>
10966         </class>
10967         <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">
10968                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
10969                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
10970                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10971                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
10972                 </fields>
10973                 <links>
10974                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10975                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
10976                         </links>
10977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10978                 <actions>
10979                                 <create permission="ADMIN_ACQ_FUND_TAG">
10980                                         <context link="tag" field="owner"/>
10981                                 </create>
10982                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10983                                         <context link="tag" field="owner"/>
10984                                 </retrieve>
10985                                 <update permission="ADMIN_ACQ_FUND_TAG">
10986                                         <context link="tag" field="owner"/>
10987                                 </update>
10988                                 <delete permission="ADMIN_ACQ_FUND_TAG">
10989                                         <context link="tag" field="owner"/>
10990                                 </delete>
10991                         </actions>
10992                 </permacrud>
10993         </class>
10994         <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">
10995                 <oils_persist:source_definition><![CDATA[
10996                 SELECT
10997                         poi.purchase_order AS purchase_order,
10998                         ii.invoice AS invoice,
10999                         NULL AS lineitem,
11000                         poi.id AS po_item,
11001                         NULL AS picklist
11002                 FROM
11003                         acq.po_item poi
11004                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11005                 UNION SELECT
11006                         jub.purchase_order AS purchase_order,
11007                         ie.invoice AS invoice,
11008                         jub.id AS lineitem,
11009                         NULL AS po_item,
11010                         jub.picklist AS picklist
11011                 FROM
11012                         acq.lineitem jub
11013                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11014                 UNION SELECT
11015                         ii.purchase_order AS purchase_order,
11016                         ii.invoice AS invoice,
11017                         NULL AS lineitem,
11018                         NULL AS po_item,
11019                         NULL AS picklist
11020                 FROM
11021                         acq.invoice_item ii
11022                 WHERE ii.po_item IS NULL
11023                 UNION SELECT
11024                         ie.purchase_order AS purchase_order,
11025                         ie.invoice AS invoice,
11026                         NULL AS lineitem,
11027                         NULL AS po_item,
11028                         NULL AS picklist
11029                 FROM
11030                         acq.invoice_entry ie
11031                 WHERE ie.lineitem IS NULL
11032                 UNION SELECT
11033                         NULL AS purchase_order,
11034                         NULL AS invoice,
11035                         jub.id AS lineitem,
11036                         NULL AS po_item,
11037                         jub.picklist AS picklist
11038                 FROM
11039                         acq.lineitem jub
11040                 WHERE jub.purchase_order IS NULL
11041                 ]]></oils_persist:source_definition>
11042                 <fields>
11043                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11044                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11045                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11046                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11047                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11048                 </fields>
11049                 <links>
11050                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11051                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11052                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11053                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11054                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11055                 </links>
11056         </class>
11057         <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">
11058                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11060                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11061                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11062                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11063                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11064                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11065                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11066                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11067                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11068                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11069                 </fields>
11070                 <links>
11071                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11072                 </links>
11073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11074                         <actions>
11075                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11076                                 <retrieve/>
11077                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11078                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11079                         </actions>
11080                 </permacrud>
11081         </class>
11082
11083         <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">
11084                 <fields oils_persist:primary="date_applied" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11085                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11086                         <field name="date_applied" reporter:datatype="timestamp"/>
11087                         <field name="org" reporter:datatype="org_unit"/>
11088                         <field name="original_value" reporter:datatype="text"/>
11089                         <field name="new_value" reporter:datatype="text"/>
11090                         <field name="field_name" reporter:datatype="link"/>
11091                 </fields>
11092                 <links>
11093                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11094                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11095                 </links>
11096                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11097                         <actions>
11098                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11099                                 <retrieve/>
11100                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11101                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11102                         </actions>
11103                 </permacrud>
11104         </class>
11105         <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">
11106                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11107                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11108                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11109                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11110                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11111                 </fields>
11112                 <links>
11113                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11114                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11115                 </links>
11116         </class>
11117         <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">
11118                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11119                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11120                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11121                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11122                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11123                 </fields>
11124                 <links>
11125                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11126                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11127                 </links>
11128         </class>
11129         <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">
11130                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11131                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11132                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11133                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11134                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11135                 </fields>
11136                 <links>
11137                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11138                 </links>
11139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11140                         <actions>
11141                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11142                                 <retrieve/>
11143                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11144                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11145                         </actions>
11146                 </permacrud>
11147         </class>
11148         <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">
11149                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11150                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11151                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11152                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11153                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11154                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11155                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11156                 </fields>
11157                 <links>
11158                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11159                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
11160                 </links>
11161                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11162                         <actions>
11163                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11164                                 <retrieve/>
11165                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11166                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11167                         </actions>
11168                 </permacrud>
11169         </class>
11170
11171         <!-- ********************************************************************************************************************* -->
11172
11173 </IDL>
11174
11175 <!--
11176     vim:noet:ts=4:sw=4:
11177 -->